6 ms·
Its also important to note that Rust changed radically in its early life. Here's one of its core authors describing some of the changes they went through (in
by brandmeyer 5y ago
Its also important to note that Rust changed radically in its early life. Here's one of its core authors describing some of the changes they went through (in part) as a result of dogfooding the language in its own compiler, in the context of BitC's failures:
https://news.ycombinator.com/item?id=3750882 https://news.ycombinator.com/item?id=3750882
The language it had evolved into by 2012 is also radically different from the language it became by 1.0 in 2015.
- secondcoming 5y agoIt's interesting that he invented Rust but hasn't worked on it in 9 years. I'm not sure I'd be able to walk away like that.
- nicoburns 5y agoThe changelog is also worth a read. It goes all the way back to 0.1 in 2012: https://github.com/rust-lang/rust/blob/master/RELEASES.md https://github.com/rust-lang/rust/blob/master/RELEASES.md
- lioeters 5y agoThat long comment was insightful, comparing how Rust and Go solved (or avoided altogether) similar concerns. > ..we would have never found these things so early unless we had written the Rust compiler in Rust itself. It forces us to use the language constantly, and we quickly find pain points. I highly encourage all languages to do the same; it's a great way to find and shake out design issues early. This reminded me of Lisp, meta-circular interpreters, and self-hosted compilers. Reading up on Rust's beginnings, I learned that: > The language grew out of a personal project begun in 2006.. [In 2010] work shifted from the initial compiler (written in OCaml) to an LLVM-based self-hosting compiler written in Rust. Named rustc, it successfully compiled itself in 2011.
- brundolf 5y agoI know there are many benefits to self-hosting, but I’ve wondered in the past if it biases language design towards compiler-writing. Depending on the language’s primary domain (maybe with Rust it’s less of a concern), compilers as a usecase can be fairly unusual, in terms of both requirements and what makes them ergonomic to write. So if self-hosting inspires you to shape the language to make early accommodations for writing the compiler, that may not necessarily be the best thing in the long run.
- capableweb 5y agoIndeed, building a programming language that is supposed to be for systems programming then it makes sense for it to be able to be ergonomic to write compilers in. But if you're building a programming language for building UIs (or any other specific use case), then making it bootstrapping it's own compiler in it's own language seems like a waste of time.
- brundolf 5y agoI'm not sure I'd say "waste of time", just that it might pull the language in some directions it might not ought to go in. It would still benefit from the battle-testing, but there might be other "dogfooding" projects that would be more appropriate; the compiler is just a convenient one since you're already doing that work.
- pdpi 5y agoI don’t think it’s a waste of time. Compilers are demanding projects where you need to be intimately familiar with both target and host languages. A self-hosting compiler means that target and host are the same language, and reduces that source of friction.
- wk_end 5y agoThis makes sense in the abstract - in practice, what compiler-specific features or biases do you think might not be suited for any given general-purpose language?
- brundolf 5y agoCompilers are biased, among other things, towards: - Having a rich, complicated internal model (and having minimal contact with external data; mostly just the code being ingested) - Recursion - Being stateless (at the top level anyway; code goes in code comes out) - Having an enormous amount of semi-regular code (favoring macros and related features) - Dispatch/polymorphism among very broad type groups (favoring enums and ways of discriminating enums) Not that any of these things are bad to support in any given language, but every language is a big bag of trade-offs, and focusing on compilers might cause you to choose certain tradeoffs that aren’t as relevant to the way the language will typically be used later on No specific judgements on Rust (in fact, Rust has ended up seeing a lot of use for compilers and compiler-adjacent projects), just something I’ve been thinking about in general
- steveklabnik 5y agoTwo other links related to ancient Rust: * https://github.com/graydon/rust-prehistory https://github.com/graydon/rust-prehistory -> the code from before the rust-lang/rust repo * https://youtube.com/watch?v=79PSagCD_AY https://youtube.com/watch?v=79PSagCD_AY -> a talk I gave around the 1.0 release (that recording is lost, this is the only other time I gave the talk so it could be recorded) giving my personal perspective on the history. Oh heck, one more fun one: https://github.com/brson/archaea https://github.com/brson/archaea
- bmitc 5y agoAre there any code examples that people know of from when Rust had a more ML-like (in the vain of F# and OCaml) syntax, before Rust transitioned to curly braces?
- Sharlin 5y agoHeh, dynamic linking and small executables. Funny how things change.
- MaxBarraclough 5y agoRust originally had a garbage collector, right? These days perhaps its biggest claim to fame is its novel approach to memory management (i.e. borrower-checking).
- fulafel 5y agoIt had both borrow checking and GC for a while.