AMA with: Zach Daniel and Rebecca Le (codebar Winter Lit Fest)

Ask Me Anything with
Zach Daniel and Rebecca Le
@zachdaniel and @sevenseacat

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.

4 Likes

Hey everyone! :wave: I’m excited to get this opportunity, and curious to see what kind of questions people want to ask!

3 Likes

Hi Rebecca.

Is there a reason, why there are no exercises in the ash book?

3 Likes

Hi Heiko!

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.

4 Likes

Hi Rebecca.

I would have liked to have a many_to_many example.
Why isn’t the one?
Or is one coming?

Cheers, Heiko

3 Likes

Hi Heiko,

There is one coming in chapter 9!

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! :v:

5 Likes

Hi Rebecca.

One more:

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.

Heiko

3 Likes

Hi Heiko,

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.

4 Likes

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?

4 Likes

Thank you very much.
That’s really nice.
I will check it out.

Cheers, Heiko

3 Likes

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.

5 Likes

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.

3 Likes

I love this idea. A “getting started cheat sheet” with code snippets for a bunch of the basics would make so much sense. Putting it on my list :smiley:

6 Likes

Actually, there are kind of two pieces here. A cheatsheet while building, and a “lay of the land” guide. Both make lots of sense :smile:

4 Likes

Hello Rebecca, hello Zach,

I’ve got two questions:

  1. Are there any larger ash-powered websites that are online (and you are allowed to mention publically)?
  2. Do you consider Ash to be feature-complete (except the extensions) or are there still larger milestones on your roadmap?
2 Likes

There are some minor features left to be added, but they do not majorly change the shape or extent of the framework. I would call it “feature complete enough” in that regard. An example that comes to mind: Support resources as aggregate targets in expressions · Issue #939 · ash-project/ash · GitHub

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.

Some examples:

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 :smile:

Those are not open source though.

3 Likes

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 :exploding_head:

If I wanted to sell Rails devs on Ash, I’d probably have to first sell them on Elixir and then Phoenix :sweat_smile:

5 Likes

Hello Zach and Rebecca,

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?

Thanks.

1 Like

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 :slight_smile:

4 Likes

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.

3 Likes