Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

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?


view as:

OCaml, F#, Kotlin, Ada, Swift.

Those are not real languages! After all what can you do with OCaml for ex? A compiler for a Rust-like language at best? :)

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.


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.


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.


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).


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.


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.

You made it about politics with ridiculous remarks, now the conversation turns around, what a surprise.

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.

Legal | privacy