Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am a total noob, ok programmer but not a very good developer.

I'm coming to Phoenix with a Django background and I really enjoy what I've been messing around with so far, but I haven't done anything serious with it.

When I hear people say "ash is like an orm" then that fills me with dread. I actually come to enjoy how elixir/Phoenix/ecto has done things

If I'm trying to build something ie a news aggregator site (like hackernews ) - how would "make it in ash" help me? If it does things for me, does that mean I lose control of those things? Or they are hidden behind some macro magic that I have to pull apart to get to?



"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.


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


Just wanna chime in and say expr is the bomb


Ash will be your Django models. Once you have models (ash resources) built; you can use the Ash ecosystem to get things like a graphql or JSON endpoint (or both!) for those resources with just a few lines of code.


Right and unlike an ORM which only models the "nouns" and "relationships" of your business domain model, Ash also models the verbs.

This allows it to reveal the actions of your system externally via GraphQL or JSON API as well as modelling the data for your relational schema (although data layers are swappable and are not always relational).


I guess describing ash as "the middle layers" is what helps bring the picture together for me.

The data/orm, I usually think of as a lower layer. Then you build domain on top and then interfaces on top of that.

I can see Ash be the middle layer, where you define the domain, (using nouns and verbs) and it pieces together the data and the interfaces.


FWIW I regret introducing that term into this conversation. I've used it in some cases to try to bring people close to an understanding when we have like...no middle ground. But its nothing close to an ORM.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: