I have a web app i've been using regularly and develop regularly with gleam on the frontend and backend. I have written very little of the code by hand and use claude to implement everything, open PRs and stuff and it works well. I like that it's typesafe and you can share code between the frontend and backend so easily, and you don't have to get a bunch of config right like you do if you want an all-typescript application. If I was writing it by hand I think I would find there's an annoying amount of boilerplate, but since ai is writing the code for me it's not a big deal.
this is what grinds my gears with gleam. afaik its not really possible to interact with elixir libraries? A project exists to try to make this 'easier' but the fact that it was not baked-in as first class is a huge smell to me https://github.com/gleam-lang/mix_gleam/
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.
There are two sides to compatibility with Elixir: using Gleam in Elixir and using Elixir in Gleam. The former is harder, the latter is easier (with caveats).
Using Gleam in an Elixir project did/does rely on mix_gleam. I've used it some years ago and it worked then, but I haven't had recent experiences. There is a pull request[0] to Elixir to add built-in support for Gleam and as I understand it the Gleam team have made several changes to Gleam tooling to facilitate it, but it's unmerged as of now.
Using Elixir in a Gleam project is just an external function away, just like using Erlang or JavaScript (when using the JS target). E.g.
You can also write .ex files in your codebase and use functions from them as externals and they'll be compiled by Gleam.
The two main issues on that side are macros and structs. Since Gleam doesn't know about Elixir source or Elixir macros, you can't use them directly. But you can have an .ex file that uses macros and then you can call functions from that file. Structs are trickier, because they're just dynamic maps with a special key-value pair, and maps in Gleam (called Dict) have fixed types for the keys and values. That means you can't model a struct as a Dict. Gleam uses records for its own custom types, so what you can do is either use records on the Elixir side (with the Record module or by hand), or map the Elixir side data structures to be more palatable for Gleam (and vice versa) in your external functions --- which is what you generally do with externals anyway. Of course, if you only intend to pass the Elixir structs around and then back to Elixir, you can model them as external types that are then opaque to Gleam.
Exactly the opposite -- in a lot of ways, mainstream languages represent a compromise that gives the worst of all worlds for the benefit of popularity. With AI, you can take advantage of unpopular esoteric languages that have measurable advantages over mainstream languages. Before, the choice for a mainstream language was too strong because of network effects. Now with AI those effects don't matter as much, so being mainstream isn't as much of an advantage.
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.
In that Tencent study less common languages got easier problems. Which explains why racket also performed suspiciously well in it. The authors recognize the problem themselves. I like elixir, but it's imo embarrassing how often elixir people cite that study despite it not actually supporting what they claim.
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.
What they did is they gave the AI a huge pile of docs and said "implement this". But they didn't give the AI any tests as part of its objective. I was under the impression it's generally common practice to use a test-driven development approach with AI, so I think it would have been more representative for them to have split their test corpus in half: one half it could see during implementation, and then the could test on the other half.
Also, they restricted access from the internet, so I think this would have disadvantaged less popular languages.
I would definitely be skeptical of a study that finds using an LLM/agent to write sqlite in JS being better than writing in Zig, but it strongly depends on what “better” or “worse” mean.
It means how much of the sqlite test suite it passed. They were just measuring correctness, not performance or memory consumption, where of course Zig should win.
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...
A more popular language like what? The more popular choice that I could think of was typescript and the world around typescript and javascript is so big and fragmented I think you'd end up with it the ai doing things in different ways in different places. Gleam is a smaller ecosystem but it also just feels better organized and more consistent which helps for keeping things consistent in your app.
That mindset is a bit dated when models can pull up docs for a few years now. You can even have it write itself a little guide for lesser known languages within its own agents file.
Programming models have been sophisticated enough for some time to not be restricted to specific languages. It's rather like the difference between a junior developer (who knows how to use a specific language) and a mid developer (who knows who to program generally).
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.
Not sure why you're asking this? But i mean if a language is more readable and has good typesafety it's easier for llms to understand, plus a lot of times you want to read and understand it even if you're not typing it out yourself
That's also not true at all. The most efficient languages for an LLM are the ones that have the largest datasets to reference. It knows the shape of a billion lines of Python. There's no evidence to suggest that "a more ergonomic language" burns less tokens cause it probably has to do multiple sweeps to get it "right". Otherwise some "agent/token efficient" language would've already been built and we'd all be using it. The defacto are just the most popular languages and that's not a coincidence.
Only if they gain that ergonomic advantage without complicating flow of control. Metaprogramming is costly for example, in the past so have been operator overloading and lazy evaluation.
I never liked currying. It feels more theoretically elegant than practically useful.
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"))
I think the single hole version is a good compromise compared to actual currying or multiple holes, since it's strictly better than something like first or last argument threading (e.g. ->, ->> in Clojure), easier to reason about than currying, and in my experience most of the time you'll only be dealing with one argument to pass piping anyway. Anonymous functions are fine for the cases you need more flexibility.
As I mentioned in my other comment, they do have partial application with _, and it works like a charm for piping!
It's automatic currying which is absent.
Ymmv, but you can get pretty far with a convention: order arguments by _how likely they are to be closed_ within any given context. As a full-time F# developer that covered >95% of what we were doing.
An alternative is providing variations on a function that "bundle" sets of arguments, and then making the bundle the first parameter, but that only makes sense when the "bundles" occur together a lot.
I would rather see syntax to make partial application on arbitrary named or positional slots as ergonomic as possible. How much has that been explored by existing languages?
To your point on "Gleam: the bad" and the ecosystem being small, I would add that this community has a history of activism behaviour. Some like that, I'm out.
Fair point, I am with you on that. I guess just had a bad first impression on drama that I've seen as a spectator through the public channels that stuck.
That could be repaired, just don't care enough to spend time there again I guess.
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.
Agreed. Treat people well seemed to be the Gleam desire.
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)
I am on that thread as well. The issue with these "codes of conduct" isn't that they exist, it's that their purveyors force the "code" upon every participant regardless of forum.
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.
I think you're seriously overreacting; you don't need to believe the same things that they do, all the CoC states is that if you want to engage with the community, you agree not to harass people. Every community has similar expectations; having it in a markdown just makes it more explicit.
I... Think many of us would like evidence to back this up. Can you demonstrate that the Gleam community has done this, specifically? Because it really seems, to me at least, that this is a bit of straw-manning.
I mean, yeah — people won't want to be in community with someone who transgresses against their social norms and values. Freely choosing with whom you associate is not a "form of control". You're still welcome to use the project.
Sounds to me like a lot of divisive American politics, as usual.
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...
> 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...
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.
I think you have a reasonable position here, so I understand where you come from.
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.
> creator and the community have political opinions and don't like people with incompatible ones, then that's just society
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.
I mean it's only relevant if you bring it with you in their community. You don't sign your soul away when you download the compiler. Do you have the same issue with all the ToS asking you to not be a nazi and whatnot on a given platform?
Maybe you could be specific, instead of just spreading FUD? I read through the discussion you linked, and I have no idea what you’re talking about, so to me your comment comes of as just FUD.
I don’t have a problem with activism per se, but it does put me off how the official website tries to make the language and community look extremely friendly and cutesy, only to immediately break that facade. If that’s the look you’ve decided to go for, at least try and commit to it!
> "Contribute to their codebase" includes bug reports and seeking help with errata and other issues.
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.
Both searching for answers online and consulting LLM’s depends on prior human works or interactions, and (from what I know) their feasibility scales with the language’s popularity. I should expect both approaches to work much more reliably for Perl or Python than they would for Gleam or Newlisp.