3 ms·
languages.. are everywhere. You keep making them even if you do not notice. Say, a function with 3 arguments is a small language.. just missing all the fuss, ch
by svilen_dobrev 8y ago
languages.. are everywhere. You keep making them even if you do not notice. Say, a function with 3 arguments is a small language.. just missing all the fuss, checks and generality. A repeating data structure that feeds some switch-decision tree is another language.. implicit one, essentialy the code is an interpreter.
But it's much better to make languages explicit. And there's no need to invent new grammars and parsers.. keep those for real extreme cases.
i express my languages in python, its easiest to use as base and build semantics on top (and even syntax).
One can just use function/class-based declarations, of domain-specific notions, and then interpret them any way one wants.
Or one can even turn function-calls into "statements", and "with"-construct into "blocks-of-statements", etc.
Gives you strict debuggable proto-syntax, on which to build your own "syntax"/semantics/error-checking/reporting.
but any way, try to see/feel the Language behind the syntax/implementation.
have fun