by 3a2d29 · 4y ago · 0 comments
This is a great point. I understand liking a language, but don't bring Rust into a GC space (in industry, personal projects can be what you like!) You can find a GC language with all the features of rust you like.
enum Foo {
A(String),
B(i32),
}
And it's.. not simple. And even if you manage to do it, it'll never be how Kotlin was meant to be written. sealed interface Foo
class A(val s: String): Foo
class B(val b: Int): Foo enum Foo {
Bar(String),
Baz(i32),
}
Why? It's such a fundamental thing to be able to say "this piece of data is either this or that.. and then have the compiler tell you if you missed a case.Ada is on my list of languages to look at. I'm cautiously optimistic about that one. But would you pick that over Rust as the simpler alternative? "Look guys! We're not moving fast enough with Rust because nobody seems to be proficient in it. Let's go with Ada instead!" .. I jest, but I will check it out and I really hope it hits the sweet spot for me
But even then, what about Ada?
I’m also not an expert, but I assume between C#/Typescript/haskell/swift that you can find all those things in many GC/safer languages.