Rust as the New C Part 1: Building and Combining Native Libs into C API
hotforknowledge.com
hotforknowledge.com
Really? That seems odd to me. I guess there's some overlap between the two languages but they mostly exists in different spheres.
C++ would be the more obvious comparison.
The reason it attracts Python programmers more than Java or C is because anyone who would leave for the language features left already. If you didn't like Java you'd be using something else already. There's so many options in those domains. On the opposite end, you're likely working in C because you needed to, GCs typically don't fit into those same uses.
But in terms of the niche it occupies in the whole programming ecosystem, it's rather different. Its straighforwardness makes it easy to pick up, and as you note, it has become a popular choice for dynamic language programmers who either want a fast, typed language as a second language, or who want to move on from their current language altogether.
Examples of Java AOT toolchains since around 2000: Aicas, Aonix, JET, PTC, Websphere Real-Time, gcj, Embedded JVM, Gemalto, J/Rockit.
Not all of them have survived to this day due to multiple reasons, mostly business related, PTC has acquired Aonix, gcj was abandoned when OpenJDK was released, and JET has given up their business as of this year, for example.
Likewise on .NET side, it was shipped with NGEN since version 1, Mono/Xamarin uses AOT for iDevices, Sony and Nintendo consoles, Unity AOT compiles via IL2CPP, Windows 8.x uses MDIL which produces AOT binaries on the Windows Store, Windows 10 has .NET Native, with CoreCLR and .NET going to get merged in .NET 5.
Also Singularity and Midori only used AOT mode, making use of MSIL just like LLVM uses its bitcode.
So yeah, just lack of information.
"I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++."
He later writes:
"Python and Ruby programmers come to Go because they don't have to surrender much expressiveness, but gain performance and get to play with concurrency.
C++ programmers don't come to Go because they have fought hard to gain exquisite control of their programming domain, and don't want to surrender any of it. To them, software isn't just about getting the job done, it's about doing it a certain way.
The issue, then, is that Go's success would contradict their world view.
And we should have realized that from the beginning. People who are excited about C++11's new features are not going to care about a language that has so much less. Even if, in the end, it offers so much more."
In a company with funny interview games that even some Phd aren't able to tackle.
For that kind of programmer, “more speed and easier deployment than Python/Ruby, less type-system incantation than Java, and more type-system value than C, with a decent concurrency system that seamlessly exploits available parallelism is a pretty compelling story, at least for some uses.
But each of those features (and most combinations of them) are less surprising with broader experience, because they aren't all that uncommon, and Go is far from the best example of any of them, or even many useful combinations (not sure it's even the best example of all of them in combination.)
And of course, C# and Java also have overhead.
Actually I'm not sure if that is possible now to call Go from C via some C ABI/ABI. I looked into CGO in the past.
Go and Rust don't overlap/compete enough to be interesting comparisons, especially considering how often the comparison comes up
Rust has brought high-level language features, like memory safety, data race free, and an advanced type system to a low level space that didn’t have a great option in place (yes, there were other options, but none ticked all those boxes so elegantly). Rust keeps gaining traction in this space because of all those features.
I’m all for languages finding their niche, and Zig might end up attracting C programmers in a way that Rust doesn’t. That would be great, but the difference with Rust is that it’s attracting programmers to a space where they wouldn’t necessarily have gotten involved before. It’s that fearless mentality, and it’s helping expand the numbers of devs working in this area, and that’s a really good thing. Enabling people to do really great things without worrying about sharp edges and unknown issues, is pretty great.
Edit: Rust libs can be used to interface with C, but so could other languages. Porting the huge amounts of system software is near impossible task.
Personally I think Rust is competing with C (and C++ as well as Go) in the "systems programming" sphere. It isn't a competitor to C's "portable assembly" history. It's a far more FP-esque approach to systems programming.