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.
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.
* https://github.com/graydon/rust-prehistory -> the code from before the rust-lang/rust repo
* 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
> ..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.
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.
- 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
Well yeah most languages do not do that. Besides if any language claiming to be general purpose language to be useful in varied use cases, leaving out compiler, runtime, or GC etc would reflect important shortcomings in language.
> 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.
This is applicable to almost any situation. If a language is designed for say asynchronous web services of 2020s, will be necessarily best thing in long run? With the benefit of hindsight I can say a SOAP programming language designed in 2000 would not have many takers today.
Yeah this a "well know" problem.
In fact, you will ALWAYS bias the language for what is your ACTUAL first "major" project.
However, I think that "make langs" is in itself a very good thing to be able to do in any lang, even if is high-level, business oriented (a lot of work is alike!) and is only when you wanna to mimic the C-abi or marry with C/C++ (like full integrate LLVM) where things will go sideways (and I bet: Is more a fault of C here, than "making compilers")
Well I've been waiting for ANY language to embrace 2d, 3d, and 4d vectors as basic types (probably the wrong word). They map perfectly to modern vector registers in SIMD hardware and they are fundamental to all forms of graphics, from text rendering to 3d games, to CAD and any type of physical simulation software. It just seems like language designers figure "anyone can create a type like that with our generic building blocks" and somehow, if we're lucky the compiler will figure out and generate optimal code for it. Oh never mind that different code bases will call these fundamental data types different thing - Vec3, vec3, vector, and have different implemntations, making modules non-reusable across projects...
Yes, language designers and compiler writers are usually very smart people but they do have biases and blind spots just like everyone else. It think Rust is turning out so good because they really spent like 10 years getting it "right".
Not too wrong... I think the proper term is "primitive" (as in language primitives), but basic works too.