HN user

giacomocava

62 karma
Posts6
Comments22
View on HN
Gleam v1.12 12 months ago

Omg yes, pattern matching is such an amazing feature I miss it dearly in languages that don't have it!

Implementing the decision tree optimisation was such a rewarding process, worth every minute I spent head scratching!

the language server (which is included within the gleam binary) now provides the "find references" feature

This was my #1 most wanted feature, I’m so grateful to Surya for implementing it, he’s amazing!!

Gleam v1.9 1 year ago

print debugging is the best debugging <3 Thank you for the kind comment!!

Gleam v1.9 1 year ago

The language server has been improving at such a fast pace it's hard to keep up! Soon I'll be out of code actions to implement

Gleam v1.9 1 year ago

All the pain to get echo working was 100% worth it! What a great release

Gleam Is Pragmatic 2 years ago

Could you say something about the cases where you did need to write Erlang code?

Sure! For one of my most used packages (https://github.com/giacomocavalieri/birdie) I needed to get the terminal width to display a nice output, that has to be implemented using FFI based on the specific runtime (erlang or js) so I had to write it in Erlang, that was just a couple of lines of code.

But now there's a Gleam package to do it, so if I were to rewrite it today I wouldn't even need to write Erlang for that and could just use that!

What kind of cases?

Usually it is when you need some functionality that has to rely on specific things from the runtime (like IO operations, actors on the BEAM, async on the JS target, ...) and there's no package to do it already. Most of the common things (like file system operations and such) are already covered

Were you already proficient in Erlang and its ecosystem?

Not at all :) I knew very little about Erlang (basically nothing behind the syntax), Gleam was my introduction to the BEAM ecosystem and it has worked out great so far!

Hope this is helpful, happy to share my experience here

Gleam Is Pragmatic 2 years ago

Yeah FP can for sure take some getting used to before it clicks! I think a great resource for that is Gleam's Exercism track (https://exercism.org/tracks/gleam), not only will it teach you the language but by starting with small-ish exercises it can definitely help grokking FP concepts

And if you feel like you're stuck and need help Gleam's Discord is a great place to ask questions :)

Gleam Is Pragmatic 2 years ago

Pure Gleam will get you really far without having to touch any Erlang, I've done Gleam for almost a year now and there were very little cases where I needed to write Erlang code myself, usually there's already a library that deals with it for most common needs :)

That's a great point! Yeah using `Option`, or the newly introduced records is a great help in sticking to the best practices, you're totally right! The problem lies in the fact that it's not the only way to write Java code, you might stick to it but you're not guaranteed that other libraries and projects will use the same practices; that's why I think it's crucial to make those the _only possible way_ to write code. Thanks for reading the article!! :)