Syntax (Syntactic) vs. String Semantics
The Most Used Word Nobody Clearly Defines: Semantics
Syntaxβalso called the syntactic levelβdescribes how text is written in source code and how the compiler parses it. Unicode escape sequences (β\u{00E9}β), string literals (βhelloβ), and string interpolation (β\(value)β) all belong to this layer. They are construction mechanisms: precise instructions telling the compiler to consult the Unicode table, translate code points into Unicode scalars, and assemble them into a string. This level is designed for correctness and determinism, not human intuition.
String semantics is a higher-level concept. Although the word semantics looks plural, it refers to a single domain: meaning. At the semantic level, a string represents human-perceived text rather than its construction details. Different syntactic forms can therefore map to the same semantic value. For example, β\u{00E9}β (precomposed Γ©) and β\u{0065}\u{0301}β (an e plus a combining acute accent) are syntactically different, yet semantically equivalent. Humans read the same character; the string systemβs job is to bridge low-level Unicode mechanics with high-level meaning.


