Live data from Hacker News

Adding Elixir to our Nextjs app (2022)

linen.dev

21–30 of 31 posts

Re: Adding Elixir to our Nextjs app (2022)

#21

Since this was written about 8 months ago. Our Elixir/Phoenix service has been incredibly stable and I can't think of a single time we had an issue with it.

Have you considered moving the logic that is in the Node backend over to phoenix, so you just have a single backend component?

We use typescript through out the app and we like having both the frontend and backend sharing types in the same repository.

Re: Adding Elixir to our Nextjs app (2022)

#22
post #19
post #13

Earlier quoted context omitted.

Sometimes I want partial application and other functional paradigms... to reduce LOC by 90%

I’m currently in the process of picking up elixir. When you say partial application, are you referring to the use of the capture operator `&`?

Not your parent commenter but likely they at least partially meant that, yes.

Though that alone can't reduce LoC by 90%. Elixir is just incredibly terse and no-bullshit language in general. All the shorter code idioms together make for a readable and to-the-point code.

Re: Adding Elixir to our Nextjs app (2022)

#23
post #19
post #13

Earlier quoted context omitted.

Sometimes I want partial application and other functional paradigms... to reduce LOC by 90%

I’m currently in the process of picking up elixir. When you say partial application, are you referring to the use of the capture operator `&`?

Bad explanation from a noob (me), but basically yes. Functions just always fit together and I don't need ugly sprawling interfaces or pointless declarations of nearly identical functions.

In Elixir when I want to pass a function with 3 arguments into an interface that expects 4, I can do something inline with no extra boilerplate like func(&1, &2, &3, )

Re: Adding Elixir to our Nextjs app (2022)

#24
post #2

Why not use Go? They have one of the best networking stacks among language standard libraries, excellent support for low latency soft real-time concurrent operations, and single binary deployment is trivial.

The best language for the task at hand, when presented with time constraints, is the one that you already know well. OP said in the article that they authored Papercups [1]. Adopting Elixir for a websocket-push service makes a lot of sense, then. However, why don't you learn Elixir, some OTP, and then reconsider that question? You could be missing out.

[1] https://github.com/papercups-io/papercups

Re: Adding Elixir to our Nextjs app (2022)

#26

Since this was written about 8 months ago. Our Elixir/Phoenix service has been incredibly stable and I can't think of a single time we had an issue with it.

The Elixir repo on github hasn't been touched in 7 months. It's been that stable and feature complete?

Re: Adding Elixir to our Nextjs app (2022)

#27
post #26

Since this was written about 8 months ago. Our Elixir/Phoenix service has been incredibly stable and I can't think of a single time we had an issue with it.

The Elixir repo on github hasn't been touched in 7 months. It's been that stable and feature complete?

Which elixir repo? the elixir-lang repo last had a commit 3h ago. the phoenixframework repo was update last week

Re: Adding Elixir to our Nextjs app (2022)

#28
post #27
post #26

Earlier quoted context omitted.

The Elixir repo on github hasn't been touched in 7 months. It's been that stable and feature complete?

Which elixir repo? the elixir-lang repo last had a commit 3h ago. the phoenixframework repo was update last week

They are talking about their backend in elixir https://github.com/Linen-dev/linen.dev/tree/main/apps/push_s...

Re: Adding Elixir to our Nextjs app (2022)

#29
post #2

Why not use Go? They have one of the best networking stacks among language standard libraries, excellent support for low latency soft real-time concurrent operations, and single binary deployment is trivial.

Not OP. Very personal opinion: Go is an ugly language and I don't enjoy working in it for that reason alone. Outside of that, I also don't like the language design for a lot of its features. Though, admittedly, the goroutines part is not one of those choices I dislike. But the error handling pattern, generics and a few other things are super meh to me. And everything Go does with networking and concurrency, Elixir do…

Go is not dynamically typed. People keep putting dynamically typed languages into production. GG

Re: Adding Elixir to our Nextjs app (2022)

#30
post #2

Why not use Go? They have one of the best networking stacks among language standard libraries, excellent support for low latency soft real-time concurrent operations, and single binary deployment is trivial.

go is great at a lot of things but if you want a multi clustered websocket solution, elixir is the absolute best in this category. go has go threads. elixir has the actors, futures, message passing, immutable data structures and the OTP platform. OTP is killer and gives you genservers with pubsub and the ability to have thousands of tiny stateful processors PER machine. Its all battle tested too. comparing go to elix…

> the ability to have thousands of tiny stateful processors PER machine

Go has this too. It also has message passing (via channels). That's not to deny that Elixir/Erlang have a more developed story for IPC, process supervision and clustering.

Post reply on HN