Comments by "" (@diadetediotedio6918) on "Ladybird On Swift vs Rust" video.
-
8
-
2
-
2
-
2
-
2
-
1
-
@Me-wi6ym
I have a quick lookup on scala docs for those, but I don't think case classes are similar to Rust structs. They are reasonable similar to some constructs you can do to structs, but absolutely different.
The question of structs is not that they enable a certain kind of behavior, but that they are inlined in memory. Scala is based on JVM, which as far as I know currently don't support value types (until valhalla comes or something happens), so all the custom types are boxed in memory in the "worst" case (which is much, much, much slower).
Considering scala also does not have a borrow checker (but swift has an optional ownable types feature with the ~Copyable) I feel like it can model <more> features closely to the Rust API. In the end of the day I don't think neither are exactly akin to what Rust can do, but swift for me is closer in this regard because it is also considered a systems programming language.
Still, I want to use scala a bit before giving a definitive conclusion, I used Kotlin so far but not scala yes. I think Kotlin is very close to swift in the syntax (different in many aspects, but close in many others, I personally love the trailing lambda feature of both langs).
1
-
1