Remix.run Logo
asib 10 days ago

Do you like Rust or do you like Erlang? Writing Gleam is like writing Rust, writing Elixir is like writing Erlang.

I don't know the current state of Gleam OTP, but last I checked it wasn't great.

If you don't care about either of those things and only about types, use Gleam. But then why not just use Rust?

lpil 9 days ago | parent | next [-]

Hi, I'm the lead maintainer of Gleam.

> I don't know the current state of Gleam OTP, but last I checked it wasn't great.

Gleam uses regular OTP, it doesn't have a distinct OTP framework separate from other BEAM languages.

asib 8 days ago | parent [-]

Right, I meant the libraries. I haven't used Gleam for a couple years at least though, so my opinions might be very outdated on this.

shevy-java 10 days ago | parent | prev | next [-]

> writing Elixir is like writing Erlang

I wrote both Elixir and Erlang code. Erlang is just useless to me as a programming language; it has many great ideas though. I love the idea of being able to think in terms of immortal, re-usable, safe objects (Erlang does not call these objects, but to me this is OOP by Alan Kay's definition. I don't use e. g. the java definition for OOP.)

Elixir built on that and made Erlang code optional, meaning people could write more pleasent code. And here it succeeded. I am not sure why Elixir succumbed to type madness now, but the comment that "writing Elixir is like writing Erlang", is just simply not true.

Elixir is significantly better than Erlang with regard to writing code. José Valim got inspiration for Elixir from ruby, to some extent.

asib 9 days ago | parent | next [-]

You're taking my comment way too literally. I'm basically just making a syntax comparison. Obviously Rust is not at all like Gleam in many ways either. It's just statically typed and has a similar syntax.

senderista 9 days ago | parent | prev | next [-]

I agree that actor languages are the purest form of OOP as Alan Kay has expressed it. And unlike Smalltalk, Erlang just accepts that some things are naturally functions, not messages.

klibertp 9 days ago | parent | next [-]

Smalltalk has no problem at all with accepting that some things are naturally functions: it has always had blocks! The call operator is `value`, not `()`, but it's the same "apply a piece of code to some values" operation.

Rendello 9 days ago | parent | prev [-]

Erlang's Joe Armstrong and Alan Kay did a talk/interview together:

https://www.youtube.com/watch?v=fhOHn9TClXY

ken-kost 8 days ago | parent [-]

a great rabbit hole to fall into; thank you!

satvikpendem 9 days ago | parent | prev [-]

Why do you find Erlang useless, you just don't like the syntax?

satvikpendem 10 days ago | parent | prev | next [-]

Your last sentence is basically where I'm at, writing my backends in Rust these days. I'm interested in the BEAM promise of letting things crash but not sure how good that is in Gleam due to its OTP still being somewhat immature as the devs are rewriting GenServer as a typed library.

lpil 9 days ago | parent [-]

Hello! I'm the maintainer of Gleam. We are not rewriting OTP, regular OTP is used in Gleam. Most commonly the typed Gleam APIs for OTP are used, but you can use the untyped Erlang APIs if you wish.

This is the same as in Elixir, where macro-enabled APIs are offered, and they just wrap the regular Erlang APIs.

michaelcampbell 9 days ago | parent | prev [-]

> But then why not just use Rust?

The BEAM?