Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are semantics and syntax the same?

What is the difference in meaning between 'semantics' and 'syntax'? What are they?

Also, what's the difference between things like "semantic website vs. normal website", "semantic social networking vs. normal social networking" etc.

like image 627
John Avatar asked Oct 16 '08 19:10

John


People also ask

Is syntax part of semantic?

Syntax refers to the set of rules that create sentence structure. Writers can also call these the grammar rules. Semantics refers to the study of the meaning of sentences. Sometimes, grammatically correct words do not make sense, even when they are correct grammatically.

How does syntax relate to semantics?

Syntax is defined as the study of how words are placed within a sentence. It is used in the construction and arrangement of phrases, clauses and sentences while semantic is the study of meaning at mainly two different, basic levels: the word and the sentence.

What is the difference between syntax and semantics in programming?

The syntax of a programming language describes which strings of of characters comprise a valid program. The semantics of a programming language describes what syntactically valid programs mean, what they do.

What is difference between syntax and semantic analysis?

Syntax analysis is the process of analyzing a string of symbols either in natural language, computer languages or data structures conforming to the rules of a formal grammar. In contrast, semantic analysis is the process of checking whether the generated parse tree is according to the rules of the programming language.


2 Answers

Syntax is the grammar. It describes the way to construct a correct sentence. For example, this water is triangular is syntactically correct.

Semantics relates to the meaning. this water is triangular does not mean anything, though the grammar is ok.

Talking about the semantic web has become trendy recently. The idea is to enhance the markup (structural with HTML) with additional data so computer could make sense of the web pages more easily.

like image 159
Christian Lescuyer Avatar answered Jan 05 '23 05:01

Christian Lescuyer


Syntax is the grammar of a language - the rules by which to form sentences or expressions.

Semantics is the meaning you are trying to express with your code.

like image 32
mstrobl Avatar answered Jan 05 '23 04:01

mstrobl