TwistingTwists

TwistingTwists

Best resource to learn DSL?

I want to learn DSL. Don’t know how to write one. What;s the best introductory resource?

I see some macro being used here.

Is DSL only about using Macros to help write other functions easily?

Most Liked

kartheek

kartheek

DSL are used in runtime and compile time. At runtime they help customising the software through scripts or rules. Systems expose ability to customise the functionality/behaviour through the DSLs. For example rules editor in a firebase - Security Rules language  |  Firebase Security Rules . Quite a lot of google cloud services use Common Expression Language - GitHub - cel-expr/cel-spec: Common Expression Language -- specification and binary representation · GitHub 

The complete guide to (external) Domain Specific Languages - Strumenta covers a lot of things about DSLs.

Elixir has metaprogramming through macros which is compile time.Ecto has DSL for simplifying queries for accessing the data. If your use case is writing a compile time DSL - elixir metaprogramming makes it easy. Runtime DSL in elixir needs a lot of things - like interpreter, etc to be implemented.

Implementing a DSL needs grammar to be formalised as language spec.

What are you trying to achieve with DSL in your application? Is it runtime or compile time ?

dimitarvp

dimitarvp

More or less, yep. You can’t really learn DSL per se, DSLs are custom languages that you build yourself. For that you need to know Elixir macros.

I recently started the Metaprogramming Elixir book and I enjoy what I saw and tried so far, so that’s one possible resource for you.

csadewa

csadewa

DSL is a concept closely associated with Domain Driven Design, the idea is to have a way to easily express things inside a particular domain. For the technical part, you could learn (like dimitarvp said) Metaprogramming Elixir / Elixir Macro. For the design part, you could learn Domain Driven Design (i would recommend Implementing Domain Driven Design for more easier time of reading DDD).

Where Next?

Popular in Chat/Questions Top

maz
I’m getting this error: ## ** (Ecto.Query.CompileError) Tuples can only be used in comparisons with literal tuples of the same s...
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
332 30824 154
New
lgmfred
Hello, I want to get started with elixir today. Having learnt the basics of Erlang (my first ever language) and seen what it’s can do, I’...
New
dopomecana
The title of this topic may sound silly at the first glance. But why I trying to ask you guys is how to go to the next level? I am curre...
New
KSingh1980
How to run the random query and get the result in JSON format and send it as a response. The query will be in the following form DB Name...
New
marciol
Hey, I have very restricted resources and time so I’m trying to understand the best way to learn Liveview in terms of cost/time. The Pra...
New
Nopp
Hey guys and girls, i am completely “new” to programming, recently played a bit with Python, Ruby and PureBasic, but i want to try somet...
New
koen_vb
Hi, I was looking for a pointer of how I could most easily start with phoenix regarding deploying it to something like linode or google c...
New
svetarosemond
I’m planning on purchasing Elixir in action second edition, and I was wondering if anyone could tell me based off the first edition, does...
New
armanm
I know zero downtime deployment can mean different things depending on your application and what your users can tolerate so expectations ...
New

Other popular topics Top

Nvim
Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help. Where are they similar? Where do they differ the m...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement