Hacker News new | past | comments | ask | show | jobs | submit login

My side-project relies heavily on WS, I'm currently using Node.js and it's alright but learning Elixir is my goal during these holidays. Any resource to share to get started? I don't know much about Elixir except it's perfect for such use-cases.



I was a nodejs programmer for almost 8 years before I hopped to elixir. A lot of it was motivated btw elixir's realtime system and concurrency.

One of the issues with nodejs is that you're stuck to one process which is single threaded. IE: you're stuck to one core. Yes there are systems like clustering which relies on a master process spawning slave processes and communicating over a bridge but in my experience, its pretty janky.

You're making a great move by trying out elixir. It solves a lot of the issues I ran into working with nodejs. Immutability is standard and if you compare two maps, it automatically does a deep evaluation of all the values in each tree.

The killer feature however is liveview. Its what meteor WISHES it could be. realtime server push of html to the dom and teh ability to have the frontend trigger events on the backend in a process thats isolated to that specific user. Its a game changer.

Anyways, if you're looking for resources to learn. pragprog has a bunch of great books on elixir. Thats how I got started.


I got pretty far in the beginning just by reading the docs on Phoenix channels [0]. I was learning Phoenix and ReactJS at the same time and got a pretty simple Redux thunk that interacted with Phoenix Channels in a few days. I'm not sure if that was the optimal way to do it, but it was really cool interacting with the application from IEx (elixir shell).

You might find an interesting (albeit more complex) entry point by interacting with Phoenix Channels from your Node.js app using the Channels Node.js client [1] and within the frontend itself.

[0]: https://hexdocs.pm/phoenix/channels.html [1]: https://www.npmjs.com/package/phoenix-channels


I wrote Real-Time Phoenix and it goes into pretty much everything that I hit when shipping decently large real-time Channel application into production. Like, the basics of "I don't know what a Channel is" into the nuance of how it's a PITA to deploy WS-based applications due to load balancers and long-lived connections.

The new LiveView book is great if you're interested in going fully into Elixir (server/client basically). I use LiveView for my product and it's great.


thanks for the excellent read. it was one of the pdfs sitting on my desktop when I was designing our event system at my startup.


The book Real-Time Phoenix is good for designing realtime systems.

For a good introduction to Elixir, I loved Elixir in Action which also covers OTP.

If you want a good Phoenix resource, the book Programming Phoenix is good.

Finally, the docs in Elixir and Phoenix are great.


Being already familiar with FP I was able to jump right into elixir after running through learn you some erlang. Erlang and elixir are very similar, and you get the bonus of learning a bit about OTP, BEAM, and the underlying philosophy. There's a ton of resources after that, and the docs are easy to use and understand.

https://learnyousomeerlang.com/




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: