Rust started as a personal project in 2006
twitter.com
twitter.com
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.
> ..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.
* 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
As a sw dev, I'd be sad too!
https://twitter.com/graydon_pub/status/1492640056523116544
Graydon talks about how companies aren't willing to fund risky work, and that Rust would have never been a thing if he hadn't invested massive amounts of personal time into it.
My limited experience at large companies suggests the engineer has to basically have a working prototype developed off the clock before anyone listens. And this matches what I know about corporate R&D mostly following public investment in government & academic speculative work.Trying to claim that Dennis Richie's design is just bad as you constantly do in any thread mentioning C is just completely missing the point and couldn't be more wrong. One thing is pointing out problems of C and another very different is saying that the only thing going for C is UNIX.
I assumed that C and Unix had "won" vor many decades already.
http://venge.net/graydon/talks/intro-talk-2.pdf
The goals of the language remained the same, but implementation changed a lot since then. It used to be more like Erlang than C.
Nim and Crystal are nice, but are not rust under the hood.
This would open rust up more to smaller brained devs like me who can't do full rust full time. I think it's generally underestimated how valuable this would be to establishing the rust utopia we all want to see.
If you think it’s possible, try designing what it would look like, and what it would compile your code to. You will quickly find that it can’t work without losing the quintessence of Rust completely (and a lot of performance).
The thread spells out OCaml as the main inspiration for Rust, and fits the "without the borrow checker" part. Plenty of semicolons in it, however. F# offers a similar experience with fewer semi-colons, but I can't see how removing semi-colons help make the language more accessible.
- Rust
- RustGC
- RustScript
I elaborated here: https://gist.github.com/xixixao/8e363dbd3663b6729cd5b6d74dbb...
I think semicolons are necessary due to Rust being an expression-oriented language.
Related discussion: https://news.ycombinator.com/item?id=20614286.
Although I didn't delve into the technical details, at the very least, semicolons are necessary to distinguish statements from expressions.
- Is actually complex language!
- It has weird, inconsistent inter-mixed between traits, generics, macros, procedural macros, elides, alias, type alias...
- The ways async/await is introduced, multiply the complexity, is super-infectios, and I can't say you can do "fearless concurrency" anymore.
- Is slow to compile!
A "nicer" Rust is actually easy to grasp:
- Borrow checker, xor mutability stay. Is good
- Structs, Traits, Enum, Pattern matching, iterators
- Add generators, PLS!
- A simpler module system
- One single way to do macros, hopefully like Zig
- Probably everything auto-clone (and maybe the compiler elide it for "copy" types).
- Pick a more ergonomic async/concurrency story like Go or Lua. Whatever that is not the complexity of today
I think this is all...
But you can't have one way to do macros unless that way is proc macros or you're willing to give up on the power of proc macros. The proc macro is just much too powerful (and thus dangerous) to give people something else and have it be satisfactory.
And I don't think auto-clone is a good idea. That's a potentially expensive operation, it's worth taking the time to admit to yourself that you are choosing to pay that price when you use it. This also means when you forgot that you'd need a clone you're reminded there and then (by the resulting diagnostics) to make the decision, whereas with auto-clone in those cases it just mysteriously has worse performance than you expected (because there's a silent clone)
C and C++ introduce new keywords all the time, by prefixing them with "_" and a capital letter. If you want the nice spelling you need to use a header. E.g. "_Complex". "co_await" etc are operators.
C++ 20 introduced concepts. In C++ 17 "concept" is a perfectly reasonable name for an identifier. Maybe it's a class, a variable, a free function, all fine. In C++ 20 that's a reserved word and can't be used as an identifier.
Rust does not have this problem, a 2015 function named "await" is somewhat annoying to use from Rust 2018 or later where "await" is a keyword, but it's only annoying it isn't actually difficult.
yeah, thinking better I must have say "everything is auto-Rc or Arc backed" or similar.
> The Rust CoC has been in place since day one. [...] I wrote it before releasing any code, before even agreeing to work on such a project for Mozilla.
https://blog.rust-lang.org/2020/08/18/laying-the-foundation-...
Who is a liar? that dude or mozilla? or both?
That Graydon started Rust on his own in 2006 is not disputed by anyone with knowledge of the facts, including the very post you linked.
You also in your original comment said Mozilla picked it before 2006, which is also impossible and simply incorrect.