6 ms·
Having worked with domain experts I concur on the difficult time they have expressing the rules of their domains. Once I built a little domain-specific languag
by derfurth 4mo ago
Having worked with domain experts I concur on the difficult time they have expressing the rules of their domains.
Once I built a little domain-specific language for them, that was tested against old jobs to see if they contradicted the past; it was a nifty project and since then I am convinced that DSLs are underrated as a way to encode expertise.
- Dansvidania 4mo agoCan you give an example (even if contrived) of how that would have looked ? I’m very curious !
- derfurth 4mo agoI had the experts write markdown files that contained the rules looked somewhat like: ## 1A Rule name Some prose explaining the rules liking to official documentation. ``` if municipality and inhabitants > 10000 then functionA else functionB ``` Then a trivial parser would extract the rules, the DSL was then handled by Lark[1]. So pretty simple, but it made collaborating with experts easier as simulated results would also output some markdown they could read. 1. https://lark-parser.readthedocs.io/en/stable/ https://lark-parser.readthedocs.io/en/stable/
- tardedmeme 4mo agoSounds like "Literate Programming", where the code and comments are reversed: instead of everything being code except what's marked as a comment, everything is a comment except what's marked as code.
- BarkenBark 4mo agoI am also very interested!
- renegade-otter 4mo agoScala to the rescue, then! :)