4 ms·
While at it, could you give a few examples that illustrate how Rust was inspired by Scala proper, and not Haskell / SML / OCaml (which also influenced Scala)?
by nine_k 2y ago
While at it, could you give a few examples that illustrate how Rust was inspired by Scala proper, and not Haskell / SML / OCaml (which also influenced Scala)?
- amelius 2y agoIt says here: https://en.wikipedia.org/wiki/ML_(programming_language) https://en.wikipedia.org/wiki/ML_(programming_language) that ML influenced Rust, Scala, Haskell and OCaml, so that's the common denominator. However, although Rust wants to be an ML style language all the idioms break because there's no GC.
- threeseed 2y agoSo I regularly jump between Scala and Rust and it's more a feeling. In that overall the way option types, pattern matching, FP operations e.g. map/filter, immutability by default and type parameters have been implemented are very similar to Scala. And since these make up a large percentage of the everyday code you write you see the similarity as being larger than maybe it is.
- akkad33 2y agoAll these are just functional features you find in every functional language though. Rust was highly influenced by OCAML and other ML languages
- threeseed 2y agoHence why I said it was a feeling. And I think the fact the overall style of the language e.g. braces, semicolon, method signatures, loop handling is so similar to Scala versus OCaml contributes to this.
- akkad33 2y agoThis page from official Rust website of its influences does not mention Scala. https://doc.rust-lang.org/reference/influences.html https://doc.rust-lang.org/reference/influences.html In fact this is the first time I've seen anyone say Scala influenced Rust let alone "heavily". Seems like a stretch