234 points · by tomduncalf · 5y ago · 178 comments
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.
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.
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.
"learn to administer microsoft tools, like active directory and exchange."
Probably 60-80%+ of the software developers and sysadmins out there :-)
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.
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.
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.
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.
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++.
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.
Job postings are the fucking worst.
Learning for the sake of learning and betting on it for employment and professional use are very different beasts.
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.
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
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.
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.
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.
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.
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.
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
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.
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.)
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
If you had chosen a rolling distro like Arch, you wouldn't have to use Rustup.
Edit: Just re-read your comment. Maybe ping the guys in Debian to update their repos?
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.
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.