Hacker News new | ask | show | jobs
by nyxcharon 1238 days ago
After working with the PETAL (Phoenix, Elixir, TailwindCSS, Alpine.Js, Liveview) stack at $JOB for a while now, I have to say I've never been more productive.

Early on I would still have to lean on Alpine heavily for various JS interactions but with all the features Liveview has been adding and improving on (Hello JS module!) I find myself needing it less and less. Liveview really has been a game changer for me. Tailwind has more or less fixed most of my frustrations with CSS and has worked itself nicely into the company design system resulting in nice re-usable components that can be easily customized for those one-offs. Elixir is a nice language to use and I find myself missing features of it when working with other languages. Phoenix is well structured for projects and the newer generators solve a lot of common issues/features in projects like user auth in a reasonable way.

Depending on the needs of the app I'd look into deploying to Fly.io otherwise I've been using Kubernetes with little issue. I've toyed with Nomad for orchestration but haven't used it enough to give an opinion. I do wander if it's a nice middle ground for those who don't need the full suite of what K8s offers.

11 comments

I second this. I would say that I am pretty advanced with Python (and Django) and same with JavaScript (Vue and Nuxt) and have written applications that got used by multiple users. I saw a sharp rise in my productivity when I knew enough about the frameworks. But Elixir + PhoenixLiveView + Tailwind has been life changing.

I learned Elixir for the sake of the joy of learning a new programming language and I kept playing with it for few random days over 5-6 months. Finally, I took the leap of faith and for our startup I started the switch to Elixir + LiveView with minimal JavaScript hooks and I feel a weird bliss that we are two engineer FTEs and I can add features on a daily basis. Why that's the case, I still haven't ruminated myself, but my guess is 1. I have gotten older, 2. Elixir is beautiful and productive by design-- pattern matching, everything is a process (so the dimensionality of time is not an issue at all) and the code is kind of a right balance of simplicity and complexity, and in my opinionated view, there is "one" right way of doing things. 3. Standard tooling (mix, ExUnit). They have enabled us to write really maintainable code and for our next hires, we are willing to pay for them to learn Elixir than switching to other languages. Of course this is only for true for our web app which is actually a weird beast that interfaces farms, sensors, algorithms, and humans.

Awesome experience write up.

Question for you and OP, do you find that using languages like Elixir makes it so you have to look for a certain kind of dev given that Elixir is a pretty niche community or are folks with no experience able to adapt with relative ease?

Not one of the OPs but can happily echo their experience/praise for PETAL and think I can answer your dev search question:

Anyone with a can-do attitude can learn Elixir. People with a “no thank you, I already know XYZ” mindset you really don’t want on your team.

Almost 20 years ago @pg wrote the “Python Paradox” post: www.paulgraham.com/pypar.html

The same holds true for Elixir (and Rust) these days. The people you want to hire are those who learn new skills/languages proactively.

However I can confidently say, from experience of having hired several Python devs/data scientists with zero Elixir experience, that smart+motivated people can learn Elixir in a couple of days and be productive within a week. See: https://www.verytechnology.com/iot-insights/elixir-for-pytho...

I'd argue the other way. Yes anyone with a can-do can learn Elixir. But there's a difference between learn and LEARN..

I work with a pile of rails devs writing code in elixir. In that I mean you can feel the rails in their code. It "tastes" like rails. A few python devs also write python with elixir syntax.

Finding people who know the language is hard. Finding people who are willing to risk their time on the language is also hard.

By risk. If I spend 2 years writing Elixir and then go looking for a job I'm looking at getting a job with a language that's not popular. So my pool of place that will even look at me is smaller. Hiring managers/gate keepers might not see..

After 12 years of c++ I got a job where I needed to code in Delphi-Script for a year. When I told recruiters what I'd been doing I got "Oh.... Okay um... We'll call you."

I switched to rails for 6 months (same job) and recruiters were calling me non-stop. Working in low popularity langs limits my options. (even if they are great langs)

I'd say picking a language that's not yet popular limits your pool not just to the can-do's, but also to the can get my next job with this on my CV.

Isn't Elixir a little bit like Ruby though? At least superficially. And it supports metaprogramming like Ruby.

So I'd guess the code would end up looking similar on a lot of teams

It's a little bit like ruby.. But

It's not object oriented, it's a functional language. It is polymorphic and all data is immutable. (Edit: actually realised its very much not like ruby, when I re-read this)

What I've seen in most projects is that the awesomeness that is threading (tasks and processes) is not really used. Supervisors aren't built as first class citizens.

I see teams eat the cost of NIH, but not get the benefits of crash fast, crash often.

So yes it does end up looking/smelling like ruby/rails but it really really shouldn't.

“A language that doesn't affect the way you think about programming, is not worth knowing.”

There is development joy found in both, but Elixir and the underlying erlang definitely has it's own idioms.

You can know enough to get going quickly, but there's a healthy layer of power that will only come with time.

That nailed what I wanted to know. Thanks!
I didn't want to confess, but yes you're right. Elixir (or the willingness to learn Elixir) is a great filter for me to find the right people. Again, this is my purely subjective opinion and might as well be true for other languages as well.
I'll more or less echo what nelsonic said.

No one where I work has come in with Elixir experience. We look for people that are motivated to learn. Elixir has been one of the easier languages in my career to learn, and I think others that I work with would agree with that.

The degree of difficulty with learning Elixir/OTP depends on what one needs to learn. Phoenix web development has its own domain of learning requirements where as other domains have theirs. Learning Elixir is one thing but learning OTP, and then learning how to make sound decisions about design/architecture, is far more demanding of effort and time. "How do others solve this?" leading to github search tends to fall far short of what one would find with other language ecosystems.
Moving from Python/JS -> Elixir at a startup seems very high risk, have the rewards been worth it? I can imagine issues with hiring, unknown unknowns, and less libraries/support in general.
I know-- I was scared like hell. But after the first week and multiple staging releases in less than 10 days, I was on top of it. Yes, hiring is real challenge and am facing it already. However, if I, even as a startup, reach the salary threshold, then hiring is not a problem. I'd say I've yet not found a case where I couldn't find a library for my use case.
The start-up I work for uses Phoenix and Elixir. I've been there around two years now and we haven't experienced any issues with hiring or finding skilled people. If anything, I'd point to Elixir as being one of the major factors of our success.

We are a remote company, so things may not be as easy, depending on your location, if your company demands people be in the office.

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

I also went this route, but am keeping the infrastructure simple in order to minimize lock in. It has been super productive but also I've spent years using elixir professionally and unprofessionally so I'm comfortable with it. The nice thing is that the elixir ecosystem is so robust you don't need to get locked into whatever cloud provider solution is in vogue at the moment. Also, we got a pile of cloud credits from different providers, and intend to use them :)
I too would reach for the PETAL stack you mentioned. I don't code professionally anymore, but when I did I had experience using a lot of different languages (e.g., C#, Java, PHP, Ruby, Elm, Python, Perl, Lisp, Node, Clojure, F#, etc.). Elixir is by far the most productive and joyful language I've ever experienced. It's absolutely beautiful.
Adding my vote here. Throughout my career I've gone the C#.NET -> RoR -> Clojure -> Elixir/Phoenix route. After spending a year with Elixir, iterating rapidly on a production system, I'd default to it for any MVP or serious project going forward.

LiveView is also very close to becoming default over React for interactive Frontends.

We use Nomad at $JOB and it's been great. We're a small startup with one senior site reliability engineer doing pretty much all the infra work and I (~CTO) chip in when I can be useful, though when we adopted Nomad it was just me working on infra.

I looked into Kubernetes (I haven't worked with it at all before) and there just seemed so much complexity to handle things I didn't need that it was too much to learn for the benefit. Once I found Nomad it was a lot simpler, but it has everything we need and that's stayed true as we've grown.

I'd definitely strongly recommend it if you're wanting an orchestration system and don't need the complexity Kubernetes brings.

For deployment I'm using Docker + Github CI + Digital Ocean basic droplets. Docker support is built into Phoenix, all you need is `mix phx.gen.release --docker`.

What I like about it is that upgrading a DO host is basically a matter of spinning off a new droplet and install Docker on it. Also, setting up deployment for a new Phoenix project takes about 30 minutes now.

I feel similarly, except for the AlpineJS part. I think PETL is fantastic and I would 100% choose that for my stack.
Is Liveview CSP compatible? I found out that Alpine isn't and the alternate CSP build of it isn't stable.
I'll second this. Alpine.js is so nice.
Fly.io is great!