Live data from Hacker News

Elixir and Phoenix after two years

nts.strzibny.name

61–70 of 111 posts

Re: Elixir and Phoenix after two years

#61
post #46

Earlier quoted context omitted.

Let me tell you the single reason I haven't switched to Elixir yet: I develop backend and frontend (SPA) so I'd rather just stick with a single language and library catalog. It helps that there's plenty of libraries in JS land too. I would love to just write elixir code but at the end of the day I feel sticking with node+browser js is the more pragmatic choice right now.

Isn't phoenix meant to remove the JS dependency on FE dev? (Not arguing with any of your points btw, JS is matter-of-factly more popular and pragmatic).

I just implemented a thing for work in very bare Phoenix Liveview. It integrates with Plaid. I definitely needed hooks and about 200 lines of JS to get it working. You can't completely kill JS, yet, unfortunately.

Re: Elixir and Phoenix after two years

#62
It's always interesting to read these and I completely agree with the author's comments on productivity (both on Phoenix and Rails). It's a major reason why I learn and teach Elixir, even though it's niche. I genuinely want the skills!

One thing to that stood out was how the author found deployment easy, the same as I first did 5 years ago:

> "The deployment of Phoenix can be as easy as copying the Mix release I already mentioned to the remote server. You can then start it as a systemd service"

I was using Distillery to make the release, but the workflow was virtually identic. Back then, the command to make a Distillery release was even "mix release", just as this author types for Elixir 1.9+ mix releases now.

> "Of course, you can make a light way Docker container too, but maybe you don’t even need to. Mix releases are entirely self-contained (even better than a Java’s JAR)!"

Also true!

Re: Elixir and Phoenix after two years

#63

Earlier quoted context omitted.

> and perhaps there could be a more concise enhancement of Erlang which would get the job done Erlang already is a more concise language than Elixir but also noisier as there are more punctuation characters. I would love if Erlang would drop some of its punctuation, as some of it is frankly unnecessary. Elixir syntax is definitely simpler than Ruby’s. Probably in the same ballpark as Python complexity wise: Elixir ha…

> Erlang already is a more concise language than Elixir but also noisier as there are more punctuation characters. What? Here's more-or-less the entirety of Erlang's "noisier syntax with more punctuation characters" -spec f(A :: any(), B :: some_type(), C :: list()) -> any(). f(A, {B}, [C | _]) -> A1 = fun() -> io:format(a, []) end, A1(), case C of > -> 1; _ -> #person{ok = ok, field = C} end. Edit: %% plus map synta…

you are conviently forgetting one thing:

The equivalent of "hello world" in erlang is

    >
Not the best. Keyword lists in erlang are unpretty

    m:f(value, [{foo, >}, {baz, 47}])

Where in elixir you would do:

    :m.f(value, foo: "bar", baz: 47)

Re: Elixir and Phoenix after two years

#64
post #2

What are people finding as the real sweet spots for Phoenix? I have used Erlang very successfully in a semi-embedded context, but that's quite different from a web server that can usually be scaled horizontally pretty easily. One obvious one is if you have to hold open a lot of concurrent connections like web sockets. It'd be great for that. Others?

Elixir with Phoenix feels like programming with simple and straightforward abstractions around HTTP server, HTML generation and DB querying. Ruby on Rails feels like some sort of divine incantation. Rails has a lot of magic and hand waving, and there are recipes for doing everything that you would ignore at your own peril. I don't get the "hold on to your butts" feeling with Elixir.

Re: Elixir and Phoenix after two years

#65

i'm not a web developer but enjoy paying attention to this space from the sidelines. elixir and phoenix are wonderful. the phoenix liveview is a fantastic piece of technology; it moves the processing to the backend and allows the web application to be developed in the same language (mostly). i just recently discovered microsoft blazor and it seems like it's an even better improvement. compared to liveview, the comput…

I'm an Elixir developer, and I love the language, but I'm not sold on Phoenix LiveView. It sounds really cool, but it seems like there are too many edge cases. How do you scale it horizontally? What happens to user state when a connection is dropped? What do you do when you get a business requirement that hits one of LiveView's pain points? What if you have to swap out your backend for business reasons, and now you h…

There is now good support for keeping the data cashed client side, so that if your connection does drop, it can be restored once the connection is reestablished. That used to be a pain point, but as far as I have seen, it has been pretty well fleshed out now. This all happens mostly automatically, so you don’t have to worry about it. I think it’s just a parameter that you set to “true“.

Re: Elixir and Phoenix after two years

#66

It's always interesting to read these and I completely agree with the author's comments on productivity (both on Phoenix and Rails). It's a major reason why I learn and teach Elixir, even though it's niche. I genuinely want the skills! One thing to that stood out was how the author found deployment easy, the same as I first did 5 years ago: > "The deployment of Phoenix can be as easy as copying the Mix release I alre…

I've found the release story to be lacking. For example, the suggestions I've seen for automatically running migrations after launch can blow up if you have traffic between the deployment start and the migration end. Even if I accept downtime, I've found mix annoyingly low level.

Re: Elixir and Phoenix after two years

#67

Oh no same crap of mixing hash symbol and string keys as in ruby? You didnt have to borrow that Elixir! Does Elixir also have HashWithIndifferentAccess?

Well you can use any datatype you want as a key in a map. It wouldn't make sense to not allow either atoms or strings.

Re: Elixir and Phoenix after two years

#68
post #3

To add to the author's experience, I spent 18 months of production time with Elixir and Phoenix. As he says, the templates are compiled and are blindingly fast compared to Rails. Pattern matching is really really nice when used in the right places (and you'll miss it if you go back to Ruby); but it can be overused. There's a faction of Elixir folks who attempt to avoid all conditionals and instead seem to prefer mult…

The problem for a new technology like Phoenix that wants to dethrone an established player like Rails is that it's not good enough to be 50% better. It has to be 2x or 3x as productive to offset the smaller ecosystem and pool of developers. And I'm not convinced for most of the things that Rails is used for it's that big of a productivity boost.

Re: Elixir and Phoenix after two years

#69

Earlier quoted context omitted.

Isn't phoenix meant to remove the JS dependency on FE dev? (Not arguing with any of your points btw, JS is matter-of-factly more popular and pragmatic).

I just implemented a thing for work in very bare Phoenix Liveview. It integrates with Plaid. I definitely needed hooks and about 200 lines of JS to get it working. You can't completely kill JS, yet, unfortunately.

Was it your integration with Plaid that required the 200 lines of JavaScript?

I've spent the last year building out a web application for service providers to use to manage disaster recovery software for multiple clients using Elixir, Phoenix, LiveView, and TailwindCSS. We haven't used a single line of JavaScript code, including for the Tailwind components that typically rely on JavaScript to function. LiveView has been able to handle it all.

Re: Elixir and Phoenix after two years

#70

"Elixir is not an object-oriented language. We practically only write modules and functions. This helps tremendously in understanding code..." Sign me up. I hold hope that Elixer is the thing that starts pushing the knife into OOP. Microsoft has added a ton of features to make functional style a thing in C#, and nearly everyone hates Java...so maybe the stars are aligning.

Agreed. OOP is obnoxiously convoluted at times and—I feel anyway—never fully delivered on its promises of reuse. I've been using Elixir for about five years now and I never want to write another line of OOP code. I don't care what language it is in.
Post reply on HN