German: syntax-semantics

What is semantics VS Syntax?

Semantics, on the other hand, is about the meaning of a program (or other chunk of source code).

And sometimes the line between the two can be blurry.

One way to understand the distinction is to look at the kinds of errors you get when your program's syntax or semantics is incorrect.

A syntax error is a failure of the source code to match the language grammar, for example, not having a semicolon where one is required.

A semantic error is a failure to satisfy other language requirements (what C, for example, calls "constraints"); an example might be writing x + y where x and y are of incompatible types. The language grammar tells you that an addition looks like something + something, but it's not powerful enough to express the requirements on the types of the left and right operands.

See also:
Metadata and Semantic Research: Third International Conference, MTSR 2009, Milan, Italy, October 1-2, 2009. Proceedings (Communications in Computer and Information Science)
Book (Springer)
Charting the Topic Maps Research and Applications Landscape: First International Workshop on Topic Map Research and Applications, TMRA 2005, Leipzig, ... / Lecture Notes in Artificial Intelligence)
Book (Springer)
  • Used Book in Good Condition
Leveraging the Semantics of Topic Maps: Second International Conference on Topic Maps Research and Applications, TMRA 2006, Leipzig, Germany, October ... / Lecture Notes in Artificial Intelligence)
Book (Springer)
Advances in Information Retrieval: 34th European Conference on IR Research, ECIR 2012, Barcelona, Spain, April 1-5, 2012, Proceedings (Lecture Notes ... Applications, incl. Internet/Web, and HCI)
Book (Springer)
  • Used Book in Good Condition
Related Posts