News for hackers. Stuff that matters.
Re:Perseus – NextJS alternative in Rust by pkolaczk on Sunday April 09, 2023 @08:24AM (#35502077)
Rust is both a low level but also a high level language. There aren't many mainstream languages that can go higher level than Rust with its traits, sum types, generics and macros. Haskell, Scala, maybe C++ to some degree, what else?
Re:Perseus – NextJS alternative in Rust by pjmlp on Sunday April 09, 2023 @09:48AM (#35502696)
OCaml, F#, Kotlin, Ada, Swift.
Re:Perseus – NextJS alternative in Rust by pas on Sunday April 09, 2023 @10:16AM (#35502932)
Those are not real languages! After all what can you do with OCaml for ex? A compiler for a Rust-like language at best? :)
Re:Perseus – NextJS alternative in Rust by pjmlp on Sunday April 09, 2023 @10:28AM (#35503022)
Story has it that Rust was born out of a fake language, so maybe they are worth something.

Likewise Ada makes your vacations possible, in case taking a plane or train is part of it.

Kotlin turns pixie dust into Android apps, while Swift does the same for iOS.

Re:Perseus – NextJS alternative in Rust by pkolaczk on Sunday April 09, 2023 @12:01PM (#35503955)
I don't think Kotlin is higher-level than Rust. It misses most metaprogramming features, and its generic programming capabilities are weaker (nothing remotely as capable as traits/implicits/type-classes).

The others (except Swift) are barely mainstream.

Re:Perseus – NextJS alternative in Rust by pjmlp on Sunday April 09, 2023 @01:31PM (#35504729)
They are as mainstream as Rust, some of them beat Rust in production deployments.

Kotlin meta-programing is done via reflection and compiler plugins.

Traits are interfaces.

Re:Perseus – NextJS alternative in Rust by pkolaczk on Monday April 10, 2023 @01:44AM (#35509514)
I've said it misses most of metaprogramming features, not all of them. Reflection can't do the same things as macros can. Macros can transform arbitrary AST to arbitrary AST, reflection can't.

Similar thing with interfaces - while they serve the same purpose as traits, they are nowhere as flexible/expressive. E.g you cannot do blanket interface implementations - i.e. implement an interface for only the classes that implement another interface. You also cannot implement the same interface more than once, differing by generic parameters only. Or cannot define an interface with an associated type member (Scala is another language that can do it).

Re:Perseus – NextJS alternative in Rust by pjmlp on Monday April 10, 2023 @02:04AM (#35509601)
Splitting hairs in featurities that hardly matter when shipping stuff.

Yes they aren't 1:1 to Rust, so what.

Does any of them matter to ship better Android applications written in Rust? Nope.

Re:Perseus – NextJS alternative in Rust by pkolaczk on Monday April 10, 2023 @04:00AM (#35510140)
The discussion was about being higher-level vs lower-level. Rust is a more expressive language than Kotlin. Where languages are used is a different matter, because expressiveness is not the only thing playing role there. Politics and historical reasons are another dimension.
Re:Perseus – NextJS alternative in Rust by pjmlp on Monday April 10, 2023 @11:22AM (#35513422)
You made it about politics with ridiculous remarks, now the conversation turns around, what a surprise.
Re:Perseus – NextJS alternative in Rust by pkolaczk on Monday April 10, 2023 @02:49PM (#35515877)
You seem to be missing my point. The point was not about which languages are mainstream (which is highly subjective, hard to measure and also may be an effect of certain politics), but about their level of abstraction. Rust is often placed in the "low level, close to the hardware" bin because it can go low-level very far if you wish to. But it is often forgotten that it can be also very high in terms of expressiveness / abstraction power and offers productivity features not found in many mainstream languages.