Hacker Newsnew | past | comments | ask | show | jobs | submit | scwoodal's commentslogin

Ash will be your Django models. Once you have models (ash resources) built; you can use the Ash ecosystem to get things like a graphql or JSON endpoint (or both!) for those resources with just a few lines of code.


Right and unlike an ORM which only models the "nouns" and "relationships" of your business domain model, Ash also models the verbs.

This allows it to reveal the actions of your system externally via GraphQL or JSON API as well as modelling the data for your relational schema (although data layers are swappable and are not always relational).


I guess describing ash as "the middle layers" is what helps bring the picture together for me.

The data/orm, I usually think of as a lower layer. Then you build domain on top and then interfaces on top of that.

I can see Ash be the middle layer, where you define the domain, (using nouns and verbs) and it pieces together the data and the interfaces.


I’d consider Phoenix to be like Flask. Ash fills the gap that brings Phoenix up to feature parity with a batteries included framework like Django.

Ash Admin (Django admin), Ash Resource & Domain (Django models & ORM), Ash JSON (Django Rest Framework), Ash Auth (Django Allauth), Ash Phoenix (Django Forms), Ash policies (Django permissions)

But you aren’t required to use Phoenix with an Ash project. Ash will happily work as a standalone CLI, terminal app or some other Elixir web framework that comes out tomorrow.


The forms https://hexdocs.pm/ash_phoenix/AshPhoenix.Form.html seem even more low level than Django forms, and those are notorious for being too low level and annoying to work with. This to me seems to run counter to the tagline. Compare with iommi for Django where you can truly "derive the rest" from the domain model to get forms and tables.


There is definitely room for the Phoenix Form helpers to do more. Iommi looks like a really interesting approach I hadn't seen before.

For example AshAdmin (https://github.com/ash-project/ash_admin) takes these ideas further and generates a full super admin interface for you. It's a bit clunky and you should ultimately write your own admin, but it lets you focus on the important parts first.

For anyone else who hasn't seen it Iommi's motivation and docs are here:

Motivation https://kodare.net/2024/09/11/why-we-wrote-a-new-form-librar...

Iommi Forms https://docs.iommi.rocks/forms.html

Iommi Github repo https://github.com/iommirocks/iommi


Yea, the thing with the transparent APIs thing in iommi is that there's an admin and you can customize it just as much and as detailed as your own code. So you don't get the thing with the Django admin where you get a rough thing first and then spend hours and hours customizing and then when you hit the limit, you have to throw all that away and start from scratch. I hate that.

You can literally take 100% of the iommi admin config and copy paste it into your own custom edit forms or tables or whatever it is. It's the same config language.


This type of thing is the real measure of a framework.

Thank you for digging.


Exactly! That's a great way to think about it in Django terms.


Hi Josh!

Scott from the Gig City conference ;)


Oh hey Scott! :)


Thanks. This is exactly what the website should say!


They really should put something to that effect on the homepage.


Isn't what you describe using your own capital to use as an investment instead of paying down the mortgage?

How do you use the leverage (debt) from the mortgage to put in a 5% investment?


I already owned the house free and clear. Was offered stupid (good) terms for a mortgage so I took it. Used the money to create a return that pays back the monthly interest and principle while still creating a return AND tax deduction.


Ah, thanks for the explanation. Unfortunately not something I can do.


The use case is a fun one liner.


As a fun hack / code golf it's great. I was being tonedeaf I guess, woosh as they say.

The marketing pitch on the landing page is written so well that I took it too seriously probably.

I know htmx but wasn't able to see this as a parody, so my fun capabilities were failing :)


I have changed it to explicitly state within the first paragraphs that "htmz is an experiment" now. I started this as a joke but turned into a fun working solution - I myself am not sure if this is just a joke or a thing. Maybe I'll use it in some smaller projects, or maybe not!


All power to you! No need to decide if it is a joke or not! ;)

In fact I clicked on it just because the name was so hilarious and already indicated pretty well what might be to expect (I didn't expect your particular solution though, kudos)


+1. It's easy to drop a 1/0 wherever I want Werkzeug to show up in the browser.


lol next time try “assert False” but I guess it’s same same


> Fan motor on compressor broken, company insist everything needs changed.

Ugh, this happened to me recently.

“It’s an old system and the replacement parts can’t be found. Have to replace the whole thing. $12k”

After they leave I found a replacement on Amazon and replaced it myself 2 days later in under an hour.


I don’t think 1.7 is officially out yet as it’s sitting at rc-3.



Nice.

It didn't seem to have really made the frontpage of HN despite a lot of votes.


There is no such thing as bad weather, only bad gear ;)


Wet-bulb temperatures above 30 C/85 F are pretty bad no matter what you're (not) wearing.


This is why I highly prefer living in colder countries. You can always wear better gear or light a fire.

But what do you do when you're spread-eagle naked in the shade and still sweating like a pig? That's not a place for humans =)


That's what people from cold places say :)


Talking about complying with things your parents said, but actually being annoyed by.

There is a saying where I live that wind is when the sheep don’t have curly hair anymore. And rain when the fish are swimming on your eye level.

In all seriousness though, it’s of course true.


I also would choose Elixir/Phoenix. Having spent my career in Python/Django, Elixir/Phoenix/Live View is on another level of productivity.

For anyone needing a reason to jump into Elixir, take 40 minutes and watch this talk [1] by Sasa Juric. He communicates things so well as to all the benefits of Elixir/Erlang/BEAM.

Then take the time to read Elixir in Action book (again, Sasa) and you'll be off to the races.

[1] https://www.youtube.com/watch?v=JvBT4XBdoUE


Subtle bug in that toppings has a mutable default argument [1].

[1] https://docs.python-guide.org/writing/gotchas/


There is no bug... yet. Unless you modify the default argument.

Sometimes I just want to monkeypatch the list to be immutable in my app.


I'd consider this a bug and not expected behavior.

  def make_pizza(crust=THIN, toppings=[], cheese=REGULAR, sauce=TOMATO):
    // first call: toppings=["peperoni"]
    // second call: toppings=["peperoni", "sausage"]
    // third call: toppings=["peperoni", "sausage"]

  make_pizza(toppings=["peperoni"])
  make_pizza(toppings=["sausage"])
  make_pizza()


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: