Hey there, this is my first post on the forum! Been following elixir for the last probably 3 years, but never really ‘dove in’ other than exercism/reading/podcasts/following the community growth. And I have to say it seems like amazing growth, even from an outsider.
I am exploring using Elixir, and specifically Ash for some core stuff in a future whitelabeled production application. For me, something just never clicked with the way phoenix generates/handles the ‘core’ of your application.
I think the web side is amazing, but I’ve bounced off ‘how to model/structure x thing?’ many times.
I really resonate with the abstractions of Ash, they just kind of ‘click’ to me, even though there’s a lot of terminology.
ANYWAY
I am wondering: who (in your opinion) should be using Ash for future production work?
And more importantly: do you think it’s for newcomers to elixir (but with extensive programming experience in other languages and domain modelling)? Or those who have already cut their teeth on elixir and the broader ecosystem for a bit?
I started using Ash about 2.5 years ago without doing anything substantial in elixir before.
I mainly worked with Typescript before, with a bit of Java and Python mixed in.
When we evaluated Elixir, we also considered how we would create the Application layer. The Phoenix generators felt a bit too bare-bones, leaving many questions open.
There is also the phrase Phoenix is not your Application. Phoenix’s primary concern is not how you structure your application layer. Ash fits nicely into that slot.
After doing Ash for 2.5 years, I have a hard time seeing myself creating an elixir application without it. It solves so many problems you would otherwise have to solve yourself, one example being authorization. There are also common places to put your files and logic, which reduces bikeshedding on less impactful decisions and lets you concentrate on the things that add value for the end user.
Another important thing is that Ash doesn’t try to replace commonly used libraries like phoenix and ecto but rather builds on top of what is already there. In that way, I feel like even if I would need to build something without it, I still learned things about those technologies and not just specific Ash knowledge that might not be transferable to other projects.
I just wanted to add that the way Ash does this isn’t too different than how you might say Phoenix’s context are “supposed” (very heavy quotes) to be used, it just abstracts a lot away (with many additional benefits, of course). Ash resources bundled in an Ash domain exposed by an Ash code interface is very generally the idea behind the DDD concept of Bounded Contexts which is where Phoenix contexts get their name. If you aren’t already familiar, reading up on them can help a lot in vanilla Phoenix and Ash (especially if you get a job where you have to use vanilla Phoenix). A very short intro is available here.
I’m just finally getting into Ash myself and can already tell I will not be looking back—except for every day at work when I’m forced to So ya, I have nothing to add to what @barnabasJ has said other than to reinforce that the target audience of Ash is everyone
Obligatory disclaimer: I am NOT dissing phoenix in ANY way. I think both Elixir and Phoenix are the most sane, pragmatic, but also wonderful to work with languages/web frameworks I have ever encountered. So many powerful things exist – and I just really want to understand them at depth, just takes some time ^^.
And yeah I am very familiar with DDD and bounded contexts!
Where I bounced in phoenix contexts was like:
use context generator to generate some context
now what?
Especially when I don’t really need phoenix itself because I am doing domain modelling without UI, which is usually how I like to work for the ‘core’ stuff.
Whereas, with Ash my feeling after even walking through some tutorials is like: make a resource, define an action, go from there.
The problem with the generators is that they are designed for learning purposes and just give you basic CRUD actions which kind fly against DDD. But that’s a bit off topic of this thread (and there are a whole lot of other threads regarding Phoenix contexts around here).