4 ms·
I think there are two other big differences that also helped Rust become popular: * Rust has a C++-flavored syntax, but OCaml has a relatively alien ML-flavore
by creata 1y ago
I think there are two other big differences that also helped Rust become popular:
* Rust has a C++-flavored syntax, but OCaml has a relatively alien ML-flavored syntax.
* Rust has the backing of Mozilla, but I don't think OCaml had comparable industry backing. (Jane Street, maybe?)
- shakna 1y agoFacebook and their Reason?
- dgfitz 1y ago> rust has a C++-flavored syntax I do not at all agree with this. Rust is by far the most complex language in terms of syntax that has ever become popular enough to compare it to anything.
- packetlost 1y agoI 100% disagree with this. Typescript is syntactically far more complex.
- TylerE 1y agoComplex isn't the same thing as hard. The rust syntax often times looks like a cat walked across the keyboard.
- oneshtein 1y agoIn my eyes, Rust code is as simple as Python code or even simpler in most cases, but it also allows to create and maintain complex pieces of abstraction, when necessary, then hide them in a library or a macro. :-/ Can you show example of "written by random cat" code you often see?
- deleted 1y ago[deleted]
- packetlost 1y agoAnd typescript's doesn't? They're incredibly similar syntactically except Typescripts type system is turing complete and unsound.
- johnnyanmac 1y agoC++ is a stretch, but I sort of understand GP's point. I'm slowly learning Rust now and it feels like a deep evolution of C type syntax. Not dissimilar to Javascript in the most base sense of language constructs. But you use it more and see actionscript types of function notation, funtional language semantics where you just "return" whatever was the last expression in a statement, how structs have no bodies (and classes aren't a thing) and instead everything is implemented externally, and it starts to really become its own beast.
- creata 1y agoI didn't think it was that controversial a statement. For example, Wikipedia says:[0] > Rust's syntax is similar to that of C and C++,[43][44] although many of its features were influenced by functional programming languages such as OCaml.[45] Hoare has described Rust as targeted at frustrated C++ developers...[15] I'm not sure what "actionscript types of function notation" means, but Rust's closures syntax (|x| ...) was probably inspired by Ruby and/or Smalltalk. Anyway, sure, the expression-orientedness, implicit return, etc., are very un-C++-like, but I do think the syntax was explicitly designed to be approachable to C++ developers. [0]: https://en.wikipedia.org/w/index.php?title=Rust_(programming_language)&oldid=1301451259 https://en.wikipedia.org/w/index.php?title=Rust_(programming...
- binary132 1y agoI think some of that is just that C++ doesn’t explicitly express its semantic complexity in its syntax, while Rust does. In some ways this is an advantage for Rust, although yeah I agree it makes Rust really hard to use, and I kinda hate its syntax.