Shine with Gleam
rockyj-blogs.web.app
rockyj-blogs.web.app
I use it in Vue components with Vleam[1]. About half of the frontend is rewritten at the moment, and it is a joy to use.
I'd do it again just for the error handling.
That’s the real problem, not OOP. There is a functional-ish OOP style where most objects are immutable. Classes are used to capture invariants (in the sense of https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...), or for local-only mutations (like building a collection in a local scope, which is passed on as immutable after building).
The defining characteristics of OOP are encapsulation and subtyping, not mutability.
Encapsulation is a whole other issue, to which the ‘solution’ is almost always more encapsulation. The nice thing about immutability is that it is not really compatible with how we do encapsulation, so if you are strict about immutability then you are suddenly free from the whole quagmire as a side-effect.
There are places to use encapsulation with mutability, such as simulations, but having hidden mutable states is not desirable property when constructing rapidly changing applications.
I do my best to keep things sane when working with a Java or Ruby or what have you codebase, but I don't pretend it's something it's not. Just do the best that the codebase and organization can tolerate.
Regarding your point about collection views, const references are often also just views on mutable objects, and this poses no particular difficulty. And you can implement truly immutable collections in Java if you really insist on it.
More important imo is that the standard collection classes can’t even be set to immutable with the final keyword. Sure you can use something else, but professionally you are going to have to deal with them most of the time still.
I agree that it's always a little risky to bet on a young language. But I think Gleam is doing a good job of positioning itself as a smaller risk by sitting on the tried-and-true BEAM virtual machine and Javascript runtimes. If worst comes to worst you could export your compiled Gleam as Erlang or JS and it's quite readable.
And Gleam's FFI with Erlang, Elixir and Javascript is pretty good. I don't think it will take long for a wide variety of packages from those platforms to become available on the Gleam package manager. Doing your own FFI is hardly intimidating - it's essentially just writing type definitions for the functions you need.
Another factor giving me hope is that the language appears to be mostly 'done'. The author has carefully considered a minimal feature set and appears to be sticking to it, making it one of the simplest (typed) languages I've ever used syntax-wise. I think this bodes well for future growth, stability and maintainability.
In Gleam, this is called `result.try`[1]
I've heard this sentiment expressed a lot, but I don't understand it.
Rust is unique because it is a relatively high-level language that at the same time does constrain you in the least possible ways. It doesn't require a runtime, it has no mandatory garbage collector, it runs on a wide variety of hardware platforms and operating systems. Rust is not only suitable to write embedded software, operating systems, web applications and web frontends, it is good at each - it might not be perfect or the best in each category, but it is astonishingly good. And finally it manages to be like that, being a relatively boring language even - familiar syntax, modern features but from a research perspective nothing fancy.
There will always be new languages that have their niche, but to be a "Rust, just X" it will have to be as general purpose as Rust already is.
Glad you love Rust, but it is not remotely straightforward or “boring” — there’s a lot of hidden magic behind idiomatic Rust. And I wouldn’t call it “astonishingly good” for many of the use cases you mention. It can do all those things, but often not easily.
I enjoy both. Rust for its performance and close-to-metalness, Gleam for its delightful simplicity. It really is a tiny language, and very tastefully designed.
https://blog.appsignal.com/2024/07/23/enhancing-your-elixir-...
> Erlang's actor model ... is one of the greatest successes of language design to date IMO, if you work within 1 VM, the thread model is closest to us as almost all languages have it. How many languages the actor model is implemented in? I know Erlang, Scala. What else?
The experience is alright now but it has to get better to go mainstream (if that's even desired). If I had time I'd love to contribute.
> Black lives matter. Trans rights are human rights. No nazi bullsh*t.
I agree, but I do not agree with painting people that disagree as 'Nazi'.
*edit: that quote was from the Gleam website, not the website linked.
Here in South Korea, there is institutionalized racism or something we call as institution enabled racism. People who are not Korean or white aren't even allowed in most clubs or jobs and it isn't illegal to do so.
Labeling deters bringing exclusionary views into tech projects, It could be just words, but I am happy to see the privileged society at least care for the minority in the west. I wish there was more of this in Korean tech websites, but xenophobia is so ingrained that people don't realise that it is wrong. People openly admit that they are xenophobic but don't see anything wrong with it.
In korea, labeling someone a nazi doesn't work as they don't care and can't relate. But the label that works here is calling someone "poor" or "ugly".
We don't tolerate racism of any kind.
Unless they want to express something different with their "No nazi bullsh*t". Unfortunately plain and clear statements are not used often. But (esp. younger) people are more often echoing political main stream slogans. That is by the way the key thing to understand when talking about the history of Nazis.
There can be widespread bigotry that falls far far short of N*ism. Words and precision matter.
There are still people out in the world that call themselves Nazis. Its not directly comparing "todays" people to those that started world war II.
Its calling out white nationalist by the name some of them have chosen for themselves.
If they are against racism, why don't they just write this? Because they want to sneak in a political statement. That's where they lost me.
Consider a great evil, claim to be against that great evil and become the greatest hero in the process. The problem is that we are running of Nazis, so the bar for someone being called a Nazi or fascist keeps dropping, because of the great demand by saviours.
You can learn from history _and_ berate Nazis. Those aren't mutually exclusive.
I don't know where you're from, but there are also _modern_ Nazis who proudly identify as such and they can and should be told to fuck off.