Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>I read somewhere that OCaml had a greater influence on it

Whoever wrote that is wrong.



If we could wave a magic wand and remove Haskell's influence on Rust, Rust would still exist in some kind of partial form. If we waved the same wand and removed OCaml's influence, Rust would no longer exist at all.

You are the one who is wrong, I'm afraid.


Which OCaml features exist in Rust but not Haskell? The trait system looks very similar to Haskell typeclasses, but I'm not aware of any novel OCaml influence on the language.


> Which OCaml features exist in Rust but not Haskell?

Rust's most important feature! The bootstrapped implementation.


I'm not convinced the implementation language of the compiler counts as a feature of the Rust language. If the argument is that Rust wouldn't have been invented without the original author wanting a 'systems OCaml' then fine. But it's possible Rust would still look similar to how it does now in a counterfactual world where the original inspiration was Haskell rather than OCaml, but removing the Haskell influence from Rust as it is now would result in something quite different.


Rust isn't just a language, though.

Additionally, unlike some languages that are formally specified before turning to implementation, Rust has subscribed to design-by-implementation. The implementation is the language.


That just means the semantics of the language are defined by whatever the default implementation does. It's a big stretch to conclude that means Rust 'was' OCaml in some sense when the compiler was written with it. Especially now the Rust compiler is written in Rust itself.


You're overthinking again. Read what is said, not what you want it to say in some fairytale land.



The original rust compiler was written in OCaml. That's not evidence it "had an influence", but it's highly striking considering how many other languages Greydon could've used.


Yes: if a person knows nothing else about Rust and the languages that might have influenced it, then the fact that the original Rust compiler was written in OCaml should make that person conclude tentatively that OCaml was the language that influenced the design of Rust the most.

I'm not one to hold that one shouldn't form tentative conclusions until one "has all the fact". Also, I'm not one to hold that readers should trust the opinion of an internet comment writer they know nothing about. I could write a long explanation to support my opinion, but I'm probably not going to.


It's like trying to say Elixir wasn't influenced the most by Erlang


Was any Elixir interpreter or compiler every written in Erlang?

If not, what is the relevance of your comment?


Elixir’s implementation still has significant parts written in Erlang. I don’t know if it’s a majority but it’s a lot. e.g.: https://github.com/elixir-lang/elixir/blob/aef7e4eab521dfba9...


> SML, OCaml: algebraic data types, pattern matching, type inference, semicolon statement separation

> Haskell (GHC): typeclasses, type families

https://doc.rust-lang.org/reference/influences.html


Haskell has algebraic data types, pattern matching and type inference, too, and has had them since Haskell first appeared in 1990.

Although SML is older (1983), OCaml is younger than Haskell.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: