Live data from Hacker News

Lovely Week with Elixir

ramblingcode.dev

41–50 of 139 posts

Re: Lovely Week with Elixir

#41
post #14
post #11

The fact that it's a dynamic language make problems similar to Node / Python, can't dev serious backend services without a strongly type language. Not saying you can't, but you will have a lot of issues overtime that would have been catch at compile time.

Having used all three in backend systems, I definitely disagree that they have the same problems. Elixir is strongly typed but lacks static typing, in exchange it has a powerful pattern matching system that more than makes up for this problem in my experience. But fundamentally the issues caused by lacking static typing is different from the problems caused by being weakly typed like python and node systems are.

In my experience python is strongly typed as well - unless you meant something more nuanced?

Re: Lovely Week with Elixir

#43

The BEAM is a huge win: having lightweight threads means you can often do away with things like Redis for job queues and PubSub stuff. I love this answer on StackOverflow by Elixir's creator: https://stackoverflow.com/questions/32085258/how-can-i-sched... So simple. Something that would require a job queue and a job runner fades away into a piece of the OTP application tree. When it crashes, it will even come right b…

I don't really understand this sentiment of not needing a queue system. This is not much different from spawning a thread in Java to delay the email sending.

For any serious application you want a job like that to be persisted so you can guarantee it runs even if your application is restarted.

I know that Erlang/Elixir is designed for stateful applications and if you have a cluster and do hot deploys this is less of a problem, but who does that? Most Elixir applications I've seen are deployed as stateless systems just like any Ruby, Python, Node etc systems.

Re: Lovely Week with Elixir

#44

Another person who liked Elixir, cool :) Btw. If anyone is interested, I'm working on prettier plugin for html l?eex files. Probably gonna publish it next week.

That sounds lovely. Thanks for building that! Followed you on twitter, pls let me know when it's live.

Re: Lovely Week with Elixir

#45

I learned Elixir a few weeks ago as a quarantine self-improvement project and pretty much loved it. There are some warts, as in any language. As someone who's primarily worked in Go and Java in the past and has also been learning Rust I don't super love the optional typing thing, and I end up missing higher-level data constructs like interfaces and traits. But there are some great language features, like guards and p…

I've been meaning to do this for so long and I've started at least twice but other work or life have gotten in the way. And I haven't gotten any "quarantine-time" as my industry has been busy!

It's good to hear this, though. I might have to try and re-prioritize learning it again.

Do you have any good resources on hand that you used and would recommend?

Re: Lovely Week with Elixir

#46

The BEAM is a huge win: having lightweight threads means you can often do away with things like Redis for job queues and PubSub stuff. I love this answer on StackOverflow by Elixir's creator: https://stackoverflow.com/questions/32085258/how-can-i-sched... So simple. Something that would require a job queue and a job runner fades away into a piece of the OTP application tree. When it crashes, it will even come right b…

Wait, how does that answer prevent only one instance of the job across the whole system? That's what I'd use Redis or something for - for locking.

Re: Lovely Week with Elixir

#47
post #29

I learned Elixir a few weeks ago as a quarantine self-improvement project and pretty much loved it. There are some warts, as in any language. As someone who's primarily worked in Go and Java in the past and has also been learning Rust I don't super love the optional typing thing, and I end up missing higher-level data constructs like interfaces and traits. But there are some great language features, like guards and p…

> I don't super love the optional typing thing It might not be a plus if you're writing a web-app, or some other kind of easily-restarted "shared-nothing business layer" system. But get deep-enough into absorbing the Zen of Erlang (i.e. by trying to write a big-deal telecom system; or by working on a distributable Erlang DBMS like CouchDB), and you'll come to appreciate it. Specifically, you'll realize that it'd actu…

That’s all true, but I think a Typescript-like system would work really well here. Typescript is very tolerant of the data being different than the type definition, and it doesn’t know or care if your data actually matches the type definition at runtime.

It would be up to the developer to account for different versions of the data when writing out type definitions, and the worst case is that you try to access a property that doesn’t exist or is the wrong type, and it crashes and causes the process to get restarted like what already happens in Erlang.

So it wouldn’t be a guarantee of correctness just like Typescript isn’t, but it could still offer a lot of safety assuming you get the type definition a right.

Re: Lovely Week with Elixir

#48

I learned Elixir a few weeks ago as a quarantine self-improvement project and pretty much loved it. There are some warts, as in any language. As someone who's primarily worked in Go and Java in the past and has also been learning Rust I don't super love the optional typing thing, and I end up missing higher-level data constructs like interfaces and traits. But there are some great language features, like guards and p…

You’ve just summarized my thoughts on Elixir after using it(and still loving it) for years. Thanks :)

Re: Lovely Week with Elixir

#49

Elixir is decent and I've worked with it a fair amount in production systems... Mostly Rubyists seem to really click with it. And ruby idioms are all over it - you can taste its history and proximity to ruby's ecosystem. As a scala dev that ended up working with elixir for a couple years, my opinion is that a typesafe elixir-like language would really bring BEAM back into the mainstream. Akka is alright but it's shoe…

I want to echo Gleam [0] as a project to watch out for. It's still very early, but it's evolving quickly, and has a big focus on providing ergonomic tooling. It's an ML inspired, statically typed language that compiles down to Erlang, and supports interop with the existing ecosystem. This means that you get access to ADTs, type inference, etc, while still being able to lean on OTP for your concurrency primitives. The…

I’m rooting for Gleam as well. I do wish it adopted the syntax styling of Ruby/Elixir/Crystal though. Either way, it is very compelling.

Re: Lovely Week with Elixir

#50

I learned Elixir a few weeks ago as a quarantine self-improvement project and pretty much loved it. There are some warts, as in any language. As someone who's primarily worked in Go and Java in the past and has also been learning Rust I don't super love the optional typing thing, and I end up missing higher-level data constructs like interfaces and traits. But there are some great language features, like guards and p…

Check out the Elixir "protocol" feature, it's similar to interfaces: https://elixir-lang.org/getting-started/protocols.html

I've used protocols, and they are useful as a kind of bare minimum interface/implementation abstraction. But they're nowhere even close to something like Rust traits. Which is totally fine given Elixir's goals.
Post reply on HN