Stepankha Yuliannia wrote:Hi Alex,
Embedded domain-specific languages are everywhere in functional programming, we can say FP and eDSLs/DSLs are natural partners. We use eDSL/DSL to reduce complexity of the system and to keep things decoupled from each other.
When we decide to be using eDSL/DSL so the client code will only work with the DSL (its dependency on native calls will be eliminated), we then have an option to use a native translator for the eDSLs/DSLs that converts high-level commands to native functions or we can test our scenario separately by inventing some testing interpreter. What is your personal preference and why?
Thanks
Hi Stepankha,
This is a great question! And actually, you've just repeated what I'm saying in my book. There is a chapter I finished recently - Chapter 5, Embedded Domain-Specific Languages. It has all the answers to your questions. Here, I'd confirm that eDSLs is a very natural and essential thing for FP, and I encourage to use them all the time. Not only for small things, but as an architectural solution: you can have eDSLs as interfaces to your subsystems, and then interpret them to make it work in the real environment. This is the main idea of my book and methodology I call Functional Declarative Design. I use it quite a lot in my work and in my hobby projects. I'm a very big fan of interpretable languages, to be added.