My thoughts on Ash

Random thought: when you set up AshAuthentication, was it before we added the igniter installers for it? The new installers generate the actions directly into your app which makes it much easier to understand what Ash is doing, and also to see what kinds of things you might want to test.

I’m an early adopter of Ash.

The primary customer facing parts of our application stacks are all on the Phoenix Framework. Before our adoption of the Phoenix Framework, we were on React. The switch made our productivity 3x. Our productivity were further increased by another factor of 2 with the adoption of Ash.

There were 2 things which made me push for the use of Ash in all our projects.

  1. the ethos of “model your domain…”
    While I’m an accomplished software engineer, my main way of thinking/solutioning is at the data engineering level, aka data domains. Ash made me feel home by allowing me to get back into my familiar mode of approaching solutions from the data engineering angle.
  2. Policies
    I have previously implemented data policies using Postgresql’s “CREATE POLICY”. Geesh, the nightmare of maintaining policies at the database layer. It’s my second hate after stored procedures.

Platforms like Supabase made policies easier. But not by much.

Ash’s implementation of Policies is gold!


I’ll also like a word about testing.

I don’t test against Ash framework. (Or any 3rd party frameworks)
I just assume they work.

Rather, I write tests to ensure that the data path (input and output) are what I expect them to be. That means again, I test the data engineering path.

(Of course, the rest of my tests are on UI / UX liveview testing)

16 Likes

What I did

I built a spaced repetition spelling app for my daughter in Ash. She is about to graduate from her dyslexia & dysgraphia course, due in part to optimizing her practice time.

Learning Curve

For all the boring bits, CRUD a user, Auth a user, CRUD flashcards that belong to the user, my blocker was the learning curve. But I chose to learn a new thing so that I can better build software in the future. I guess if you don’t like learning this is a bad thing… But then you are going to hate building software.

Using Elixir & Testing

For the spaced repetition bit, this was my secret sauce, the most complex part of my business logic. I chose one of the many options for supplying a custom Module to the Ash resource. And then I wrote a normal Elixir module with good old tests.

3 Likes

Thanks for sharing your experience here. Must have been hard to do.

I do think Ash, and things like it, are where we are all heading. Ash has good abstractions, and good trapdoors to let you access what is underneath. There are many reasons for this. One of the main ones is that coding agents are going to need better structure. Ash simply consolidates the important bits to make it easier for people to understand and build. The same is true of machines.

6 Likes

I have been a professional Elixir developer since 2022 and I have participated in diverse projects. In my opinion using Ash would have been a huge blessing if those projects use it, not only for defining the models but for calling external apis as well.

Is expected that not every project would match the way of Ash, specially those older ones with weird database structures due to business requirements. But if those project would be made today I would totally recommend Ash, at least as a wrapper for legacy APIs.

Production projects made by many people will surely be wild if there is little conventions in place. Ash can ease creating a standard and a common ground for projects that will be maintained for years and used in heavy load environments.

2 Likes

If you end up migrating off it, please share your experience with that, what was difficult, how much effort etc.

2 Likes

Thanks for sharing your thoughts on Ash Framework.

I had some of those ones as I have been trying to learn it in the last few months and I was looking forward for the book “I just bought it recently” plus the utilization of macros although at the end I need to admit it is similar to learning the syntax of anything.

More effort is required on the learning resources and how Ash internals work “Too late as Zach mentioned above to have it in this book”.

I believe the concept of Ash is where programming is heading now and it could be a strong baseline for more like AI code generators as it comes in line with its principle of " Model your domain, derive the rest" so it is not far from writing maybe AI prompt where you supply your data model in simple English instead of current DSL syntax and get the code ready .

2 Likes

I would like to point out that is VERY far from eachother.

The whole point of a dsl is that you can always reproduce and understand what goes on. There is no magic, there is only condensation and enforced patterns.

An LLM by its very nature has unstable output.

I am not sure if you are misunderstanding LLMs, Ash or both with that comment :sweat_smile:

Ash main feature is to simply remove a whole class of code you don’t have ownership of any more. An LLM will bring tons more of code under your ownership and it will all be slightly different.

3 Likes