Gleam, a statically typed language for the Erlang VM

It’s a rebar3 application so it is run either from the Erlang shell or by creating a release. Documentation on this will come soon, it is still early days. :slight_smile:

1 Like

We opted to go with the most common pattern used for this feature rather than the less common Erlang approach. In practice they are very similar.

Thanks for the note about the typo, it has been collected on master.

If you are more familiar with writing Elixir apps vs Erlang/rebar3 I found this to be a good writeup integrating Gleam modules into your Elixir app: https://dev.to/contact-stack/mixing-gleam-elixir-3fe3

Following this you can install Gleam easily using asdf then get to Gleam Hello World in a few minutes.

1 Like

Working on a small Gleam configuration library that uses TOML! https://github.com/mpope9/config

My aim is to replace parts written in Erlang with Gleam as things develop.
It uses persistent_terms over ets, which has benefits and drawbacks.

1 Like

Excellent - that’s amazing. It worked perfectly. I even got completion hints of the new Gleam function from VS Code as I worked:

4 Likes

@lpil I’m interested to play around with Gleam more. My current BEAM experience is via Elixir, Phoenix & Ecto. I don’t have a lot of intricate business logic in my app so most lines of code are either in a Phoenix controller or interacting with an Ecto schema.

I’m not sure I can easily declare a Gleam module that could work as a Phoenix module and I’m not sure if I should go about wrapping my Ecto schemas so I’m not sure where to start integrating Gleam.

I realise it is early days for Gleam and there totally doesn’t have to be an answer for any of this yet. I’m curious though where your thoughts are at. Are you interested in the community exploring close interop with Ecto & Phoenix & Plug or would you much rather leave that and explore full Gleam solutions for web frameworks and database interactions?

2 Likes

Ecto and Phoenix very macro based, so we will never be able to make full use of them from Gleam, Erlang, or any other non-Elixir language.

Likely you would get the best experience from using Gleam modules as libraries in a way similar you might use Erlang modules.

Are you interested in the community exploring close interop with Ecto & Phoenix & Plug or would you much rather leave that and explore full Gleam solutions for web frameworks and database interactions?

We will never be able to have close interop with these Elixir projects as they are only designed with Elixir in mind and (quite rightly) make full use of Elixir features that cannot be used from other languages.

We will likely have a much better story for common Erlang libraries as they typically are easier to use from other BEAM languages.

2 Likes

Thanks for the information. Makes sense! Interesting that the macro-heavy nature of Elixir makes it harder to interact with. Understandable though. Unfortunately I’ve got no experience with Erlang at the moment but maybe one day :slight_smile:

1 Like

A quick question about the changelog:

  • Tuples can be indexed into using the var.1 syntax.

Are tuples in gleam 0-indexed (like Elixir) or 1-indexed (like Erlang)?

1 Like

They are 0 indexed like Elixir. :slight_smile:

4 Likes

Gleam v0.8 is here! :partying_face:

It’s quite a large one this time! Please see this post for more information: https://lpil.uk/blog/gleam-v0.8-released/

Thanks all!

14 Likes

Great stuff. :whale:

I particularly like the new documentation. Is how to add docs to a project documented anywhere?

1 Like

This is next up on my to-do list! Further documentation on how to use projects is needed for sure.

2 Likes

I noticed that the spectrum chat is no longer being used. Did you guys move somewhere?

We had problems with Spectrum so we have returned to IRC. You can find us in #gleam-lang on Freenode. https://webchat.freenode.net/#gleam-lang

1 Like

If you’re still looking for a more persistent home, I think our new community platform could actually be a really nice fit for you - I’ll send you some info when I get five mins :003:

4 Likes

That would be very interesting! Thanks

3 Likes

Hello everyone! There has been some discussion on whether we should add an Option type to Gleam.

If you have any thoughts please leave them here: https://github.com/gleam-lang/gleam/issues/591

I’m keen to get an idea of what the community thinks! Thank you!

4 Likes

I agree with you on syntax, AstonJ. I started out with C and C++ and then did Python for a long time. I’ve also programmed professionally in Perl, COBOL, Pascal, JavaScript, Haskell, Java, C#, TypeScript, Scala, Go, and Swift, so I’ve seen a lot of different styles of syntax. For me, Ruby and Elixir are the most readable and fit into my brain the best.

I’m not criticizing Gleam’s choice of syntax. I’m just saying that, in my opinion, there is more to syntax than familiarity. I’m probably most familiar with bracket-heavy languages but my brain likes that syntax the very least.

2 Likes

I think this can happen for anyone with any set of syntaxes, so there’s no cost best syntax.

For example, I’ve written code in 30+ languages, I’m most familiar with Elixir style syntax, but it’s far from my favourite.

1 Like