News for hackers. Stuff that matters.
Re:When Zig Is Safer and Faster Than Rust by anon-3988 on Monday December 30, 2024 @09:23AM (#42549495)
I feel like there's space for imperative, garbage collected, pattern matching, and ADT language. Just Golang + pattern matching + ADT.

I would be sooooooooooooooooooooooooo happy. I think there ought to be a subset of Rust that uses Arc for everything, maybe with a language feature that desugars into it. Obviously this requires compilers to be able to reason and optimize out atomics.

Re:When Zig Is Safer and Faster Than Rust by zokier on Monday December 30, 2024 @09:41AM (#42549655)
Ocaml, F#, Reason, ReScript, Scala? Or any other of the million ML style languages?
Re:When Zig Is Safer and Faster Than Rust by anon-3988 on Monday December 30, 2024 @06:53PM (#42554937)
I tried OCAML, My problem with it is that it smuggles in a lot of other concepts too. Especially with the thing about bindings and mutability. Also, the syntax.

Every FP languages tends to be "pure" and remove every "unnecessary" syntax to achieve some kind of "simplicity".

No, I want a true cavemen language. Treat me like I'm a low IQ idiot. "This function returns Option<T> DURRR ME HAVE TO MATCH ALL. ME DON UNDERSTAND WHAT "_" CLAUSE IS. ME NO UNDERSTAND LIFETIMES, LAST TIME I WROTE THE C BINDING ME BRAIN ALL FRY".

There's a space for language for people who:

1. learn the language in 1 hour 2. spend 100 hour writing the most mundane, verbose code

instead of:

1. learn the language in 100 hour 2. spend 1 hour writing the most beautiful, concise and pure code

Re:When Zig Is Safer and Faster Than Rust by zokier on Monday December 30, 2024 @08:30PM (#42555490)
Ocaml might have lot of faults, but I can't see it being overly puristic or minimalistic.
Re:When Zig Is Safer and Faster Than Rust by russell_h on Monday December 30, 2024 @09:38AM (#42549632)
I wouldn’t use this in production, but this was in HN earlier this year and I love the idea: https://github.com/borgo-lang/borgo
Re:When Zig Is Safer and Faster Than Rust by udbhavs on Monday December 30, 2024 @10:00AM (#42549841)
Dart has pattern matching that is a lot more fleshed out than most C-family languages, you should check it out

https://dart.dev/language/patterns

Edit: while there aren’t full ADTs, it does have sealed classes which help with exhaustiveness in matching

Re:When Zig Is Safer and Faster Than Rust by ThePhysicist on Monday December 30, 2024 @09:31AM (#42549558)
I think we might get these eventually in Golang, at least to a degree. In the end it's just a question whether they will be zero-cost like in Rust or incur some runtime overhead (I would assume the latter). Would be fine for me, I rely a lot on reflection for more complex use cases around dynamic typing and that already has a significant runtime cost (which is still ok in most cases).
Re:When Zig Is Safer and Faster Than Rust by gr4vityWall on Monday December 30, 2024 @03:50PM (#42553359)
Haxe is OOP by default, but it's not super forced into you, and has ADTs/pattern matching.
Re:When Zig Is Safer and Faster Than Rust by ComputerGuru on Wednesday January 01, 2025 @12:33PM (#42567518)
C# is headed this way. Typescript is there but only if you can ignore the fact that it is JavaScript masquerading as a more serious language for halloween.
Re:When Zig Is Safer and Faster Than Rust by dzsekijo on Wednesday January 01, 2025 @06:37PM (#42570218)