tacitusarc 4 hours ago

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.

  • itsn0tm3 3 hours ago

    I have to fully agree. They have a discussion on their GitHub [0] about tabs/identation stating that the design goal is to have a non-configurable formatter.

    I get the idea behind having a streamlined formatting style, but I’m really not a fan of denying users the flexibility to adjust it to their needs. Consistency across projects is nice, yet forcing everyone into a single indentation style feels unnecessarily rigid. A little configurability would go a long way :)

    [0] https://github.com/gleam-lang/gleam/discussions/3633

MrJohz 13 hours ago

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 unfortunately can't watch right now on my phone!) but other than that there seems to be very sparse documentation available. Searching for "gleam OTP" mainly seems to produce a myriad of alternative OTP implementations and not much in the way of explanations or examples of common patterns or anything like that.

Some of this is obviously going to be the newness of Gleam, but I remember when Elixir was still brand new, and the OTP integration was one of the biggest selling points there, and a big part of their documentation and the ecosystem in general. Whereas with gleam, it almost seems like they're embarrassed of the runtime's distributed heritage? Whereas to me it seems like the OTP and the actors model in general would be the biggest selling point for a language like this.

Does anyone have any insight into why this is, or what concurrency practically feels like in gleam?

  • worthless-trash 7 hours ago

    From my understanding distributed (cross machine) typed message passing is hard.

    • MrJohz an hour ago

      Doesn't Erlang/Elixir solve this by having every function do its own parsing (via pattern matching) and then failing fast if something goes wrong? That seems intuitively like a good approach to take — you can't make any real guarantees across machine boundaries, but you can use structural typing at the edges to ensure that the data coming across the boundaries has the right shape.

hoppp 13 hours ago

Okay, you convinced me. I will try it. It seems like something I would really enjoy.

I like rust but it takes too long to write. Go is usually my go to language because its simple I adore erlang and can write some elixir but I also dislike dynamic typing.

I have been looking at gleam for a while and I think now you inspired me to create a small project to learn more about it.

bsder 12 hours ago

Once you throw out the BEAM and OTP, why not OCaml?

Seriously, I find the OCaml syntax way less obtuse than, for example, all the trait and macro idioms that I have to chop through with Rust. Sure, Rust has braces, but that doesn't make its syntax easy by any means.

Nevertheless, I am happy to see this Cambrian Explosion of programming languages. Eventually, we may get a good one.

  • hoppp 11 hours ago

    OCaml is a good one but many find it too hard. It can be a bit alien and there are not enough jobs to justify learning it for work.

  • batisteo 10 hours ago

    As a note, before being bootstraped, Rust was written in OCaml iirc