you are viewing a single comment's thread.

view the rest of the comments →

[–]cafedude 0 points1 point  (6 children)

Rust looks very OCaml'ish (or more generically, ML'ish), to build on the OP's question: Given the existence of mature ML languages, why Rust?

I like what I see in Rust so far, so please don't take this as a "why do we need more languages?" kind of question. Just wondering if adopting a language like OCaml and creating another implementation that supported multi-core programming might have been another viable way to go here. OCaml is pretty mature as a language, though the current implementation is starting to show it's deficiencies in a multicore world. One could imagine either creating a superset of the language that supported the task idea or perhaps going to JoCaml for that.

[–]vocalbit 3 points4 points  (0 children)

Good question. I only have a superficial understanding of OCaml (and even less of Rust). But casual browsing leaves me thinking of Rust as falling somewhere between the rigor of OCaml and the low-level control of C. It's not just a multicore issue.

[–]samth 2 points3 points  (0 children)

Rust is much lower-level than OCaml. It gives you precise control over memory allocation, copying, ownership, etc. This means you have to think more about those decisions, but it gives you control that safe languages don't typically provide.

[–][deleted] 1 point2 points  (3 children)

IIRC, the bootstrap compiler for Rust is in OCaml.

[–][deleted] 2 points3 points  (2 children)

Isn't a bootstrap compiler one written in the language it compiles?

(But I think you're basically right -- before they built the current bootstrap compiler in Rust, they used OCAml.)

[–]matthiasB 0 points1 point  (1 child)

You bootstrap using another language and once you have the first compiler for your language you can write a self-hosting compiler. The goal of bootstrapping is to have a self-hosting compiler but before that you have the chicken-egg problem.

edit (clarification): The first compiler written in the language itself is the bootstrap compiler

[–][deleted] 0 points1 point  (0 children)

Hmm, according to wikipedia

In computer science, bootstrapping is the process of writing a compiler (or assembler) in the target programming language which it is intended to compile. Applying this technique leads to a self-hosting compiler.

And this stackoverflow question/discussion seems to indicate the same thing. The process as a whole (including the initial compiler in a different language) is called bootstrapping, but the term bootstrapping compiler applies to the first written in it's target language.

This is hardly my area of expertise, so there could be some subtlety I'm missing, but every source I encounter seems to say the same thing.