Hacker News new | ask | show | jobs
by faangguyindia 38 days ago
Who even uses Erlang? I used Rails and then i tried Phoenix and it was lot more difficult to get things done.

I don't understand Phoenix hype

For solo devs, Rails is arguably most productive webapp system. LLM is very good at writing ruby rails code. Much better than writing django in my experience even though python training corpus is huge.

I write my experimental apps in Rail when it stabilizes, i do a Go rewrite.

I don't write directly in Go because, it consumes lot more token when the app scope is unknown but it's very efficient for rails.

These day i don't need react or angular anymore, i use Hotwire in Rails and HTMX in Go.

Erlang forum itself uses Discourse (written in Rails)

8 comments

I’ve been writing Elixir apps full time since 2016. Clients are very, very happy never to see a crash. In fact, all the applications I have deployed in production in the past 10 years have 100% uptime. (Apart from hardware, OS and network faults outside my control)

You might want to broaden your horizons.

hello,

would you please recommend a good resource to get started with elixir ?

thanks for your time !

This is a good place to start:

https://elixirisallyouneed.dev/resources

This is a good list. I started with the books by Saša Jurić (they are excellent), and the Programming Phoenix LiveView is a must have if you want to do anything web-related.

If you're on the fence, this'll convince you: https://www.youtube.com/watch?v=JvBT4XBdoUE

I'd say Rails is faster than Phoenix (as in development speed) only for the first day or so. After that you'll stumble upon impicit logic, method-missing and this kind of stuff, which will require more time to figure out how it works. Elixi/Phoenix is more exlicit in that regard, making long-term support (as in anything past first week) a breeze. No hidden state, no figuring out where ModuleName.method(params) is coming from, no need to setup stuff to launch said method (just pass right arguments). The only downside i see is smaller library of ready to use packages
but if you want explicit any not just use django?
Elixir and Phoenix is a better production platform than Django.. I’m not throwing shade on Django, many production systems use it happily. I’m saying that Phoenix/Elixir is better, partly because of the BEAM and OTP and partly because of the language and the framework. Real concurrency. Better performance. Far more robust in production. The language is pre-compiled, and while not statically typed, that alone provides one more safety layer. It’s functional, which avoids a lot of the ugly patterns in both Rails and Django. It has a built-in fast and reliable KV store. It has distribution between the nodes if you want it (e.g. for a distributed cache). It enables you to debug with a remote shell connected live to the running system. There’s a lot more than I can add here.
if you want true concurrency, why not use goroutines? It provides single binary deployment and static types?
I am a Go dev, too. I consider Go my main language. The BEAM has a very, very similar architecture to the M:N scheduler in Go. Goroutines are not dissimilar to BEAM processes. You can similarly run thousands of processes on the BEAM. But Go does not have a real Phoenix equivalent and there are reasons to use Elixir and BEAM, especially on the web side, including some of what I already mentioned above.
Elixir is very ergonomic when it comes to concurrency, e.g. parallel-map example:

    1..10
    |> Task.async_stream(fn x -> x*2 end, max_concurrency: 2, timeout: 7000, on_timeout: :kill_task)
    |> Enum.to_list()
Equivalent Go code would be very long and very ugly.

Golang has its positives but you also lose a lot. Whole ecosystem is not comparable, like "debug live production cluster" is one-command away for Elixir vs "fuck you" for Golang

Django is not very different than Rails and imo much less ergonomic. Many issues are still there like hidden state/setup needed to call something
django requires more boilerplate and is less magic than rails.
Would you like to take a guess what the Ruby Discord uses?
Phoenix is mostly interesting because of OTP and channels (and LiveView I guess but it's not a choice I would make in 2026) so if you don't need what they bring...

Ecto is not bad as well.

Claude Code is very good at writing Elixir.

Surprise, you'll be more productive with what you know, LLM or not.

Is your disinterest in LiveView because you'd prefer the more common SPA/API separation, or some other reason? I'm curious because as a mostly backend engineer I view LiveView as sort of a killer tool for the sorts of apps or tools I'm likely to build.
Not the parent, but since the liveview state is on the server side it means that one server can't support a large number of concurrent sessions, for some value of large.
I just strongly dislike the layout engine ;) Also yeah deployment with active socket connections is not always ideal.

Not writing api routes for the frontend (when you don't also have a mobile app etc) is nice though, and pairing it with PubSub for UI updates is a cool trick.

I used both Rails and Phoenix.

ActiveRecord is more pleasant to work with than the ORM of Phoenix IMHO, but not everyone shares the same feeling.

Despite having built in concurrency my team ended up building a version of Sidekiq because supervisors don't cover all use cases of job control.

I prefer deploying with Capistrano than with Elixir builds. Another matter of taste.

Structural pattern matching is the only feature I dearly miss, but that's a feature of the language.

We never used Liveview. We had a backend for a JSON API so I can't compare that feature.

> ActiveRecord is more pleasant to work with than the ORM of Phoenix IMHO

A stateful mechanism vs a data mapper? Absolutely not. Being able to write `user.save()` is such a lunacy, thank god we have functional languages that (necessarily) decouple storage from data models.

I cringe every time I have to use imperative, stateful languages.

> ActiveRecord is more pleasant to work with than the ORM of Phoenix IMHO, but not everyone shares the same feeling.

Well, depends on what you do. Ecto is closely follows SQL logic and allows to translate weird sql queries into code directly. All queries are explicit, e.g. you either do preload(...) or can't access nested records at all, no chance of N+1 by design.

Changesets are also different and are just functions you can define as needed.

    defmodule MyApp.User do
    ...
    def changeset(user, attrs) do
        user
        |> cast(attrs, [:email])
        |> validate_required([:email])
        # This matches the error from the DB uniq index to the :email field
        |> unique_constraint(:email)
    end
It's fun watching other languages orms be 10 years behind in design.

Your example is a common anti pattern from PHP orms 15 years ago.

1) that's not an ORM

2) after ~8 years of using it, i find it ergonomic, light on congitive load and good for long term support

Calling it not an ORM just cause it implements a DTO is splitting hairs. It's an ORM. If you are hydrating an object that saves to storage and you are manipulating it's life cycle and then casting types between your storage primitives and your language primitives from memory to disk you are writing code that every other ORM is writing and it's not special.

As soon as you add use Ecto.Schema to your model it's an ORM.

> But it doesn't require a database and queries have to be explicit!

yea yea that's a feature of every ORM

Could be wrong, but i dont think thats an orm.
> I don't write directly in Go because, it consumes lot more token when the app scope is unknown but it's very efficient for rails.

The absolute irony of writing this whole ramble and then revealing that you're not even the one writing the code.

Erlang != Elixir - but otherwise a good question. I think WhatsApp uses erlang
I write Rails aswell but comparing Rails with Erlang is kinda weird, they are for completely different domains. Both can co-exist in this world. These are only tools, not a cult or part of personality.