Are semantics and syntax the same?

SyntaxTerminologySemantics

Syntax Problem Overview


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.

Syntax Solutions


Solution 1 - Syntax

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.

Solution 2 - Syntax

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.

Solution 3 - Syntax

A program that is syntactically correct will compile and run.

A program that is semantically correct will actually do what you as the programmer intended it to do. i.e. it doesn't have any bugs in it.

Two programs written to perform the same task in different languages will use different syntaxes, but they would be the same semantically.

Solution 4 - Syntax

If you are talking about web (rather than programming languages):

The syntax of the language is whatever the browser (or processing program) can legally recognize and handle, and render to you. For example, your browser can render HTML, while your API can parse XML trees.

Semantics involve what is actually being represented. There's a lot of buzz now about semantic webs and all that stuff, but it essentially means that each entity is also associated with some human-readable information or metadata, so that a certain tag would have a supposed meaning and refer you to it.

Social networks are the same story. You put knowledge in the links

Solution 5 - Syntax

"An ant ate an aunt." has a correct syntax, but will not make sense semantically. A syntax is a set of rules that can be combined to produce infinite number of gramatically valid sentences, but few, very few of which has a semantics.

Solution 6 - Syntax

Syntax is the word order of a sentence. In English it would be the subject-verb-object form.

Semantic is the meaning behind words. E.g: she ate a saw. The word saw doesn't match according to the meaning of the sentence. but it is grammatically correct. so its syntax is correct. =)

Solution 7 - Syntax

Specifically, semantic social networking means embedding the actual social relationships within the page markup. The standard format for doing this as defined by microformats is XFN, XHTML Friends Network. In regards to the semantic web in general, microformats should be the go-to guide for defining embedded semantic content.

Solution 8 - Syntax

Semantic web sites use the concept of the semantic web, which aims to bring meaning to web content by using special annotations to identify certain concepts in a page. This makes possible the automatic (by a computer, not a human) reasoning about the content, which improves its aggregation, extraction, indexing and searching.

Solution 9 - Syntax

Explanations above are vague on the semantics side, semantics could mean the different elements at disposition to build arguments of value(these being comprehensible, to end-user man and digestible to the machine).

Of course this puts semantics and the programmer-editor-writer-communicator in the middle: he decides on the semantics that should be ideally defined to his public, comprehended by his public, general convention by his public and digestible to the machine-computer. Semantics should be agreed upon, are conceptual, must be implementable to both sides.

Say footnotes, inline and block-quotes, titles and on and on to end up into a well-defined and finite list. Mediawiki, wikitext as an example fails in that perspective, defining syntax for elements of semantic meaning left undefined, no finite list agreed upon. "meaning by form" as additional of what a title as an example again carries as textual content. Example "This is a title" becomes only semantics integrated by the supposition within agreed upon semantics, and there can be more then one set of say "This is important and will be detailed"

Asciidoc and pandoc markup is quite different in it's semantics, regardless of how each translates this by convention of syntax to output formats.

Programming, output formats as html, pdf, epub can have consequentially meaning by form, by semantics, the syntax having disappeared as a temporary tool of translation, and as one more consequence thus the output can be scanned robotically for meaning, the champ of algorithms of 'grep': Google. Looking for the meaning of "what" in "What is it that is looked for" based upon whether a title or a footnote, or a link is considered.

Semantics, and there can be more then one layer, even the textual message carries (Chomsky) semantics thus could be translated as meaning by form, creating functional differences to anything else in the output chain, including a human being, the reader.

As a conclusion, programmers and academics should be integrated, no academic should be without knowledge of his tools, as any bread and butter carpenter. Programmers should be academics in the sense that the other end of the bridging they accomplish is the end user, the bridge... much so: semantics.

m.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohnView Question on Stackoverflow
Solution 1 - SyntaxChristian LescuyerView Answer on Stackoverflow
Solution 2 - SyntaxmstroblView Answer on Stackoverflow
Solution 3 - SyntaxSam HaslerView Answer on Stackoverflow
Solution 4 - SyntaxUriView Answer on Stackoverflow
Solution 5 - SyntaxyogmanView Answer on Stackoverflow
Solution 6 - SyntaxDilani27View Answer on Stackoverflow
Solution 7 - SyntaxLexView Answer on Stackoverflow
Solution 8 - SyntaxJordãoView Answer on Stackoverflow
Solution 9 - Syntaxuser4932554View Answer on Stackoverflow