Comment by whazor
1 month ago
With a Domain Specific Language (DSL), you parse code and build an abstract syntax tree. But you can also build a Python library where you construct the same tree. With the benefit that LLMs are already better trained on Python code. If you need a deterministic programming language, you could use starlark.
DSL is a term with such fuzzy meaning, I don't like it at all. It's always valid to just say "language". Languages and libraries don't even have to be opposing concepts either. Let's say you write the first ever JSON parsing library. Did you just create a library? Or a language?
A language is normally defined by a grammar and can be parsed. The definition can be very formal.
Alternatively a library is a construct in a pre-existing programming language. For example in Python you pip install a package, import some classes and functions.
But where these concepts can overlap is that you could define your domain logic as a language, or by calling functions in a library. In the past, I was a big believer in domain specific languages. However, AI will outperform when generating Python code with using a new library.
I have started gathering DSL specific content over on https://reddit.com/r/domainspecificlangs … there are several definitions over there. Personally I would distinguish between a drop down DSL and a full blown independent language.
Doesn't seem fuzzy to me. JSON parser is a lib.