19 karma · joined Nov 12, 2023 (3y ago) · 9 submissions
comment 1y ago · link · parent
For CPU-bound tasks and number crunching you can always just write it in Rust (or C or Zig) and NIF out to it from Elixir.
As a dev who builds apps that are served over the internet, it covers everything I need. Maybe that's a specialty niche.
comment 1y ago · link · parent
Which is all to say if there's been something I couldn't figure out in Ash I've tended to put it into a regular Elixir module rather than anything Phoenix-specific.
The only exception I can think of is that AshAuthentication doesn't provide support for API keys out of the box, so I have ended up writing my own little plugs for that.
If you are just getting started I'd strongly recommend working through tutorials and/or the Ash book (it's in beta but pretty solid) rather than just diving into a project. It's a lot when you're first wrapping your head around it.
comment 1y ago · link · parent
I've been using Ash for about a year now and it's really hit the spot. Wishing you well on your journey!
comment 1y ago · link · parent
If you look under the hood of Ash's macros, they're all just shorthand for creating a particular struct with sensible defaults. It's not actually doing a ton of magic. You can replace them entirely with direct function calls, or probably even manually declare the structs yourself.
If there's magic, it tends to be more in the execution step - like how `Ash.read()` can push authorization logic into the query/db layer. But that's exactly the kind of logic I don't want to have to write myself over and over again.
I have never compared Phoenix's generated auth stuff to Ash's so I can't speak to that. However I can say Ash's generators all use `igniter`, which is part of the Ash project. It allows for package developers to reach into Elixir's AST to make smarter installers/updaters, and is being adopted more broadly throughout the Elixir ecosystem. So in terms of code generation Ash's approach is gaining a lot of traction.
Speaking for myself here, I've really liked working with Ash. The value becomes more apparent the more I use it.
comment 1y ago · link · parent
Also, the book is out now.
comment 1y ago · link · parent
This app has a lot of complex headless browser flows that rely a lot on Ash.StateMachine, and Ash has only gotten better the deeper I've gotten into it. The app gets more simple and stable the more I integrate with Ash.
The declarative "data-oriented programming" paradigm took some getting used to (I come from PHP) but it makes so much sense and makes it easy to plug Ash resources into any other use case. Deriving a JSON api is an easy example.
In another app I'm using Ash.Reactor to model agentic AI workflows (it's just RAG but with extra steps). Reactor was originally intended as a saga orchestrator that models workflows as a DAG. DAG is the perfect abstraction for this use case and it works ridiculously well.