by lacker · 7y ago · 0 comments
I think of Go as more Java-like than Rust-like. But even that’s a hard comparison. Really, Go is C-like with a garbage collector for memory safety.
Rust is Java or C++-like with a strongly typed compiler, support for generics (not Go), lifetimes for memory management and no GC (closer to C++), and a type system that enforces some constraints around concurrency. I guess they are similar in that they both (by default) create static binaries, but so does C and C++ (if you want).
Rust and Go seem to get lumped together because they both came on the scene around the same time, but that is pretty much where the comparison ends.
That, and that the golang authors at that time claimed that it was a "systems language". They would later go back on that by attempting to redefine what "systems language" meant.
Examples in production, gVisor, Android GPU debugger, Biscuit and other research OSes, tiny GO for embedded targets, compiler development.
I don't think it has to end right here. It's definitely true that Rust has a much stronger type system and is more suitable for some kinds of applications (super-low level, libraries, things were we try to avoid allocations, etc.).
However there is a certain set of applications for which both languages are well-suited and potentially more appealing than the other mentioned languages (e.g. Java, C#, Python, etc). Those are applications were we want to have a low memory footprint and ahead of time compilation (to improve startup times and to avoid having to ship also a big VM). Command line applications or daemons fall into the category. And we can definitely see both Rust and Go gaining tractions in those domains.
Both Java and Python have (limited) implementations for time-sensitive microcontrollers: Chances are high your SIM card or your chipcard is running Java, and I believe Python (MicroPython) is also in active use on some SOCs
Naturally they are special purpose versions and not a OpenJDK dump.
That would be D, .NET Native or AOT Java.
https://luajit.org/performance.html
There used to be some great benchmark comparisons including luajit on the programming language benchmark site[1], but I swear that site has gotten worse as time has gone on.
[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/
Even — sucks because it doesn't show LuaJIT — would tell us more than "gotten worse".
* There used to be more languages and runtimes shown.
* The site makes decisions for you about which languages you want to compare, whereas before it used to give the user more power. It used to be easier to compare arbitrary languages with each other. I think you could see the "How many times slower?" graph on individual language pages, but it has been a long time since that was on there.
* Related to above, it seems like it changed to be a more mobile-friendly format. I'm not inherently against that, but if it means I get less points of comparison, I am.
* You used to be able to see examples of run-times on multiple machines. It's less relevant now since everything is multi-core, but it did mean that there would be single and multi-thread implementations of some programs, and you could see how they were written and performed differently.
There are other reasons. Most of these are related to each other, and to be clear, I still like that the site exists, and that it provides useful metrics.
If there isn't much software involved, then the natural choice would be that which most easily integrates with the platform, because at that level, there's always trouble.
Given limited information, I probably would have chosen C/C++, and then done some experiments with Rust to see if it was worthwhile, and then possibly port over during an appropriate iteration.