Post #1541257
2025-11-15 11:14 UTC
DSLs are good for programming because they help you to eliminate ambiguities in two ways:
1) they use a restricted grammar that simply eliminates many possible ambiguities entirely. The higher level the language is, the fewer ambiguities it allows for (at a cost of flexibility)
2) they come with a parser or interpreter that identifies any remaining ambiguities and turns them into errors that are reported back to you to be fixed
Replies (1)
-
@nicklockwood@mastodon.social 2025-11-15 11:14
In programming we tend to think of high-level languages like Python or JavaScript as being "easier" than low-level languages like C, and that's true, but it's not because they are closer to English It's because they eliminate (or otherwise smooth over) more ambiguities at the syntax level, instead of allowing the programmer to write ambiguous or erroneous code but then have to deal with the resultant errors at runtime