Prometheus Blogs

The difference between semantics and syntax

03/16/2016

The distinction between ‘semantics’ and ‘syntax’ escapes a lot of folks.

The word ‘semantics’ typically connotes ‘meaning’. It could be the meaning of an English word or sentence, or the meaning of an XML file. It can also denote the study of meaning in linguistics or logic, but that’s not the most common use today.

Syntax, on the other hand, deals with the structure of well-formed sentences. A sentence that is syntactically correct obeys the grammatical rules of a language. When you performed sentence diagramming in school, you were analyzing the syntax of a sentence, to prove or disprove its correctness, and perhaps improve it. Natural (human) languages have very complicated rules. Some of those rules are ambiguous, and some are well broken for artistic effect – the literary equivalent of Tom Waits’ singing that sounds like “it was soaked in a vat of bourbon, left hanging in the smokehouse for a few months, and then taken outside and run over with a car”1.

To understand the semantic/syntactic difference better, here is a famous example of a sentence that is syntactically correct, but semantically problematic2:

Colorless green ideas sleep furiously.3

To see that this is syntactically correct we can diagram it:

Diagram of an apparently meaningless (but syntactically correct sentence.

Diagram of semantically bankrupt but syntactically correct sentence.


Here, on the other hand, is an example of the converse, poor grammar but fairly clear meaning:

“You don’t have no more troubles, Roscoe,” I tell him, “you and me is just become partners.” 4

If we are talking about messages, it’s the semantics that really counts. If the medical instructions “Ambulate between the bars” are misinterpreted as “Amputate between the ears”, the consequences could be grave5.

Sometimes, of course, syntactic errors result in different semantics. The following examples of the value of punctuation show how different syntax can result in different semantics, even though all the words are still in the same the same sequence.

A woman without her man is nothing.
A woman: without her, man is nothing.

Twelve people knew the secret, all told.
Twelve people knew the secret; all told.

Let’s eat Grandma.
Let’s eat, Grandma.

I’ve often heard people say “that’s only semantics”, as if meaning is unimportant. What they really intend to convey is that quibbling over different shades of meaning of individual words can sometimes be a pointless hair-splitting waste that contributes little to the overall meaning they wished to convey.

On the other hand, mistaken semantics of a single word can cost lives. This example (taken from an unclassified document provided by the NSA6, 7) implies that at least 129,000 people died as a result of the meaning assigned to a single word8.

Reporters in Tokyo questioned Japanese Premier Kantaro Suzuki about his government’s reaction to the Potsdam Declaration. Since no formal decision had been reached at the time, Suzuki, falling back on the politician’s old standby answer to reporters, replied that he was withholding comment. He used the Japanese word mohusatsu, derived from the word for “silence.” As can be seen from the dictionary entry quoted at the beginning of this essay, however, the word has other meanings quite different from that intended by Suzuki. Alas, international news agencies saw fit to tell the world that in the eyes of the Japanese government the ultimatum was “not worthy of comment.” U. S. officials, angered by the tone of Suzuki’s statement and obviously seeing it as another typical example of the fanatical Banzai and Kamikaze spirit, decided on stern measures. Within ten days the decision was made to drop the atomic bomb, the bomb was dropped, and Hiroshima was leveled.

What does all this have to do with software?

Messages play an important role in an increasingly interconnected world. My scale reports my body mass index to my phone, and my wristband tells my phone how far I’ve walked, how long I slept, and what my pulse rate was throughout the day. It’s not much of an extrapolation to imagine that information (and more, such as blood sugar levels, cortisol, or blood pressure) automatically going to my doctor, to a pharmacy to adjust the dose of a prescription, or to the insurance company to adjust my rate. None of these messages existed a few years ago: someone needs to define how to build and interpret these messages, and who should be allowed to read which information.

It’s scary that without exception, every message definition effort I’ve seen has been obsessed with syntax. They expect the semantics will fall into place automatically. An example was a lovingly hand crafted (yet obscenely bloated) XML schema that actually failed to describe the information to be conveyed.

Consider the alternative: describe the semantics in an information model (UML, OWL, etc) of the problem domain and then programmatically turn it into XML, JSON, Protocol Buffer, and Avro schemas. You end up with different syntaxes that can all convey the exact same semantics. Presuming the information model is an accurate representation of the information in the problem domain, all of these schemas would be correct by construction, they would all convey the same information, and (with one-time preparation of marshalling/unmarshalling code) you could use any of those syntaxes interchangeably.

My point is that squabbles over syntax are counterproductive, if you define how to generate it from semantic models. At Prometheus we extensively generate syntax and executable code from semantic models – even exceedingly complicated models. Most people just can’t see that value, and for many developers, today’s reality involves huge wastes of time, bickering over different syntaxes to express poorly articulated, redundant, and noisy semantics.


  1. Graff, Gary; Durchholz, Daniel. Musichound Rock: The Essential Album Guide. Omnibus Press. ISBN 0-8256-7256-2.

  2. It’s not too hard to think of similar grammatically correct yet incomprehensible examples, such as “The loquacious boulder floated heavily on the breeze.”

  3. Noam Chomsky, Syntactic Structures (1957)

  4. From the story “Hog-Belly Honey” in the anthology Nine Hundred Grandmothers by R. A. Lafferty (1970)

  5. Or maybe not. We all know a few people such a procedure might improve.

  6. https://www.nsa.gov/public_info/_files/tech_journals/mokusatsu.pdf

  7. https://web.archive.org/web/20160311015309/https://www.nsa.gov/public_info/_files/tech_journals/mokusatsu.pdf

  8. The real situation may have been more complicated. The Potsdam Declaration was July 26. The newspaper articles were July 28. Little Boy was dropped on Hiroshima August 6, and Fat Man was dropped on Nagasaki August 9. If Suzuki really meant “no comment”, it seems he could have delivered an actual answer before one city or the other was bombed. On the other hand, even after the further demonstration on August 9, Japan didn’t surrender until August 14. Seven more bombs were in the pipeline, and the third could have been delivered as early as the day of surrender. It also seems possible that these bombings actually saved lives in the long run, compared to continued conventional war: the atomic bomb casualties were dwarfed by total Japanese casualties exceeding 2,600,000.

Reader Comments
  1. ErzestliZ said... around 7 months ago
    viagra for women dosage social groups http://viagrawithoutdoctorpres.net - viagra without prescription buy viagra online you cannot delete your posts in this forum <a href="http://viagrawithoutdoctorpres.net">viagra without a doctor prescription <
  2. ZichardDiurb said... around 7 months ago
    related:www.xlpharmacy.com/ cialis http://viagrawithoutdoctorpres.com - viagra without a doctor prescription delta cialis <a href="http://viagrawithoutdoctorpres.com">viagra without a doctor prescription</a> - cheap cialis no prescription cialis fo
  3. Thozasswomb said... around 7 months ago
    viagra and bath tub http://viagrawithoutdoctorprescr.com - viagra without a doctor prescription viagra 20 mg coupon sort by <a href="http://viagrawithoutdoctorprescr.com">viagra without a doctor prescription</a> - viagra soft drug interactions viag
  4. Wizliamadder said... around 7 months ago
    cialis reviews 20 mg replies http://cialis-walmart.shop - cialis over counter cialis soft tablets uk <a href="http://cialis-walmart.shop">cialis over the counter at walmart </a> - cialis online fast delivery cialis with alcohol
  5. PierzeWhire said... around 6 months ago
    viagra buy return to board index http://viagrawithoutdoctorpharm.com - viagra no prescription will viagra allow me to get laid with 3 different girls? <a href="http://viagrawithoutdoctorpharm.com">viagra without doctor prescription </a> - does via
  6. JalonNer said... around 5 months ago
    levitra 20mg pills display topics from previous http://levitragtr.com - levitra 20 mg price levitra from canada online password <a href="http://levitragtr.com">levitra 20 mg reviews </a> - levitra 20mg dosage who is online levitra levitra canadi
  7. FamesTwelf said... around 5 months ago
    levitra online pharmacy india canada http://levitragls.com - levitra 20 mg order levitra online <a href="http://levitragls.com">levitra 20 mg </a> - levitra erection pictures levitra pack discount
  8. ddolboy5 said... around about 1 month ago
    https://custory.com/theking/ - 더킹카지노 https://custory.com/woori/ - 우리카지노
  9. daesungjeon5 said... around about 1 month ago
    https://custory.com/theking/ - 더킹카지노 https://custory.com/woori/ - 우리카지노
  10. midasjern2 said... around about 1 month ago
    https://custory.com/theking/ - 더킹카지노 https://custory.com/woori/ - 우리카지노
  11. jgh72922r said... around about 1 month ago
    https://custory.com/theking/ - 더킹카지노 https://custory.com/woori/ - 우리카지노
  12. kissingmyass2 said... around about 1 month ago
    https://custory.com/theking/ - 더킹카지노 https://custory.com/woori/ - 우리카지노
  13. sungaezzang5 said... around about 1 month ago
    https://custory.com/theking/ - 더킹카지노 https://custory.com/woori/ - 우리카지노
  14. christy4227 said... around about 1 month ago
    https://custory.com/theking/ - 더킹카지노 https://custory.com/woori/ - 우리카지노
  15. sprigun02f said... around about 1 month ago
    https://custory.com/super/ - 슈퍼카지노 https://custory.com/first/ - 퍼스트카지노 https://custory.com/yes/ - 예스카지노 https://custory.com/yescasino/ - YES카지노 https://custory.com/obama/ - 오바마카지노
  16. gina2009w said... around about 1 month ago
    https://custory.com/super/ - 슈퍼카지노 https://custory.com/first/ - 퍼스트카지노 https://custory.com/yes/ - 예스카지노 https://custory.com/yescasino/ - YES카지노 https://custory.com/obama/ - 오바마카지노
  17. jungs1234d said... around about 1 month ago
    https://custory.com/33casino/ - 33카지노 https://custory.com/gatsby/ - 개츠비카지노 https://custory.com/bacara/ - 바카라사이트 https://custory.com/cass/ - 카지노사이트 https://custory.com/trump/ - 트럼프카지노 https://custory.com/mcasino/ - M카지노 https://custory.com/ - 월드카지노
  18. hsb6270c said... around about 1 month ago
    https://como79.com/ - 우리카지노 https://como79.com/theking/ - 더킹카지노
  19. helikesblue4 said... around about 1 month ago
    https://como79.com/ - 우리카지노 https://como79.com/theking/ - 더킹카지노
  20. jenny077g said... around about 1 month ago
    https://como79.com/ - 우리카지노 https://como79.com/theking/ - 더킹카지노
  21. yshe1030d said... around about 1 month ago
    https://como79.com/ - 우리카지노 https://como79.com/theking/ - 더킹카지노
  22. angel2sy5 said... around about 1 month ago
    https://como79.com/ - 우리카지노 https://como79.com/theking/ - 더킹카지노
  23. 00leesy6 said... around about 1 month ago
    https://como79.com/ - 우리카지노 https://como79.com/theking/ - 더킹카지노
  24. minjae3676a said... around about 1 month ago
    https://como79.com/ - 우리카지노 https://como79.com/theking/ - 더킹카지노
  25. zero2615t said... around about 1 month ago
    https://como79.com/super/ - 슈퍼카지노 https://como79.com/yescasino/ - 예스카지노 https://como79.com/yes/ - YES카지노 https://como79.com/obama/ - 오바마카지노
  26. pp40612g said... around about 1 month ago
    https://como79.com/super/ - 슈퍼카지노 https://como79.com/yescasino/ - 예스카지노 https://como79.com/yes/ - YES카지노 https://como79.com/obama/ - 오바마카지노
  27. baechookimchi said... around about 1 month ago
    https://como79.com/first/ - 퍼스트카지노 https://como79.com/mcasino/ - M카지노 https://como79.com/trump/ - 트럼프카지노 https://como79.com/gatsby/ - 개츠비카지노
  28. susha00f said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  29. rkdlem1504 said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  30. rkdlem1504 said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  31. kjh844234v said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  32. hhm0327g said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  33. tngus9111d said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  34. knifzzang said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  35. cuy33798b said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  36. kohkoh66v said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  37. qkrtnqls0401r said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  38. diekk5f said... around about 1 month ago
    https://stylebet77.com/ - 우리카지노 https://stylebet77.com/theking/ - 더킹카지노 https://stylebet77.com/yes/ - 예스카지노 https://stylebet77.com/first/ - 퍼스트카지노 https://stylebet77.com/obama/ - 오바마카지노 https://stylebet77.com/yescasino/ - YES카지노 https://stylebet77.com/can
  39. khm79forever6 said... around about 1 month ago
    https://dancesweb.com/theking/ - 더킹카지노 https://dancesweb.com/woori/ - 우리카지노
  40. 48604040s said... around about 1 month ago
    https://dancesweb.com/theking/ - 더킹카지노 https://dancesweb.com/woori/ - 우리카지노
  41. happygirl07w said... around about 1 month ago
    https://dancesweb.com/theking/ - 더킹카지노 https://dancesweb.com/woori/ - 우리카지노
  42. sksk23700f said... around about 1 month ago
    https://dancesweb.com/theking/ - 더킹카지노 https://dancesweb.com/woori/ - 우리카지노
  43. yun9565e said... around about 1 month ago
    https://dancesweb.com/theking/ - 더킹카지노 https://dancesweb.com/woori/ - 우리카지노
  44. sksky22e said... around about 1 month ago
    https://dancesweb.com/theking/ - 더킹카지노 https://dancesweb.com/woori/ - 우리카지노
  45. leeyh1012s said... around about 1 month ago
    https://dancesweb.com/theking/ - 더킹카지노 https://dancesweb.com/woori/ - 우리카지노
  46. dadarak4d said... around about 1 month ago
    https://dancesweb.com/ - 슈퍼카지노 https://dancesweb.com/first/ - 퍼스트카지노 https://dancesweb.com/yesca/ - 예스카지노 https://dancesweb.com/yesno/ - YES카지노 https://dancesweb.com/obama/ - 오바마카지노
  47. sisbaby58w said... around about 1 month ago
    https://dancesweb.com/ - 슈퍼카지노 https://dancesweb.com/first/ - 퍼스트카지노 https://dancesweb.com/yesca/ - 예스카지노 https://dancesweb.com/yesno/ - YES카지노 https://dancesweb.com/obama/ - 오바마카지노
  48. leewook7126 said... around about 1 month ago
    https://dancesweb.com/trump/ - 트럼프카지노 https://dancesweb.com/33casino/ - 33카지노 https://dancesweb.com/gatsby/ - 개츠비카지노 https://dancesweb.com/bacara/ - 바카라사이트 https://dancesweb.com/casino/ - 카지노사이트
  49. dldbfl1111r said... around about 1 month ago
    https://pauio.com/theking/ - 더킹카지노 https://pauio.com/woori/ - 우리카지노
  50. sksdmswnek1a said... around about 1 month ago
    https://pauio.com/theking/ - 더킹카지노 https://pauio.com/woori/ - 우리카지노
  51. happy73232s said... around about 1 month ago
    https://pauio.com/theking/ - 더킹카지노 https://pauio.com/woori/ - 우리카지노
  52. sujinsofa said... around about 1 month ago
    https://pauio.com/theking/ - 더킹카지노 https://pauio.com/woori/ - 우리카지노
  53. innocentsora3 said... around about 1 month ago
    https://pauio.com/theking/ - 더킹카지노 https://pauio.com/woori/ - 우리카지노
  54. koryo2k2k2 said... around about 1 month ago
    https://pauio.com/theking/ - 더킹카지노 https://pauio.com/woori/ - 우리카지노
  55. sonwjdghk6 said... around about 1 month ago
    https://pauio.com/theking/ - 더킹카지노 https://pauio.com/woori/ - 우리카지노
  56. omylove32r said... around about 1 month ago
    https://pauio.com/super/ - 슈퍼카지노 https://pauio.com/first/ - 퍼스트카지노 https://pauio.com/yesci/ - 예스카지노 https://pauio.com/yeska/ - YES카지노 https://pauio.com/obamas/ - 오바마카지노
  57. leeyoungsuk7 said... around about 1 month ago
    https://pauio.com/super/ - 슈퍼카지노 https://pauio.com/first/ - 퍼스트카지노 https://pauio.com/yesci/ - 예스카지노 https://pauio.com/yeska/ - YES카지노 https://pauio.com/obamas/ - 오바마카지노
  58. jumgili3r said... around about 1 month ago
    https://pauio.com/33ca/ - 33카지노 https://pauio.com/basa/ - 바카라사이트 https://pauio.com/casa/ - 카지노사이트 https://pauio.com/kor/ - 코리아카지노 https://pauio.com/live/ - 라이브카지노 https://pauio.com/world/ - 월드카지노 https://pauio.com/mka/ - M카지노 https://pauio.com/ssca/ - 삼삼카
  59. hllkic said... around about 1 month ago
    <a href=http://canadian-pharmacie.com>buy viagra overnight</a> buying viagra cialis online http://canadian-pharmacie.com
  60. mseehx said... around about 1 month ago
    <a href=http://levitranew.com>levitra vs viagra</a> costo levitra 10 mg orodispersibile http://levitranew.com
  61. Taniya said... around about 1 month ago
    Here, we are going to discuss actions to fix the mistake QuickBooks standard bank dealings http://www.accountingpre.com/phone-number/quickbooks/ http://www.wwcustomersupport.com/phone-number/quickbooks/ https://www.quickbookssupportphone-number.com/
  62. Taniya said... around about 1 month ago
    The customer should make central issue before creating up the item. They have to take away the old type of this course that set up on your entire human body. http://www.accountingpre.com/phone-number/quicken/ http://www.wwcustomersupport.com/phone-numb
  63. Taniya said... around about 1 month ago
    Unlike the official Sage assistance professionals, customer support group is also available 24 / 7 http://www.accountingpre.com/phone-number/sage/ http://www.wwcustomersupport.com/phone-number/sage/
  64. Taniya said... around about 1 month ago
    Hit on subsection 8 labeled “Outlook Application” and then media “Execute” key at the right- side part of the show to get rid http://www.wwcustomersupport.com/phone-number/outlook/ http://www.wwcustomersupport.com/phone-number/aol/
  65. Taniya said... around about 1 month ago
    Microsof organization company windows or Android operating system OS. They use the most beautiful technology http://www.wwcustomersupport.com/phone-number/antivirus/ http://www.wwcustomersupport.com/phone-number/printer/
  66. Rkman said... around about 1 month ago
    <a href="https://www.onlinegedichten.nl/">Check Link</a> [URL=http://www.onlinegedichten.nl/]Check Link[/URL] [url=http://www.onlinegedichten.nl/]Check Link[/url] [URL="http://www.onlinegedichten.nl/"]Check Link[/URL] [url="http://www.onlinegedichten.nl/"
Leave a Comment

Back