3 ms·
It is sort of incredible how often I've ended accidentally re-inventing interpreters or compilers without that being an explicit goal. You start by just adding
by tombert 3y ago
It is sort of incredible how often I've ended accidentally re-inventing interpreters or compilers without that being an explicit goal.
You start by just adding some kind of configuration for rules, maybe in JSON. Then you start wenting to make more complex rules so you allow some kids of recursive system in your JSON that can nest rules and combine them. Then you find yourself copypasting rules a lot and so you implement some kind of naming convention so you can reuse rules. Then you realize how disgusting your JSON is getting so you dust off a parsing library and make a basic DSL that compiles into that JSON, and then it dawns on you.
- chii 3y agoa formal language with a grammar and rules, is something quite fundamental. Today nobody is surprised that maths shows up in engineering, or [really anywhere](https://en.wikipedia.org/wiki/The_Unreasonable_Effectiveness_of_Mathematics_in_the_Natural_Sciences https://en.wikipedia.org/wiki/The_Unreasonable_Effectiveness...)! I would imagine that this is just an extension of the above idea about maths. To describe something in such a way that it operates formally, you eventually end up with stuff like LISP, or another equivalent language.