A brief history of Rust at Facebook
engineering.fb.com
engineering.fb.com
A note(since I notice my comment is getting downvoted): I've actually been spending time regularly for the past few weeks reading multiple tutorials, and getting familiar with Rust's concepts, and I really like the language and I can see that a lot of work has been put into developing it. But my concern is that there are other languages as well that have a solid background (OCaml, Haskell, to name a few), but that are still niche languages and suffer from the same scarce job market opportunities. Which proves that adoption does not always depend on how good a language is.
That being said, it's an investment in the future mostly. There aren't anywhere near as many Rust jobs as PHP, Java, or Python jobs.
The most recent one was Kotlin, in large part because our Android ecosystem was increasingly having to play catch up, so we'll see if/when a Rust team gets staffed.
It remains to be seen when it will even have a place on VS installer.
I write computer programs. I don't "invest" in a language and only take jobs that use that language.
Learning more languages is almost always good. Not because you're learning more languages, but because you're learning more modes of thinking which will apply to any future language you learn.
Job postings are the fucking worst.
Even if you're a senior Python/Javascript developer, with experience in C# in the past, etc., if they start grilling you about Ruby, you probably won't prove that you're as equally productive as a similarly smart dev that is an actual senior Ruby dev.
C++ has semi-official Core Guidelines issued by prominent members of the ISO-WG21 standard committee, that describe how to express these things idiomatically. Of course Rust can actually check these things automatically and achieve something close to actual memory safety, but there are ways to at least make a meaningful effort in C++.
I would watch the upcoming VC++ static analysis talk regarding its progress.
https://visualstudio.microsoft.com/de/pure-virtual-cpp-event...
I will consider Microsoft is fully into Rust when Azure Sphere supports Rust instead of being a C only SDK, despite its security marketing.
https://techcommunity.microsoft.com/t5/internet-of-things/de...
The first step in reducing those 70% is to actually use the tools that exist, but unfortunelly the macho attitute is still quite prevalent.
https://isocpp.org/files/papers/CppDevSurvey-2021-04-summary...
Those that are open to embrace Rust, are most likely already using static analyzers.
Note I mean the work being done by Microsoft and Google on top of Core Guidelines on their syntac analysers, which on Microsoft's case are active by default as background process that validate your code as you type.
It will never be as good as Rust is able to, but in some domains a "worse is better" solution will already be better than nothing, because they aren't going to port their code to something else.
Yes you can make a meaningful effort in C++, but one of the great benefits of Rust is that effort is handled by the compiler instead.
One of the things that struck me as a major advantage about Java and garbage collected languages is that you can simply combine code from different libraries without worrying about what's freeing the objects, because that's the GC's job. With Rust, the memory management model takes over this responsibility without runtime cost (or minimal cost -- perhaps freeing something from the heap, if you allocated it there, but definitely not GC).
With C++, unless the library that you're using is using the same smart point library as you, from the same language version, then aren't you stuck writing wrappers around the libs you want to use?
Types like std::async seem to have changed in every recent revision of C++ version (11, 17, 20). Can you reliably find multiple open source libraries that you could integrate into a codebase that uses futures and async/await?
(It's been a long time since I've done much C++ professionally. I'm asking skeptically but genuinely.)
I can spend all my development budget on the problem instead sacrificing part of it to building an ecosystem.
I'd imagine that we're at most 3 years away from it having mature libraries for 99% of tasks you'd want to do as a professional developer.
Some of those companies, like Google, Microsoft and NVidia, are heavily invested into C++, ISO C++ and selling C++ based products.
To use a common example that one puts against any technology that Microsoft touches, when will Office use Rust on its foundation and extension APIs?
Are you aware that Apple has rather created their own safe C dialect for iBoot firmware instead of using Rust?
If we can have Singularity/Midori back, with a microkernel in Rust, it would be quite nice, but yeah, I guess that is more of wishful thinking.
With Rust, the burden of checking all of that is shifted to the compiler, and that reduces cognitive load for the developer.
Anyone that cares about memory safety for userspace applications has already moved on into other languages, the problem is the foundation and those that resist no matter what.
Also the data races prevented by Rust type system only apply to multihreaded code accessing in-memory data structures, there plenty of other data races in multiprocessing scenarios.
Safe rust prevents data races at compile time. It doesn’t prevent other race conditions.
And “only” preventing data races, is still a non-trivial achievement!
Yes it is a non-trivial achievement, just I get the feeling that the advocacy for it tends to forget about the other ones.
By the way, John Regehr's example won't work if the transferXXX functions are using SQL statements without transactions across threads each with its own connection, instead of in-memory variables.
Learning for the sake of learning and betting on it for employment and professional use are very different beasts.
This is what companies are paying big bucks for, immediate competency and productivity.
For example Hibernate for Java ORM, Spring as the big Java "LEGO brick bucket", Rail for Ruby web development, etc.
It's a compiled language built partially in Rust, being rewritten entirely in Rust, JIT compiled using HHVM: https://hhvm.com/
I don't believe it's compatible with existing PHP codebases, but you could probably convert one over, catching safety issues while you did it.
Hack a modern and highly productive language that's in many ways as nearly sophisticated as Rust. (How many other languages have both opaque and transparent type aliases, for example? https://docs.hhvm.com/hack/types/type-aliases ). It has a mature async/await system, for another example. One feature it's missing is the macro system that Rust has, though.
Do you want to work in systems, embedded, etc? Rust is almost certainly (at least a large part of) the future
Web servers (at the application level)/native apps/games? It's gotten some traction, but the jury is still out
However, it has attributes that match it extremely well with function as a service where memory usage, cold start times, consistent execution, and compute costs are major factors.
It’s extremely well suited to that environment. I expect to see it thrive here once some aspects of rust settle down further.
The good news is that the microservices trend makes it easy to optimize the "hot services" with a different language than what you use to throw together all your normal services.
Rocket's DI and middleware layer with serde, validator, Rust's error handling, etc really take the pain out of the whole affair. That said I wouldn't recommend it until the ecosystem matures and stabilizes unless you really like updating lifetimes all over rocket libraries every few months.
Can you name any design wins for Rust in a product's embedded SW, embedded OS, or device drivers? I've never seen it in the wild. How does Rust deal with hard RT?
I'd be interested to see what people had to say.
There is "Working Group" dedicated to the domain: https://www.rust-lang.org/what/embedded & https://blog.rust-embedded.org/newsletter-28/
Toward the bottom of the page there's a "Production use" section with some quotes from people @ companies using it.
There's also an Embedded Rust "book": https://docs.rust-embedded.org/book/
In addition to the language itself, the surrounding tooling (e.g. for package management) contributes to the potential wins available from to moving to Rust.
My impression is that there are still areas where there isn't yet an idiomatic solution as to how _best_ to represent certain embedded SW concepts in a way that allows Rust's guarantees to be maintained. So I think there's some churn around that as people experiment/learn. (Primarily in relation to some of the physical constraints of the hardware.)
One of the companies prominent in the Rust embedded space is Ferrous Systems: https://ferrous-systems.com/
While it's still early days, relatively speaking, I think a lot of people see a move to Rust as a "once in a generation" opportunity to finally move on from an embedded ecosystem built on substandard vendor C toolchains & also gain from the robustness/safety that Rust offers.
In a lot of ways the embedded domain stands to gain even more from what Rust offers because unlike, say, the desktop/server space there isn't another higher level language that's really an option.
I'm fairly early in my Rust learning journey but have played a bit with it on an STM32F7 dev board. But so far have spent more time on non-embedded side of things.
(Although one of the appealing aspects of Rust for me is that I can use the language on platforms ranging from embedded to server/desktop to the browser (via WebAssembly). And the knowledge is transferable & even a lot of the library support too--thanks to "no_std" packages/crates that have reduced overhead.)
As an aside, while learning off & on over an extended period of time, I've found this post really helpful for (re-)learning how to read Rust: https://fasterthanli.me/articles/a-half-hour-to-learn-rust
The post aims to go "through as many Rust snippets as I can, and explain what the keywords and symbols they contain mean" which I've found a useful approach.
Which, again, this is maybe self-serving, but it really feels like a incredibly good long-term investment to learn. Even if you don't end up using it professionally (somehow) the compiler teaches you how to write better low level code.
The answer is almost certainly: no.
From a career standpoint, you would be better off learning C/C++ in much more detail before investing time in Rust.
If you want the "canary in the coal mine", watch what the game developers use for the game engines (they mostly use C++ right now). When Rust starts becoming common among game developers, it's got enough momentum for a job ("career" is probably a bit much).
However, even when Rust hits critical mass, it's unlikely to be a "career choice" programming language--you will have to know Rust AND <something else more important>. The world has changed, and "One Language To Rule Them All" is no longer a thing.
C, Java, Python, C++, Javascript, C# are going to hold the top 5 of programming languages for the conceivable future. Not matter how good Rust is it is not going to displace C and C++ on any reasonable timescale--inertia is a thing. Swift and Visual Basic have their niche and nothing is going to blast them out of it.
After that, it's pretty much a free-for-all in terms of language popularity, but everything is tiny at that point.
I don't see why the entertainment industry would be any more important to pay attention to than any other tech-adjacent industry, such as finance, health care, transportation, etc. If anything, the short-term focus on the next title means that the games industry tends to be relatively late adopters of experimental core tech: witness how more quickly tech companies adopted C++11 as compared to game studios, for example. (This is not to criticize entertainment's conservatism with technology choices: it's a tough business and they are understandably risk-averse.)
The vast majority of "programming" in finance is finding something to model that is relevant. And that's Python, R, Julia, etc.--all the exploratory tools. Nobody in that space has even heard of Rust.
Many people are very interested in Rust right now for HFT: C++ is nothing but pain and causes tons of problems.
Um, precisely?
Game programming is hardware-bound and short-term focused. Consequently, if Rust is generally superior to C/C++, it will spread very quickly. This would be especially true in games that have a much higher networking component (where the memory and security guarantees start to matter more than just the raw engine performance).
Rust is a systems programming language. It is meant to extract efficiency/performance out of hardware. If that isn't your raison d'être, then using a systems programming language of any flavor is counterproductive.
So, the problem is that Rust doesn't really compete in "general programming"--it competes mostly in "systems programming". And it has to displace competitors that are mostly "good enough". And it can be done piecemeal so that you don't have to port entire codebases all at once.
None of that is a recipe for fast change. And THAT'S PERFECTLY OKAY.
Now, all that having been said, the wildcard in all of this is WASM. Rust support for WASM has been stellar when everybody else's has been hot garbage. WASM could be the thing that lets Rust break out of just the "systems programming" niche. That's a big hypothetical, though.
On a related note, Embark Studios who I mentioned above, just announced they've joined the Bytecode Alliance, an WebAssembly-focused non-profit: https://twitter.com/repi/status/1387393289847025669
The announcement mentioned the use of WASM to help build "...a future of software & creative game worlds that are not limited walled gardens where only we / the devs can add new capabilities or features, want to build an open ecosystem of interconnected software & game components that anyone can use & create with".
Essentially, Rust+WASM as a future for player-driven modding/customisation.
This is an area I've been exploring in my "WebAssembly Calling Card" project which enables people to create cross-platform personalized dynamic image avatars implemented in any language which can compile to WASM: https://wacc.rancidbacon.com
I've integrated WACC with the Godot game engine, Rust GUI viewers and the browser--they all use the same avatar ".wasm" file (with examples currently written in C & Rust).
I'm happy to see all of this, but, again, the question was about career in/for 10 years. And Rust just isn't going to be that.
Rust is, for example, far behind in terms of market penetration where Python was at a comparable age. This is unsurprising. First, Rust is nowhere near as broad spectrum as Python--so it's domain of applicability is much more constrained. Second, Rust is coming into a full ecosystem that Python didn't have to contend with.
Python was basically the only respectable person at the scripting language job interview in the late 1990s--Tcl and Perl both decided to start huffing glue in the middle of the DotBomb era while Sun tried to jam Java everywhere it didn't belong and left a lot of greenfield areas to Python. Rust doesn't have the "advantage" of that level of incompetence in its competitors/alternatives.
And, while I'm fully aware that Python and Rust aren't really in the same space, I simply chose Python because it's one of the only popular languages that is relatively "new" (if you can call something from somewhere in 1989-1994 "new") and didn't come upon its popularity as a mandated parasite attached to a much bigger host (looking at you: Swift/C#/Javascript).
On this front two relevant data points are:
* Embark Studios: https://medium.com/embarkstudios/inside-rust-at-embark-b82c0...
* Ready at Dawn Founder/CTO: https://twitter.com/AndreaPessino/status/1021532074153394176
Also, there is a specific Rust GameDev Working Group: https://www.rust-lang.org/governance/wgs/gamedev
You can find all kinds of languages in game shops, including custom Lisps and the like, so finding Rust too is a given.
But I think the spirit of the parent was to check what game studios start adopting "en masse", not whether this or that studio has adopted a language.
Depends on who you are I guess. :)
> appears to be some small company in Sweden
According to[0] they're currently around 200 employees and the founding team includes former CEO of DICE (+ex-EA) & other experienced industry people.
They're funded in the large tens of millions range: https://www.pcgamesinsider.biz/news/69461/nexon-increases-st...
So, basically, they're a bunch of experienced game industry veterans funded with a bunch of money & a clean slate to choose their technologies--and have made Rust as one of their prime choices. (Although I note they're using Unreal for their 1st game, so not sure how much of the Unreal-related dev they'll be doing in Rust.)
> doing 3-4 different things (aside from games) to get by.
Curious what gave you that impression?
[0] https://medium.com/embarkstudios/our-continued-journey-89dad...
C++, C++, C++, C++, C++, C++, Rust (for security), (Go, JavaScript, Python and Rust).
The Rust stuff is all confined to the back end where security matters--no engine stuff.
Ready At Dawn got bought, so it would be interesting to know if that still holds as they are owned by Facebook who is Rust-positive.
We could be an outlier, but if there are enough D jobs going around (Often very well compensated), you shouldn't have a problem with Rust.
The industry wants to start using it but can't find dev with commercial x years experience to have the confidence to invest in it and the developers can't get professional experience because they can't find a job in rustland yet.
This doesn't happen in PHP due to the age and spread of the language (for better or worse).
So I think it's a timing issue. If the language is solid and solves a problem uniquely and is well received where it is used (and not just some freak example in a company somewhere with a blog post "we use this and it's the best!") - it will pierce through after X years.
I'm not sure if there's a .NET-compatible implementation or interop but it'd likely take over C# as well if so, if Microsoft decides to invest in it. They have pretty good languages like F# already but Rust is designed around zero-cost abstractions and avoids the garbage collection penalty that comes with running on the JVM or .NET.
Rust offers performance, type safety, memory safety, and metaprogramming that are provided by few other (largely academic) languages, while permitting multiple programming styles and escapes from those restrictions when you need them.
On the other hand, I don't think the Web-oriented languages will go away unless someone develops a variant of Rust or Rust framework intended for building websites. However, for everything else that's not running inside a web page or supplying the content in a web server, I think we'll see a gradual transition to Rust; the web server will be in Rust; the JavaScript compiler will be in Rust; the browser will eventually be in Rust; and so on.
If Rust ever gets a good GC it might very well replace VM languages. But even if they started now, it would take years.
Rust also has long compile times. Java and C# projects, even huge ones, build in a couple seconds because compilation is done in JIT. Go is AOT but sacrifices some performance for fast compilation too. It's important for a general purpose language where performance is not #1 concern but maybe #2 or #3. Same story as GC. Sacrifice a small amount of performance for convenience. That's not what Rust is designed for.
Rust is positioned as a systems language to replace C dialects and it that I think it will be wildly successful
On the cmdline, rustc displays gorgeous error messages — easily the best compiler error messages I’ve seen from any programming language — and Cargo is a dependency manager and build tool without equal. The Rust ecosystem in general is already quite large. Although I’m a neophyte at coding Rust, I haven’t run into an error message yet that StackOverflow or Reddit didn’t end up resolving.
On paper, Rust saves companies money by eliminating the memory safety bugs which would otherwise show up in C/C++ code. At the same time, Rust’s developer tooling ends up being so ergonomic to work with, and the language sufficiently expressive and flexible, that I can see Rust competing in areas beyond those reserved for C/C++.
IMO Rust is basically OCaml for the 21st century. My bet is on Rust usurping C/C++, and I expect Rust’s rise will be nothing short of meteoric over the coming years. The involvement of Facebook, Amazon, Microsoft and Google in the Rust Foundation bodes particularly well for this, as do informal surveys of developers which consistently show tremendous grassroots enthusiasm for the language. Just my 2c: but bet on Rust, bet heavily on Rust, and bet on Rust immediately, without delay.
If Rust got a much larger adaption, then there will be many more people learning it then Rust skill is hardly a special thing.
If not, a less-adapted language will never pay you with the top market rate since it is not used by most people.
So what really matter is the size of total programmer market.
On the other hand if you're more of a generalist, I'd say stay with popular technologies such as Python, JVM and .NET. You can't go wrong with any of these for the next 20 years.
PHP has been making strides lately with JIT, Laravel and proposals for generics. So staying on it shouldn't prove a bad choice either. But if you're looking for greener pastures while maintaining great employability, my personal bet for the next decades is .NET/C#. And it tends to pay more than PHP on average.
In Europe (and especially in Germany where I live) I don't see myself writing Rust in my day job for years to come (already twenty years in). Not because it's technically impossible or Rust is inferior, but simply because it seems to take decades for european/german companies to accept or at least try new ways of doing things.
Mind you, I'm not talking about startups (we don't have THAT many in Europe/Germany in the first place). Also, those are (mostly) web stuff companies.
Warning, unpopular opinion following.
I think HN is not the right place to ask this question. You will find a dev crowd here that is nothing like the big, quiet dev community out there in the real world. Most people here love trying new things (languages, frameworks, you name it I've tried it).
So don't base your conclusions on those answers alone. Talk to regular devs (those who say "Hackers News? Never heard of it."). Because those people set what will be used in companies.
EDIT: Corrected spelling of quiet.
"learn to administer microsoft tools, like active directory and exchange."
Probably 60-80%+ of the software developers and sysadmins out there :-)
https://developer.arm.com/tools-and-software/embedded/arm-co...
In my specific case it would already be enough if the the two big ones (Keil & IAR) would provide a compiler.
If this obstacle vanished, the situation would be totally different here.
I am not sure about what you said. Big companies are risk-averse, but that could play in Rust's favor. Some employees who are a few years short of retirement might push back on it, though.
So at least some German companies are slowly looking into it.
However I fully agree with your post.
That domain is already more than coverered with languages offering AOT/JIT compilers, managed memory (in whatever form), very nice tooling and ecosystems with libraries for about anything.
C is extremely painful. C++ is a shitshow. Rust is glorious in comparison.
Rust, or something like it, will definitely replace C/C++ someday. And rust has way more traction than anything else
I'm always amused by the contortionist double-speak of Facebook communications. They put so much effort into distancing themselves from Libra when they launched it, but now they have a chance to take some credit for the work behind it, all of a sudden it's a kinda-sorta Facebook project.
Totally off-topic but I can never resist a jab at Facebook.
Anyway – great news for Rust. Despite my distaste of FB, I can't deny the value of their open source contributions.
https://github.com/facebook/relay/issues/3180
Personally I've had trouble with the Relay compilers watch mode not picking up file changes but that might be a Watchman issue not a Relay compiler issue.
If you don't have local (or maybe now vitual?) meetups to go to, write a blog post about it and post it to HN and put a single sentence "I'm looking for a job that lets me write Rust professionally" note at the bottom, you never know who's going to see it.
It's not so okay if you're trying to write something you expect other people to be able to compile and run.
Stable rust hasn't broken in my experience.
And don't go saying I should use rust-up. That's a symptom of the very problem I'm describing. What other compiler is only usable if you install from some website instead of your repos? I can't think of any.
Edit: Just re-read your comment. Maybe ping the guys in Debian to update their repos?
Hard to see this as a problem with the language per se. What is the language supposed to do, ship working features but ask people politely not to use them? Not ship new features even if they solve acute problems?
As a library consumer, if you want you can just stick to >6 month old versions of all the libraries you depend on, and they should work fine with your 6 month old compiler version.
Eventually maybe in 5 years Rust will have it's major pains solved and things slow down a bit. Maybe then the release schedule will actually change as well? Who knows
As for major language features I remember async await from a year ago, const generics recently and that’s it. If you can remember more features that fundamentally changed how we write code, please let us know.
I don’t think many features are expected in the near future apart from maybe generic associated types. But not any time soon either.
I think you might be seeing releases every six weeks and assume that each of these bring massive changes. They don’t. Each is a small iterative improvement. Take a look at the Rust release notes if you like.
Custom allocators and anything else required to build bare-metal software.
Compiling Rust itself, especially std::core. I hit that wall when trying to cross-compile using stable Rust that came with my distro.
Eventually the Rust dev community will grow enough to have non-language-specific-enthusiasts devs as a majority and it will slow down and begin to target actually stable releases. But as of now you have about 5 months functionality per "stable" release.
You live by some principles. Most people don't care about the principles you seem to care very much about. Most just have problems that need solving and Rust is the best tool for solving them. If the tool works differently to how they are used to working, they adapt and get on with their lives.
Just because they can doesn't mean you can. They solve Google problems.
And they use Rust to solve specialized problems because at their scale it is worth squeezing every advantage.
For mortals like you and me most problems should be faced with a completely different mindset.
I'm addressing your statement that says a language is of general use if used by the likes of Google and Facebook.
They have infinite amounts of enginering and very special problems to solve. What makes sense for them often does not for smaller teams solving trivial problems.
> Strange how a language according to you is unsuitable for general use. Yet it is used by Google, Facebook, Apple, Amazon, Dropbox, Microsoft, Mozilla, Huawei, etc.
For example, as I understand it the rust compiler team literally compiles every public crate with each version of the rust compiler to make sure they haven’t broken anything. The platform generally expects users to mostly keep up to date - as a web developer I can now use new features in chrome and FF within a month or so of the feature being released. Gone are the days of leaving behind large swathes of users because they’re still using FF 4.0 or IE 6. Nodejs has its own support table. I don’t care what version of nodejs Debian LTS has; when version 8 of nodejs stopped being officially supported and maintained, I immediately dropped support for it in my npm packages.
The “minimum supported rust version” flag in cargo will help with this going forward. But more generally I think this model of software development makes sense and we’ll see it more and more going forward. There was a kernel bug a few months ago caused by a bug in an old version of gcc. The gcc bug was fixed years ago but the patch was never backported to ancient gcc versions. Some distros were compiling Linux using ancient gcc versions, and then got upset when they ran into problems. The answer here is for gcc to say the same thing nodejs does - “these versions are supported and get bug fixes. These versions do not. Use old versions at your peril - they have known bugs.” Explicit support periods is better than vague, ambiguous expectations that software will work forever. Microsoft has the same policy with windows patches.
I think the era where it makes sense for apt to carry that burden by serving us ancient software packages is slowly coming to an end. As software packages take responsibility for evergreen stability, it also makes sense for users to get evergreen software. It would be nice if we could do that without needing app specific version managers like rustup and nvm.
https://wiki.debian.org/Teams/RustPackaging/Policy
If you restrict yourself to packages in the repo, won’t that resolve the issue? The idea of a distro is that all the packages in the distribution should play nicely together, but if you go outside that then version compatibility won’t be handled for you.
Debian's policies are simply incompatible with the Chrome-like "evergreen" release model that Rust uses. I feel sorry for anyone who tries to use Debian's Rust. It is an awful experience.
- you will only use an old compiler because that’s your preferred source of installing tools
- you will only use the latest and greatest packages that require the newer compilers.
And this is somehow the languages fault. The language needs to fix the problem of library authors using language features? Seems to me like it’d be easier for you to relax one of your two requirements. They’re fundamentally incompatible.
The second problem is that even if 90% of your dependencies support older compilers, it doesn't matter, because the 10% that insist on newer compilers will still break. It can be a single dependency, and you usually have hundreds, with vastly different policies.
There are solutions to this problem, like MSRV aware cargo. They just need someone to implement them (as well as someone to compute MSRV numbers).
I'm just not sure how what you're describing would work.
Safety-critical systems may need these guarantees, but I object to them externalizing the costs they need to bear on the whole community.
Almost everyone should be on up-to-date compilers, assuming the compilers promise that they won't break old code. The more we move towards that world the better.
However there is hope for a better future: https://github.com/rust-lang/rust/issues/65262 will allow crates to specify a minimum supported rust version (MSRV), this way, we can imagine cargo resolving algorithm taking the installed rust version into account when picking the version of a crate to download so it would pick the last version of the crate that still compile on your system.
Another thing is the Sealed Rust / Ferrocene initiative [https://ferrous-systems.com/ferrocene/]. The idea is to have a version of rust supported for a long time, and it is likely that many core crates from the ecosystem will decide to keep compatibility with that LTS version.
The recommended way to manage your rust installation is rustup. It makes it trivial to set up and manage tool chains, globally or otherwise.
> what other compiler is only usable if you install from some website instead of your repos?
What compilers' recommended installation is some 3rd party package manager that lags behind the latest stable release by months?
Rustup is a useful tool, it's dumb to ignore it.
And this is a terrible development that we should all try to resist, as it leads to a combinatoral explosion of dependencies and problems, as soon as you introduce another language. So then we end up using docker to encapsulate things because they are hard to manage on one box.
It just seems crazy, but I don't really have much of a solution, tbh. Perhaps we could just install the build tool (in this case rustup) for supported languages and stop trying.
If all of software respected those assumptions then we wouldn't need containerization nearly to the degree we have it today.
I mean, I know how to handle it, but it's pretty depressing that I need to do it, when in the past one could rely on relatively recent versions of everything existing with a system package manager.
I always need C/C++/Java dependencies in DS, so maybe I just feel the pain points more.
Modern package management in a nutshell is "don't do what we do in C because we learned from those mistakes."
If you had chosen a rolling distro like Arch, you wouldn't have to use Rustup.
Lets see... i had this problem with python all the time, the system python version was notoriously old and out of date on macos, redhat, debian, etc. This is how pip and pyenv and a dozen other tools were born.
Similar things with node. Or when the distro gcc has a bug that your code hits. Go has this problem too - e.g. the pain around moving from nothing -> dep -> modules was real (if not widely publicized).
The language provided version/package manager solves a very real problem. That problem is a mismatch in what a system package should be vs what a development package should be. In some sense containers, nix/guix stye package management, and language specific dependency managers are different approaches to solving the problem: what my computer runs for daily use should be relatively stable and generally I won't need the latest and greatest package features in software I use - upstream developers have generaly dealt with various library deficiencies bugs in their dependencies. In software I develop though, I regularly hit api bugs and sure would like to just use version+1 instead of spending time developing around it. Particularly when the output of my development is a binary that is running in a container on some server.
You're talking about using a current compiler to build old code, aka, backwards compatibility. We put a lot of time and effort into this, because it's important, and we're not perfect, but we're pretty darn good at it, it seems.
The parent is talking about using an older compiler to build newer code, aka, forwards compatibility. Basically no programming languages I'm aware of provides this today, but they release on a much slower schedule, which means that in practice, it is likely to happen less often. Because Rust ships so often, and because it's so easy to upgrade Rust, the community tends to adopt newer features faster than in other language ecosystems, meaning that forward compatibility becomes more of an issue if you do not want to update the compiler.
What's not well expressed is that is that certain releases prompt a bunch of people to upgrade the newest libraries to require the latest stable release. And these releases are not easily visible or predictable from outside the community. This is driven by Rust releases that stabilize significant features; I'm talking about stuff like async, min const generics, impl trait, proc macro support. So support for older releases tends to wax and wane depending on how recently a big feature was stabilized.
There is one other contributing factor - cargo tries to pick the most recent version of library (that's SemVer compliant), not the earliest one, and MSRV changes aren't at this point considered a breaking SemVer change (as far as I know)
The idea in the root comment that it's somehow outrageous that a compiler for version N of a language can't compile versions N+M is ... strange.
PS I love your book :)
Node.js went through similar rapid development of the runtime as Rust is with the compiler. Node's package.json includes an "engine" field to indicate which runtimes are supported from which version, so NPM could immediately tell you if you were trying to use a library for a newer Node version than you have installed, and could automatically downgrade to an older version that still supported your Node version, if one existed.
That eliminates much of the pain of using libraries by others that are sticking to the latest release of the language.
But it also encouraged library authors to try to push that supported version number down as far as they could, because that would juice adoption of their library in the wild, further making forward compatibility less of an issue. (This isn't exactly apples to apples since most of the advances in Javascript the past decade have been syntactic sugar, not new powerful features, and there is a hard split on async/await versus callbacks as that was more of a feature than just sugar.)
In Rust, if libraries could broadcast their minimum Rust version in their crates, and treated changing that as a breaking change (major version bump), and were open to backporting features onto prior majors (for the bigger, important libraries), there can be a rolling drop-off of older versions of Rust instead of hard, unpredictable dropoffs.
> because that would juice adoption of their library in the wild
That requires a lot of people to be using older versions, that is, it assumes there's an audience of people who are interested in using older Rusts. But we don't have that in Rust, even if it was that way with Node. Look at this chart from our survey last year: https://blog.rust-lang.org/images/2020-12-rust-survey-2020/r...
There isn't a huge audience to get adoption from if you support a wider array of versions; the vast majority of users seem to be using the latest stable.
> and treated changing that as a breaking change (major version bump),
This is controversial, because in some sense you're not wrong, but this also creates a lot of churn, and churn that doesn't really have to happen. In a model where most folks target the latest stable, you're creating tons of work for most of your users, at the expense of making things slightly better for a very small number of users.
So I would cite the classic statistics example of adding armor to the parts of returning aircraft that weren't shot up: https://worldwarwings.com/the-statistics-that-kept-countless...
That survey (that I wasn't aware of despite using Rust) likely self-selects the most enthusiastic users of Rust. There could certainly be a large number of other users, or potential users, that would answer things differently.
> This is controversial, because in some sense you're not wrong, but this also creates a lot of churn, and churn that doesn't really have to happen. In a model where most folks target the latest stable, you're creating tons of work for most of your users, at the expense of making things slightly better for a very small number of users.
I don't agree that it's that much extra work? As a user running `cargo update` should be enough and the versions increase. If cargo refused to update to a version beyond the currently installed `rustc` version, then this should be completely safe on their end.
Then the library authors can either do what they currently do and not backport features/patches for earlier Rust implementations, or they can if they want to support those users (so no extra work is required), but now it's very clear to them (based on download stats on crates.io) how much demand for prior rust compilers there is, and they can decide if they want to provide a stronger backwards compatibility for their library, and the users can tell based on the semver releases for the library if that library supports older versions of `rustc` or no.
This is still personally one of my more minor complaints about the Rust ecosystem. It's still far better done than most other major languages, and the current state of Cargo/crates.io was a major factor in our picking Rust over C++ for the project we're using it for. So this is a critique because I do actually care about this and see how it could help both adoption (less worry about "what's the right version of Rust to use?" for newbies) and long-term maintenance (if you can't come to a project a few months later and install any security fixes because there are library changes that require you to upgrade your compiler and there's a cascading set of dependencies-of-dependencies that make that riskier to do, so application-level developers may not want to jump on such a "treadmill").
> As a user running `cargo update` should be enough and the versions increase.
They would not increase, because that would be a major version change. To do that, you'd have to go into your Cargo.toml and change the version number there. This would also be true of all of your dependencies. Major versions, while Rust can have two of many of them in tree (but notably, not ones that wrap C libraries, for example...) can still work, but like, then you have two copies until the long tail of your dependencies updates, and maybe by the time that happens, it's bumped again in your code.
> So this is a critique because I do actually care about this
I totally believe this! It's also possible that I am not right, just my take on what you're saying, that's all :)
If you have some reason to not update your compiler, then don't use those new features, and use dependency versions that also don't use those features. Go back a few releases if you need to.
If you do need those features though... Then just upgrade your compiler?
I'm not aware of any compilers/interpreters that work the way you want here. Maybe Python 2 for that painful decade of overlap...
But the Rust experience IS cargo. No (other) package managers.
Rust is cargo centric. With it, you are free to pin to versions and keep things working for very long.
BUT
also if you are coming cold to any library is to be EXPECTED to be "new". This is a good thing: The community at large move forward in tandem as if it were a coordinated army!
But that don't mean I can't work with older code, is that if you see a crate RIGTH NOW you see te forward momentum at large. If you wanna use something older you can pin to a back version.
However, this also point to a fair problem: Is not easy to correlate to which version of Rust each crate(version) relate to.
Compiler changes are tested against a bunch of libraries in the crates.io repository to ensure nothing breaks. It's just exceedingly rare that a new Rust version would break older code.
The promise is that if you have code you didn't touch for a year, you can update Rust, and it will still compile.
You got it backwards.