4 ms·
Rust is heavily influenced by OCaml. The first Rust compiler was written in Rust.
by adamnemecek 5y ago
Rust is heavily influenced by OCaml. The first Rust compiler was written in Rust.
- UncleOxidant 5y agoYes, I know this, but this is going the other direction and seems kind of noteworthy: OCamlPro exists to promote OCaml, and it looks like they're making some forays into Rust?
- mirekrusin 5y agoOCaml - Rust interop would be very cool, whatever low-level stuff you can throw into Rust while being able to use it from OCaml would be interesting.
- mseri 5y agoThere are a number of interesting projects already doing this, either doing it manually via the c FFI or using projects like ocaml-rs [1] or ocaml-interop [2] for example [1]: https://github.com/zshipko/ocaml-rs https://github.com/zshipko/ocaml-rs [2]: https://github.com/tezedge/ocaml-interop https://github.com/tezedge/ocaml-interop
- baby 5y agoWe use ocaml-rs[1] and ocaml-gen[2] for that, it works pretty well although there’s room for improvement. [1]: https://github.com/zshipko/ocaml-rs https://github.com/zshipko/ocaml-rs [2]: https://github.com/o1-labs/proof-systems/tree/a4b06e71106704cae4e7ec8edbded2f0c7f81990/ocaml/ocaml-gen https://github.com/o1-labs/proof-systems/tree/a4b06e71106704...
- speed_spread 5y ago> The first Rust compiler was written in Rust. That's impressive! (yeah, it could have been interpreted)
- adamnemecek 5y agoFuck I meant OCaml.
- LAC-Tech 5y agoI think Rust and Ocaml are very different languages. I went into Rust thinking I could use it like a kind of curly brace Ocaml, and that's totally off. It's much more like a very strict modern C++ with a lot of historical cruft removed. OCaml is much more concise and higher level. It also doesn't let you reason about memory layout really well. Plus Ocaml has parametric polymorphism and higher order modules, compared with rusts ad-hoc polymorphism and traits. In Ocaml the idiomatic solution is often recursion but that will blow the rust stack. (full disclaimer, I'm much better at Ocaml than I am Rust, and I'm really not great at Ocaml)
- riwsky 5y agorust has parametric polymorphism, it just calls it generics—and traits correspond to ocaml signatures. These aren't useful juxtapositions.
- LAC-Tech 5y agoI'll take your word that I'm misusing the terms. Key difference - as a user - is in Ocaml I'd write a module with a bunch of functions. In rust I'd write a struct with a bunch of methods. It feels very different even if it solves the same things.
- O_H_E 5y ago> The first Rust compiler was written in Rust I think you meant "was written in OCaml"
- adamnemecek 5y agoI did, haha.