Try Gleam
Posted by nchagnet 12 hours ago
Comments
Comment by subarctic 10 hours ago
Overall, I recommend it.
Comment by doomspork 10 hours ago
Comment by whalesalad 5 hours ago
Perfect example: Clojure. Clojure is the textbook esoteric programmers dream... but it's SUPER easy to sell and integrate in a typical Java shop. Why? Clojure is Java. You can use everything on Maven. You can interop with any Java tooling. No hacks or BS required... it's a native compatibility. The fact that the Gleam did not opt for this level of congruence is mind boggling to me.
I could be wrong btw so please correct me if I am. I am genuinely interested in using Gleam in place of Elixir (I think they nailed syntax and got rid of a lot of bullshit) but it is unfortunately not a drop-in replacement. It should be.
Comment by jjtheblunt 2 hours ago
https://gleam.run/frequently-asked-questions/#Can-I-use-Elix...
Comment by mono442 10 hours ago
Comment by benzible 5 hours ago
Comment by sczi 4 hours ago
A much more recent and imo more realistic comparison of different languages with ai, is openai's study reimplementing sqlite in different languages: https://openai.com/index/low-resource-programming-languages/
That showed about what we expect, that popular languages like python, javascript, java, C#, etc do best, while less popular languages like Common Lisp, Ocaml, Zig, etc do slightly worse. But the difference is small enough I'd still just choose whatever language and ecosystem I know best that is appropriate for a project.
Comment by yladiz 2 hours ago
Comment by sczi 2 hours ago
But the aim of that experiment was measuring correctness of llm written code in different languages, so used sqlite as a benchmark considering it's fairly complex software with a comprehensive test suite. It is not suggesting that because a language scores better on that benchmark it'd be better suited to writing the next sqlite, due to obvious other factors like performance...
Comment by lpil 9 hours ago
Comment by tharmas 8 hours ago
Comment by giancarlostoro 6 hours ago
Comment by lpil 8 hours ago
Comment by jeremyjh 6 hours ago
Is there any research that supports what you are saying here? I agree it mostly works, but I’d expect more API hallucinations and test cycles at a minimum.
Comment by perrygeo 5 hours ago
Comment by ch4s3 6 hours ago
Comment by ModernMech 4 hours ago
The copious training data on mainstream languages doesn't really translate as a network effect, and therefore is kind of a red herring because the AI can use all that training on new languages as well. e.g. if you use a esoteric language that is vaguely object oriented, the AI will use its vast training on object oriented programs and apply it to your language instead of falling over because your language isn't Python and it doesn't have training data on it.
Moreover, the AI is trained on copious amounts of PL research, so it's not like the ideas in a new language are completely new to it.
Comment by nchagnet 12 hours ago
Comment by brightball 6 hours ago
https://carolina.codes/speakers/2024/dillon-mulroy
That site is also partially powered by Gleam on the backend.
Comment by adamddev1 11 hours ago
Missing currying feels a little to me like walking in FP land with one leg cut off.
Comment by kaoD 11 hours ago
IMO it is hard to read (unless you're very familiar with the functions at hand), produces type errors that are not easy to follow (oops, I forgot the last arg), and is too rigid (I often need to partially apply arguments in non left-to-right order).
I never understood why partial application via "slots" isn't more common though (I just made up the term, not sure if this has a name). Like Clojure's:
#(f %2 "foo" %1 "bar")
;; same as
(fn [a b] (f b "foo" a "bar"))
Does Gleam have something like that?Comment by nchagnet 11 hours ago
See the relevant docs: https://tour.gleam.run/everything/#functions-function-captur...
Comment by riffraff 3 hours ago
Seems more limiting than the closure way. Scala allows multiple _ but in turn that doesn't allow changing ordering.
TBH, I feel this stuff is not really worth it,
Comment by yladiz 3 hours ago
Comment by senderista 5 hours ago
Comment by stiiv 10 hours ago
Plenty of practical reasons for currying, but the biggest (imo) is for use with the pipe operator.
If they don't have partial application now, what are the odds they'll have it in the future?
Comment by nchagnet 10 hours ago
Comment by senderista 5 hours ago
Comment by adamddev1 3 hours ago
Comment by stiiv 10 hours ago
F# showed a lot of promise with Fable, but the community never quite got the tooling right, I think for a lack of energy/funding.
Comment by nchagnet 10 hours ago
There are a few rough patches too. For example, I have yet to find out how to run a single test and not the whole suite.
Comment by Kinrany 5 hours ago
Comment by barddoo 10 hours ago
Comment by micbas 11 hours ago
Comment by profunctor 11 hours ago
Comment by pjmlp 11 hours ago
Comment by wakamoleguy 11 hours ago
Comment by profunctor 10 hours ago
Comment by creata 2 hours ago
But, high level languages don't really lose precision in any way that matters (except when you need extreme performance, resistance to timing attacks, or niche stuff like that). Natural language on the other hand loses precision that's usually important, so I don't see how your comparison is valid.
Comment by spider-mario 11 hours ago
Comment by pjmlp 11 hours ago
Comment by spider-mario 10 hours ago
Comment by chroma_zone 1 hour ago
Comment by Topfi 10 hours ago
Heck, OpenAI can't even get their models to reliably do what they intend, so yeah.
Comment by pjmlp 10 hours ago
Comment by Topfi 10 hours ago
Comment by pjmlp 10 hours ago
If you don't get the difference, I get there isn't much that you know about how instruction selection works, across all those approaches.
Comment by Topfi 10 hours ago
Do any of the optimizations you mentioned affect the underlying behavior of the run code? Semantics...
If not, it doesn't fit to LLM use, where this is very much the case. We can talk about bugs in compilers and undefined behaviours and so on and so forth all the livelong day, but you know as well as I that this is not of the same scope of impact.
I could and in the past would have written a long diatribe about how pure compilation to assembly is deterministic, thus making this not really suitable and that while yes, there are things like JVM that aren't 100%, we have contracts, docs, specs and, because of them, an expectation of consistency that LLMs do not deliver. I did not because I thought that was not necessary, but see my error now, that is my mistake.
Comment by pjmlp 10 hours ago
Which for example, unless you can exactly replicate the world every single time a PGO data gathering session is done, there are no guarantees that the compiler will generate exactly the same machine code pattern, when given various PGO files generated at different occurrences.
Comment by Gualdrapo 11 hours ago
https://static0.cbrimages.com/wordpress/wp-content/uploads/2...
Comment by jimbokun 1 hour ago
Comment by logophobia 11 hours ago
I've seen even the best models try to build & debug parallel and distributed systems. The results are always a bit uneven at best, even with a good harness and a lot of guidance.
The disadvantage of niche languages is that the LLM won't quite know the language as well due to less training data being available. But if you actually need to build something distributed, then this might be a good trade-off.
Comment by wakamoleguy 11 hours ago
Gleam also runs on BEAM, which has important runtime characteristics vs other languages. That will impact your system and how it scales even if you never look at the code.
Comment by WJW 11 hours ago
Comment by jeremyjh 5 hours ago
Comment by nchagnet 11 hours ago
Moreover, to me coding carefully is still a hobby, a pleasure, a craft. Gleam is exactly the kind of language that makes this such a pleasant activity.
Comment by benrutter 11 hours ago
1. In a lot of cases, even if you're pure vibecoding and not reviewing any code, its still useful to be able to read it - you can then verify and reason about various aspects. LLMs are often flat out wrong on niche issues of performance etc, so for cases like this, not being able to read code is a big risk.
2. "Languages optimized for LLMs" sounds awesome, but so far, to me at least, it seems like LLMs work best in the same situations as humans- good test coverage, low-complexity, clean architecture, etc.
Comment by OtomotO 11 hours ago
Because, we do?
You may not, which is fine. A lot of developers may not... that's fine. I guess you're all employed and don't risk your livelihood when things go wrong.
I do though. I take responsibility.
And just like with any junior developer I guide AI and I do review what it creates in the project that matter. (Personal tools I've entirely vibe-coded, never any client projects though)
Comment by Topfi 11 hours ago
On the "languages for LLMs front", isn't that a bit "cart-before-horse"? Doubt we are anywhere near the limit of what a model could do with a static verifiable language, even more so since stuff like TS has massive training data, any new language wouldn't benefit in such a way.
Add to that, I'd rather be able to understand the output, partly for aforementioned reasons, partly because we have seen with post Spud GPT reasoning/summarisation issues what happens when being able to read model output becomes even slightly harder. Having model-focused languages would only exacerbate such issues.
Also, absolutely not a Maths expert so take this for an utter layman regurgitating of what I have read, but apparently the Lean proofs by OpenAI are very hard to parse even for the experts in the field, lovingly called "Clanker Proofs", even when they are valid.
Having not just correctness but also human understanding as a goal has merit, so there is that to consider too. Rather models get more efficient at using what we have (and can understand+maintain as humans if need be) then make it more opaque.
Comment by hmokiguess 11 hours ago
Comment by voidUpdate 10 hours ago
Comment by 15155 10 hours ago
Comment by wannabe44 5 hours ago
Comment by OtomotO 11 hours ago
And a third group couldn't care less either way.
I have a few decades on my back, I am a father, a husband, a nerd... I once was young too, believe it or not, and I had ideals and I fought for them.
If you don't participate in this, why does it bother you? Unless they are active around your doorstep, that is.
Comment by hmokiguess 11 hours ago
That could be repaired, just don't care enough to spend time there again I guess.
Comment by nchagnet 11 hours ago
Comment by bel8 11 hours ago
Suggestions about cool projects are just as important as warnings about uncool projects.
Comment by OtomotO 9 hours ago
Same as art by Hitler... if I would like it, I would like it, doesn't matter that I think he was one of the worst human beings.
So: I just argued, that there is a third way to view it.
You may, of course, see it completely differently and deem this project "uncool" for whatever reasons you want!
Comment by nchagnet 11 hours ago
Comment by hmokiguess 11 hours ago
Comment by jmcgough 10 hours ago
Comment by 15155 10 hours ago
You may not participate if you hold and espouse ideals contrary to theirs in unrelated spaces.
Comment by jmcgough 10 hours ago
It doesn't police peoples' personal beliefs outside the community. It only says that while participating in the community you agree not to harass people and try to contribute in a positive way.
I wonder if you have past experiences that are coloring your interpretation of this, because I'm really unsure where you're getting any of this from.
Comment by surgical_fire 10 hours ago
That said, their CoC does not block anyone from merely using the language.
Comment by jmcgough 9 hours ago
Comment by 15155 8 hours ago
You don't say? https://x.com/louispilfold
> "the maintainer is a legitimate communist. i will not be supporting this language"
What type of individual do you suppose attaches their identity to this type of quote?
Comment by ModernMech 3 hours ago
Comment by surgical_fire 9 hours ago
This is bullshit.
Typically we are talking about the same category of people that become Reddit mods. Those are full blown adults where internet drama and culture war nonsense is their actual hobby. The open source thing beneath it is the side project.
It's the reason why I avoid getting involved with open source communities like billionaires avoid taxes.
That said, my original point is not to avoid Gleam as a language. The language itself looks pretty interesting. You don't need to stare at the CoC to use the language.
Comment by omnimus 9 hours ago
Comment by surgical_fire 9 hours ago
Er... No?
I think I was clear that you can use the language without getting involved with the drama related to the community behind the codebase.
Comment by i80and 5 hours ago
Comment by spiderice 3 hours ago
Comment by ModernMech 3 hours ago
The reality of online spaces is, you can either make Nazis aware they're not welcome at the door, or you can let them know when they start making trouble. Either way, if you want to keep your online community copasetic, eventually you have to tell Nazis to fuck off.
Comment by surgical_fire 3 hours ago
What is interesting here is that most likely I am on the same side of the political aisle as the people there.
I still find that sort of talk insufferable. Gives me mid-2010s "woke" bullshit vibes (god the slang of my contemporaries is horrid).
Comment by jakelazaroff 1 hour ago
Comment by jimbokun 51 minutes ago
Comment by jimbokun 57 minutes ago
I didn’t see a link to it.
Comment by dsincl12 9 hours ago
Comment by nchagnet 11 hours ago
I have no problem with a community setting whatever acceptance criteria they like.
If the license did the same, I could see a case of being a bit of overzealousness.
I couldn't find if that was the issue, but if your problem is that the creator and the community have political opinions and don't like people with incompatible ones, then that's just society...
Comment by hmokiguess 10 hours ago
No, I am fine with incompatible views and I often seek them in order to grow. I do not enjoy echo chambers and I usually prefer and welcome disparate, including contrarian, opinions.
It's more like I don't want Ideology served with Programming Language, it feels like a distraction to me when I am in that mode. I usually consume Ideology under a different context, where I find it more productive and can contribute better to it.
Comment by nchagnet 10 hours ago
I find this whole thread here interesting because until today I wasn't confronted by any of this, even though I joined the Discord and had a pleasant time (and will keep doing).
So I guess all I have to say on this is I don't think the "ideology" is that much served with the programming language. Yes I read that there's a code of conduct and that annoyed some people. But like I downloaded Gleam, I coded with it, I talked to people, and the thought police didn't knock on my door. So I guess what I mean is that it feels a little overblown.
Comment by hmokiguess 10 hours ago
Once in a while I try to push my boundaries, but then again I like to choose where I do this. For this one, I prefer not to do it in a work adjacent environment with strangers on the internet.
That aside, the language sounds fun hope you create cool things with it!
Comment by 15155 10 hours ago
Their ideology is literally on the front page of https://gleam.run/
Comment by AnimalMuppet 10 hours ago
Whether that's good enough for you or not is up to you.
Comment by omnimus 9 hours ago
> "As a community, we want to be friendly too. People from around the world, of all backgrounds, genders, and experience levels are welcome and respected equally. See our community code of conduct for more. Black lives matter. Trans rights are human rights. No nazi bullsh*t. "
Comment by 15155 10 hours ago
Why are my political views relevant? This is a programming language. Nobody is popping into the Gleam issue tracker and mentioning politics, nobody is violating the "code of conduct" there.
The "code of conduct" exists solely to lambast people who disagree with the author's special interests in other irrelevant spaces. This is the "paradox of tolerance" in codified form.
Comment by nchagnet 10 hours ago
Comment by jakelazaroff 11 hours ago
Comment by MoOmer 10 hours ago
The counterarguments from the other party (seemed like one person with multiple accounts to me) were about their disbelief in trans people and the idea behind the Black Lives Matter movement (coupling it with some organization that copied the name and stole some donations)
Comment by nchagnet 11 hours ago
Comment by 15155 10 hours ago
If you don't support their special interests in completely unrelated venues, you are persona non grata and will either fall in line or be excommunicated. It's a sophisticated form of control via identity politics.
Comment by jmcgough 10 hours ago
Comment by 15155 10 hours ago
"Don't publicly disagree with my ideals or I will use my little fiefdom to destroy you."
Comment by jmcgough 9 hours ago
Comment by jakelazaroff 5 hours ago
Comment by adamtulinius 10 hours ago
Comment by ajjenkins 2 hours ago
That’s probably what the OP meant by “activism”.
Comment by F3nd0 10 hours ago
Comment by latinodev 11 hours ago
Comment by surgical_fire 10 hours ago
Do you only use languages that you can contribute to their codebase?
Comment by 15155 10 hours ago
It might be problematic to use a language where needed help could be preceded by Twitter or HN background and allegiance check.
Comment by surgical_fire 8 hours ago
That is exceedingly rare. The vast majority of times you will either find your answer online to work your way around issues.
> It might be problematic to use a language where needed help could be preceded by Twitter or HN background and allegiance check.
I would remind you that we have LLMs now. One of the greatest gifts of LLMs is not having to rely on talking to people online to figure out issues when using a language/framework/library.
Comment by F3nd0 8 hours ago
Comment by listedb 10 hours ago