Live data from Hacker News

I tried Gleam for Advent of Code

blog.tymscar.com

221–223 of 223 posts

Re: I tried Gleam for Advent of Code

#221
post #60

Gleam is really quite a nice language. I did AoC in it this year as well and came away with the following: (incomplete list for both positive and negative, these are mainly things that come to mind immediately) Positive: - It can be pretty performant if you do it right. For example, with some thought I got many days down to double digit microseconds. That said, you do need to be careful how you write it and many patt…

> - It can be pretty performant if you do it right. For example, with some thought I got many days down to double digit microseconds. Was this the time of everything or just the time of your code after loading in the text file etc.? The hello world starter takes around 110 ms to run on my PC via the script generated with `gleam export erlang-shipment` and 190 ms with `gleam run`. Is there a way to make this faster, o…

The time reported by the "gladvent" package when running with the "--timed" option. AFAICT that does not count compilation (if needed), VM startup time, any JITting happening, or reading in the text file. I'm fine with that tbh, I'm more interested in the time actually spent solving the problem. For other languages I wouldn't count language-specific time like compilation time either.

As to whether you can make startup time faster, I suppose you could keep a BEAM running at all times and have your CLI tools hotswap in some code, run it, and get the results back out or something. That way you can skip VM startup time. Since the BEAM is targeted more at very long-running (server) processes with heaps and heaps of concurrency, I don't think ultrafast startup time is really a focus of it.

Re: I tried Gleam for Advent of Code

#222
I haven't explored the BEAM ecosystem much. And this post actually got me motivated enough to try it out.

The more programming languages we play with, the better we become as engineers. We learn the different design decisions that go into each language. And we learn the language of Computer Science itself.

Plus, Advent of Code!

So I finally got everything installed. But then I realized there are no easily accessible offline docs. I don't have Internet service at home. So I have to grab service when I can make it out.

So it looks like mix can download offline hexdocs, but I don't have elixir installed. And there's a hexdocs_offline dev package for Gleam. But it errors out on "gleam/dynamic does not have a 'from' value.

Maybe it's a "teaching moment" about the basics of the language. But I have to run out to another appointment now, so these teaching moments don't always help.

Anyways, I guess I'll dive in after the holidays and just wget the tour or get some well regarded projects for reference. I'm actually still really excited with all the functional features.

Re: I tried Gleam for Advent of Code

#223

I haven't explored the BEAM ecosystem much. And this post actually got me motivated enough to try it out. The more programming languages we play with, the better we become as engineers. We learn the different design decisions that go into each language. And we learn the language of Computer Science itself. Plus, Advent of Code! So I finally got everything installed. But then I realized there are no easily accessible…

Honestly it’s very much worth it! Look into this https://hexdocs.pm/hexdocs_offline/index.html
Post reply on HN