Live data from Hacker News

Gleam is my new obsession

ericcodes.io

21–28 of 28 posts

Re: Gleam is my new obsession

#21

There is this recent trend of languages enforcing 2 space indentation and disallowing any ability to override. 2 space indentation makes determining block nesting hard for many (maybe most?) people, including me. My understanding is that the trend started as a way to skirt line length limitations in Python. I think it’s one of the dumbest trends in programming languages. Please stop.

This is why tabs are better IF indentation is forced (luke in Go, with gofmt).

Re: Gleam is my new obsession

#23
post #3

Gleam is really interesting to me, because it's built on top of the BEAM runtime, but as far as I can tell, it does very little with the actor model that is the star attraction of BEAM/Erlang. There's a (non-built-in?) package that exposes some of the OTP and concurrency tools available, but it doesn't look widely used or recommended on the website. The linked recommends a talk that I hadn't seen before (and unfortun…

Because Gleam compiles to Erlang, it can seamlessly integrate with the larger BEAM ecosystem, including existing Erlang and Elixir OTP applications and libraries.

@external decorator: This escape hatch allows Gleam code to call functions defined in Erlang or Elixir modules. While it bypasses Gleam's type checks for the function call, it provides a powerful way to leverage the full capabilities of the existing OTP ecosystem.

I believe the biggest reason it's hard to replicate OTP fully and quickly is Gleam's type system (but I could be wrong).

Re: Gleam is my new obsession

#25
post #3

Gleam is really interesting to me, because it's built on top of the BEAM runtime, but as far as I can tell, it does very little with the actor model that is the star attraction of BEAM/Erlang. There's a (non-built-in?) package that exposes some of the OTP and concurrency tools available, but it doesn't look widely used or recommended on the website. The linked recommends a talk that I hadn't seen before (and unfortun…

The OTP package is not built-in because that would prevent Gleam being compiled to other targets, namely Javascript. This is a big draw for the language, and it's worth pulling out BEAM-specific stuff into packages for this reason.

I think Louis and the Gleam community are very serious about supporting OTP, but there are still open research questions around typing parts of OTP.

The parts of OTP that Gleam supports are still very useful, compatible with Erlang/Elixir, and very much used. And they have the benefit of being statically typed [1].

There's no embarrasement about Gleam's primary runtime being the BEAM, it's right there on the front page, above the fold! [2]

[1] https://github.com/bcpeinhardt/learn_otp_with_gleam [2] https://gleam.run/

Re: Gleam is my new obsession

#27

There is this recent trend of languages enforcing 2 space indentation and disallowing any ability to override. 2 space indentation makes determining block nesting hard for many (maybe most?) people, including me. My understanding is that the trend started as a way to skirt line length limitations in Python. I think it’s one of the dumbest trends in programming languages. Please stop.

Maybe you could just use tabs and save and read them as 2 spaces but display as 4.

I think Idea IDEs have that flexibility... Not sure.

Re: Gleam is my new obsession

#28
post #19

> I'd often joke, "I love Rust, but what I really want is a simpler Haskell with a C-like syntax" or "I love Rust, but if it had a garbage collector, Rust would be my perfect language". OCaml is a simpler Haskell, but I don't think it has a C-like syntax. However, rescript[0], the JavaScript like syntax for OCaml based Hindley Milner typed language might actually fit well for small and personal projects. [0] https://…

Reason ( https://reasonml.github.io/ ) is the JS like syntax for OCaml. ReScript is a fork that explicitly removes the connection to OCaml and focuses on JavaScript output.

yes, correct, but ReasonML is abandoned, while there is still some traction in Rescript and it offers the same type safety.
Post reply on HN