Live data from Hacker News

I tried Gleam for Advent of Code

blog.tymscar.com

211–220 of 223 posts

Re: I tried Gleam for Advent of Code

#211
post #90
post #41

Earlier quoted context omitted.

I recently used Gleam + Lustre for a small app that I normally would have built with Elm + PostgREST. It went very well, and I'm now planning to use it for a larger rewrite (of a rails app).

I've considered playing around with it. Every now and then I tell myself I'm gonna learn front end dev, but as soon as I start looking at it (FE in general not Lustre specifically) I get depressed and give up lol

I far prefer it to javascript or typescript. I recommend using a coding agent to help you learn it (claude code, gemini cli, codex) if you're interested. Pick a smallish project, prompt your way through it, examining to structure and code as you go, asking the agent to explain anything you don't understand.

Probably the most underrated aspect of this new AI age is having a tutor with encyclopedic knowledge available at all times.

* To be clear, I'm not saying to "Vibe Code" it. Take the time to really understand the code, ask questions, and eventually suggest improvements.

Re: I tried Gleam for Advent of Code

#212
post #211
post #90

Earlier quoted context omitted.

I've considered playing around with it. Every now and then I tell myself I'm gonna learn front end dev, but as soon as I start looking at it (FE in general not Lustre specifically) I get depressed and give up lol

I far prefer it to javascript or typescript. I recommend using a coding agent to help you learn it (claude code, gemini cli, codex) if you're interested. Pick a smallish project, prompt your way through it, examining to structure and code as you go, asking the agent to explain anything you don't understand. Probably the most underrated aspect of this new AI age is having a tutor with encyclopedic knowledge available…

I'm confident I can learn it, but the whole ecosystem drives me nuts. It's always a bunch of shit spread across a ton of small file, at least three different "languages" between JavaScript, HTML, and CSS, frameworks or other languages compiled to JavaScript on top of that. Plus the behavior of web browser and trying to wrangle that nonsense.

No disrespect to FE devs. Pretty much all software development is one type of mess or another. But backend and terminals are the kind of mess that make sense to me.

Also, agree that LLMs are actually great for learning if you use them carefully.

Re: I tried Gleam for Advent of Code

#213
post #211

Earlier quoted context omitted.

I far prefer it to javascript or typescript. I recommend using a coding agent to help you learn it (claude code, gemini cli, codex) if you're interested. Pick a smallish project, prompt your way through it, examining to structure and code as you go, asking the agent to explain anything you don't understand. Probably the most underrated aspect of this new AI age is having a tutor with encyclopedic knowledge available…

I'm confident I can learn it, but the whole ecosystem drives me nuts. It's always a bunch of shit spread across a ton of small file, at least three different "languages" between JavaScript, HTML, and CSS, frameworks or other languages compiled to JavaScript on top of that. Plus the behavior of web browser and trying to wrangle that nonsense. No disrespect to FE devs. Pretty much all software development is one type o…

> No disrespect to FE devs. Pretty much all software development is one type of mess or another. But backend and terminals are the kind of mess that make sense to me.

This is part of the appeal of Lustre and Elm to me. Not the main thing, but being able to avoid JS land churn (and nulls) is quite nice.

Re: I tried Gleam for Advent of Code

#214
post #209

Earlier quoted context omitted.

You guys always find a way to say "you can be an LLM maximalist too, you just skipped a step." The bigger story here is not that they forgot to tell the LLM to run tests, it's that agentic use has been so normalized and overhyped that an entire PR was attempted without any QA. Even if you're personally against this, this is how most people talk about agents online. You don't always have the privilege of working on a…

I am not saying you should be a LLM maximalist at all. I am just saying LLMs need to have a change-test cycle, like humans, in order to be effective. But looks like your goal is not really to be effective at using LLMs, but to bitch about it on the internet.

> But looks like your goal is not really to be effective at using LLMs, but to bitch about it on the internet

Listen, you can engage with the comment or ignore everything but the first sentence and throw out personal insults. If you don't want to sound like a shill, don't write like one.

When you're telling people the problem is the LLM did not have tests, you're saying "Yeah I know you caught it spitting out random unrelated crap, but if you just let it verify if it was crap or not, maybe it would get it right after a dozen tries." Does that not seem like a horribly ineffectual way to output code? Maybe that's how some people write code, but I evaluate myself with tests to see if I accidentally broke something elsewhere. Not because I have no idea what I'm even writing to begin with.

You wrote

> Without that they cannot know if what they did works, and they are a bit like humans

They are exactly not like humans this way. LLMs break code by not writing valid code to begin with. Humans break code by forgetting an obscure business rule they heard about 6 months ago. People work on very successful projects without tests all the time. It's not my preference, but tests are non-exhaustive and no replacement for a human that knows what they're doing. And the tests are meaningless without that human writing them.

So your response to that comment, pushing them further down the path of agentic code doing everything for them, smacks of maximalism, yes.

Re: I tried Gleam for Advent of Code

#215

Earlier quoted context omitted.

I use many of the otp functions in gleam on thr regular, what functionality cant i call? Gleam can call any erlang function, and can somewhat handle the idc types. [ im sure it has another name ]. Did i miss something that gleam fails on, because this is one of my concerns.

- No state machine behaviours. Gleam cannot do gen_statem. - Limited OTP system messages. Gleam doesn't yet support all OTP system messages, so some OTP debugging messages are discarded by Gleam. - Gleam doesn't have an equivalent of gen_event to handle event handlers. - Gleam doesn't support DynamicSupervisor or the :simple_one_for_one for dynamically starting children at runtime.

I didn't know about the statem limitation, I have howerver worked around it with gen server like wrapper, that way all state transitions were handled with gleams type system.

I have been meaning to ask about that on the discord but its one of the ten thousand things on my backlog.

Maybe i could write a gen_event equivalent.. I have some code which does very similar things.

Thank you for taking the time to respond.

Re: I tried Gleam for Advent of Code

#216

Earlier quoted context omitted.

- No state machine behaviours. Gleam cannot do gen_statem. - Limited OTP system messages. Gleam doesn't yet support all OTP system messages, so some OTP debugging messages are discarded by Gleam. - Gleam doesn't have an equivalent of gen_event to handle event handlers. - Gleam doesn't support DynamicSupervisor or the :simple_one_for_one for dynamically starting children at runtime.

I didn't know about the statem limitation, I have howerver worked around it with gen server like wrapper, that way all state transitions were handled with gleams type system. I have been meaning to ask about that on the discord but its one of the ten thousand things on my backlog. Maybe i could write a gen_event equivalent.. I have some code which does very similar things. Thank you for taking the time to respond.

You're welcome.

I'm sure at some point, Gleam will figure it all out.

Re: I tried Gleam for Advent of Code

#217
post #33

Earlier quoted context omitted.

Why does it need generics? There's a great blog post about how you can replace a lot of trait behaviour with just functions. Maybe something like that can be done for generics

the comment is wrong, what Gleam lacks is interfaces. Which feels super strange, but doesn't seem to really be a problem, e.g. imagine a language where you'd write fun sum_all_numbers(Iterable it) { it.fold(...) } # an interface sum_all_numbers(a_list) # a list implements iterable Gleam wants you to write fun sum_all_numbers(Iterator it) { it.fold(...) } # a concrete type sum_all_numbers(a_list.iterator) # get the ca…

Yes this is the article I was referring to. Gleam does not need interfaces or traits because functions can do it

Re: I tried Gleam for Advent of Code

#218
post #156

Earlier quoted context omitted.

> And I can't believe there's still people defending Elm's lack of development Why? (I'm one such person defending Elm's lack of development)

From the outside the project honestly does look kind of dead, what's your take on the development and community?

The project is kind of dead but the community is alive!

Re: I tried Gleam for Advent of Code

#220
post #209

Earlier quoted context omitted.

I am not saying you should be a LLM maximalist at all. I am just saying LLMs need to have a change-test cycle, like humans, in order to be effective. But looks like your goal is not really to be effective at using LLMs, but to bitch about it on the internet.

> But looks like your goal is not really to be effective at using LLMs, but to bitch about it on the internet Listen, you can engage with the comment or ignore everything but the first sentence and throw out personal insults. If you don't want to sound like a shill, don't write like one. When you're telling people the problem is the LLM did not have tests, you're saying "Yeah I know you caught it spitting out random…

You need to seek medical help. LLM is not your enemy. I am not your enemy. The world is not against you.
Post reply on HN