3 ms·
Here's something I don't understand: How are "little languages" different from a bunch of functionality wrapped into a library/module? Is it just that (with som
by ssivark 4y ago
Here's something I don't understand: How are "little languages" different from a bunch of functionality wrapped into a library/module? Is it just that (with some convenient syntax sprinkled on top), or is there more to it?
I would imagine that most of the value comes from being able to "refactor" thought patterns to match the best way to cleave the domain into composable concepts -- and it seems like we do this all the time (and in all programming languages?).
- honungsburk 4y agoI agree, they are the same! regex is an example of an eDSL that most general-purpose languages support. The king of eDSL:s is of course Haskell. I recommend looking up parser combinators for anyone who has ever struggled with an understanding way to complex regex expressions.
- bazoom42 4y agoAn “internal DSL” is a library with a a design which makes it “feel” like a language. JQuery is the classic example. An “external DSL” has its own syntax, like regexes.
- francasso 4y agoWith a DSL you need to learn syntax, semantics and either the API for interacting with your GP language or the tooling for external DSLs. With a library you just need to learn the new semantics. I much prefer this to a DSL. Plus a library has all the debug tools the language has. DSLs usually don't have any debug tools except for printing when you are lucky
- hackandthink 4y ago"How are "little languages" different from a bunch of functionality wrapped into a library/module?" This is called a shallow embedding in the Haskell world. Deep Embedding is more like writing a full blown interpreter. Then there is tagless final (Oleg Kiselyov) - it feels shallow but is more flexible as simple library functions and it is optimisable like deep embedded DSLs. http://www.cse.chalmers.se/~josefs/publications/TFP12.pdf http://www.cse.chalmers.se/~josefs/publications/TFP12.pdf https://wiki.haskell.org/Embedded_domain_specific_language https://wiki.haskell.org/Embedded_domain_specific_language