by platinumrad · 8y ago · 0 comments
https://github.com/docker/libnetwork/issues/1113
https://github.com/docker/libcontainer/tree/master/nsenter
https://www.weave.works/blog/linux-namespaces-and-go-don-t-m...
EDIT: TIL this is fixed in Go 1.10 which came out in February: https://golang.org/doc/go1.10#runtime
If rust continues to improve ergonomics and library support, I don't see anything stopping it from replacing C except in niche embedded systems that don't get LLVM support.
It is a network effect, regardless of how one might think about Go.
The fact that Docker and K8s are written in Go, doesn't provide anything for anyone considering to writing new container projects...
Trying to avoid Go in such scenarios is a futility.
I expect rust to encroach on those quite a lot, as well as less system-y C code (such as utils).
It's still early days. Rust is showing a lot of promise, for me personally, when writing high performance web services.
If having a high profile industrial backer makes a language not niche then OCaml is not a niche language. (I wish this were the case.)
I used to write a lot of C++, every team I worked on always had a problem finding people who could write native code well, I'm pretty sure that hasn't changed in ~3 years or so. Why does something have to be wildly popular to be considered successful? I've found most of this industry is more about using the right tool for the job then trying to fit one language into every domain space.
That said I think there are a few places where you'll see Rust really succeed in the next 3-8 years:
1. Domains that have hard memory or performance constraints. Rust matches C/C++ for performance(and I say this as a hardcore C++ perf nut) but without the segfaults/corruption(unless you step into unsafe land).
2. Products that need to go to multiple platforms but can't afford a GC. Rust has by far the best cross-platform development story I've seen in a natively compiled language. I've personally build things that run on WASM/Win32/OSX/Android/Linux across a wide range of hardware and embedded in C#/Java/C++/C.
3. Places where safety/memory corruption is unacceptable. You just get less of these from Rust, full stop. Yes you can do it in C/C++ but you better be willing to have a QA org larger than your dev team.
Firefox is a perfect example of how these various concerns intersect. I used to be a serious C++ developer working on high performance, memory constrained platforms. In the past two years anything green field for me has been Rust based and I've been 100% satisfied. In both personal projects and some professional work Rust has never come up short.
Is it hard to write? Sure.
Do I spend less time debugging/tracking down mem corruption/dealing with poor ownership?
Hell yeah.
>What makes you think that the languages which Rust displaces aren't also niche?
Any definition of "niche" that includes C or C++ is meaningless.
Thus I can easily see rust replacing C/C++ as the default language for writing 'high performance libraries' in, for use in Ruby/Python/etc. It's usually more similar to what higher level programmers are used to too. You get to use functional code for a start.
But also exactly as in Firefox - libraries / modules can be written in Rust, and then brought in to replace existing C++ code. And I'm sure the ergonomics of this process will improve too.
If a C++ project lead / manager can say, in all honesty: "The x component needs to be re-written for whatever reason - either major refactoring for a desired feature, or performance, or to split out to use in another product. We can either do it in C++, or Rust, and Rust will garentee no new segfaults, we can trivially parellelise a lot of it for improved performance, etc. etc. with no major disadvantages..." then Rust will inevitably grow.
If you want full function? Just don't pass/use anything that's mut.
Need to break that contract for performance? You still have single-ownership which gives you 90% of the above but with no performance penalty.
You still get logic errors/etc but it's a great no-compromise solution when you can afford the time to get your ownership right.
Heck, if it is that small, but has that big an impact, that’s saying something good too, isn’t it?
I don't believe that Go or Swift are growing because of their technical merits. Swift is essentially forced by Apple upon any developer who needs to develop applications that run on Apple products, and Go, in spite of its pedigree, can't be sold to newcomers without waving the Google brand.
> Widely displacing C is a pipe dream.
For old projects, sure. Yet, for greenfield projects then, given the choice, Rust does offer quite a lot of sought-after features that C is sorely lacking.
It's also a very good language, in par with Rust, and with the creator of LLVM behind it, and the creator of Rust (and many other Rust people) working at Apple in Swift.
>Go, in spite of its pedigree, can't be sold to newcomers without waving the Google brand.
And yet, Dart never got anywhere, despite the "Google brand" (and far more support initially, including official branding, an IDE, and having their #1 compiler guy working on it).
Displacing C for new projects though, it's not.
And it has increasingly done it for major projects from major companies (not just Mozilla).
This is already great for such a new language.