On February 24 and 25, we are giving you a chance to ask questions of PragProg authors Zach Daniel and Rebecca Le as part of our Winter Literary Festival in partnership with codebar.
Rebecca Le is a member of the Ash Framework core team. She is a coauthor of Rails 4 in Action and has many years of experience in building web applications.
Zach Daniel is an experienced software engineer and the creator of Ash Framework. He has a passion for declarative design, functional programming, and contributing to the open source community.
Zach Daniel and Rebecca Le are the authors of Ash Framework. Ask them about programming, Ash, Elixir, or anything else—really!
Everyone commenting or asking a question will automatically be entered into a drawing to win one of the authors’ books.
In addition, from February 24 to March 2, as part of our Winter Literary Festival with codebar, you can use promo code 2025WinterFest to save 40 percent on purchases at pragprog.com. We’ll donate 20 percent of the net income from the promotion back to codebar after the event.
Offer not valid where prohibited or restricted. Offer not valid on previous purchases. The Pragmatic Programmer: 20th Anniversary Edition is not eligible for discounts, as we do not publish it.
Hit Reply to post your question below. The authors will check in periodically to answer your questions.
We thought about putting some in, and I even had some planned for the first two chapters, but they didn’t really fit with the flow of the book, where each chapter builds on the code from the previous chapter.
Do we write code/show snippets for future chapters assuming that readers have completed the exercises in previous chapters? All of them? Some of them? None of them? We couldn’t find a way to make it work nicely, so in the end decided to skip them.
And ultimately, there are a lot of things we would have liked to include, but we simply couldn’t include everything - otherwise we’d never be finished! A lot of ideas had to be cut, that may be written up as extra blog posts or guides later. Stay tuned!
In the past when creating a database management app,
I used a lookup-form with search possibilities to assign the parent to the child I want to create.
Do you have an idea how to do that?
That is not an Ash-Question, but a LiveView-Question. So feel free not to answer it.
Sure, I’ve written autocomplete-type form inputs like that. Going into all of the detail is probably a bit too much a forum post, but check out hex packages like live_select to see how it can be implemented! We’ve used it in a lot of our projects, it works really well.
I read R4IA! Ryan added a version so I could read it on my Kindle, bless him!
What do you think the main differences are between Rails and Ash - if someone was a Rails user how would you sell the idea of Ash to them?
In terms of frameworks which do you think Ash is most similar to and which, if any did you take inspiration from? What would you say is Ash’s main selling point?
I’ve just started exploring Ash. I love the idea and bought the book immediately. I finished the first chapter this morning. I’ve also peeked at the documentation and loaded the Livebook. You’ve put a lot of effort into helping people get to know the framework, and I appreciate it.
I did find myself looking for a cheatsheet or other high-level map of the territory and didn’t notice one. Is that something you might provide? Something like a one-page overview of the pieces, how they fit together, and how they integrate with other frameworks like Phoenix. That might help learners orient themselves as they explore.
This is a question I get often and actually don’t have the best answer to. It is similar in many ways to things like Django (define models, get stuff like admin for free) and ActiveRecord from Rails (easy to do your data operations through a resource).
In the early days of Ash, I spent almost 2 years working on a no-code platform. Ultimately that venture did not work out, and I learned that, IMO, "no code is not the answer. However, I’ve synthesized a lot of what I learned in that process into Ash. In that way, Ash bears some resemblance to no-code platforms. You could think of it as the highest-code low-code framework that exists.
We have some links on our website of folks who are using Ash in production, and some case studies on Alembic’s site. Companies often prefer not to tell the world about their competitive advantages, and we are of course under strict NDAs with our clientele at Alembic.
There are many many more than that. And if you know of any that I don’t know about, let them know that using Ash in production or sponsoring is the only thing they have to do to get their logo up on the site
Rails is a lot more full-stack than Ash, and includes all of the bells and whistles (perhaps too many!) of a web framework.
Ash would be the replacement for the ActiveRecord/ActiveModel part of the Rails stack, but a lot more feature-rich. I haven’t used Rails in a few years now, so some of my memory might be a bit fuzzy on it, but even the thought of having named actions
If I wanted to sell Rails devs on Ash, I’d probably have to first sell them on Elixir and then Phoenix
I just got into Ash recently and coming from a rails/ruby background I’m curious as to why there are generators in both Ash but no destroyers i.e. I can generate a resource, but deleting it is a hectic manual process.
Phoenix has the same approach and I’m stumped as to the origins of that approach and decision.
What would it take to create destroyers for Ash, and why would you be for or against them?
Hey that’s a good question! Personally, I’m not a massive fan of generators like scaffolding in Rails, or ash_phoenix.gen.live in Ash, and I don’t use them. I know they’re super popular though!
There’s one place that I think destroyers would be really useful, and that’s when deleting a migration. Codegen a migration, realize oops you forgot to add an index or a column, want to delete it and regenerate it - you have to go and find the migration and the snapshots and manually delete them. Very annoying. I thought we had an open issue for AshPostgres to implement that, but I can’t find it - so I’m going to open one
Ultimately removing a resource is 100x more complex than adding one. For example, removing places where it is called can be effectively impossible. We could add something like mix ash.remove.resource Resource.Name, but it would likely only be able to automate a small portion of the process of removal. For instance, other resources having relationships to the resource, manual calls to the resource throughout your codebase etc.