logoalt Hacker News

joshpriceyesterday at 11:59 AM2 repliesview on HN

"Magic" in software can be good or bad. I've tried to explain the apparent "dark magic" at the end of this article.

https://alembic.com.au/blog/essence-of-ash-framework

Would love any feedback as to whether this helps allay your fear and dread!

Spark is the DSL library that takes a DSL definition as Elixir structs and builds the DSL for you which in turn takes the written DSL and converts to a standard and simple data structure. So there are fewer macros than you might expect. Ash extensions just introspect that generated data structure with ordinary Elixir code.

The main macro in Ash core itself is the `expr` macro which enables portable declarative predicates which can be used in data layers like AshPostgres for filtering in SQL queries. If your data layer is simple like ETS or a CSV then it runs as Elixir code.


Replies

drekipustoday at 1:09 PM

This has been good to read and the pictures were very helpful, thanks.

hibbitybibbityyesterday at 4:15 PM

Just wanna chime in and say expr is the bomb