NonStop discussion around adding Rust to Git

https://lwn.net/Articles/998115/

By MBCook at

anacrolix | 2 comments | 2 weeks ago
A lot of people misunderstanding Rust's appeal for this kind of thing:

Git is about data integrity. Improved correctness is extremely valuable here.

Rust can be injected into native projects because it has no runtime requirements. So here it's ideal and makes a true rewrite unnecessary unlike other languages.

Rust is creeping into system software as a wholistic replacement. It's very rare that a language can actually entirely replace C/C++. However it's discovering that the process is incredibly slow.

There are things Rust isn't as good for, but it's only a matter of time before those gaps close (mainly around specialised environments and targets).

I don't know if Rust will actually succeed in replacing C/C++ before something better comes along but the writing is on the wall. If you want to get in early on Rust, now is a good time.

norir | 6 comments | 2 weeks ago
It seems strange to call now early on rust given how long it has been around.

I personally believe that rust has some intractable problems that make it quite unlikely that it ever reaches even half of c/c++ level ubiquity. The problems begin with the incredible complexity of the language which manifests in cryptic error messages, puzzling syntax and brutal compile times. The latter especially is a complete non starter for me. I would have to be at risk of going homeless with slinging rust as my only employment option before I would voluntarily subject myself to rust compile times every day.

My hunch is that we are going to see smaller, more specialized languages take off in the next decade. Compared to past eras, it is now so much easier to build quality language tooling that we can have the best of both worlds: small targeted languages, optimized for the relevant problem domain, _and_ professional quality tooling.

dboreham | 0 comments | 2 weeks ago
You forgot the 10's of GB files the compiler generates for debug builds.
bionhoward | 0 comments | 2 weeks ago
Cryptic error messages? maybe in comp time type level code

Puzzling syntax, I simply disagree, it’s not that bad, can you give an example?

Brutal compile times? Idk, for me it’s usually instant, and if there’s a problem I know right away instead of needing to wait for runtime crashes

Rust has been hella worth it for me. Only time I didn’t like it was when I tried to “impl Future for T” instead of writing “async fn”

asoneth | 0 comments | 2 weeks ago
> It seems strange to call now early on rust given how long it has been around.

The first stable release of Rust was almost ten years ago at this point so I agree that this isn't particularly "early" in technological timeframes, but I suppose it could be considered young compared to C++ (first stable release ~40 years ago) or C (~50 years ago).

TheCoelacanth | 0 comments | 2 weeks ago
Rust errors occasionally are difficult to comprehend, but in general I have found it to have the best error messages of any language bar none.
mongol | 0 comments | 2 weeks ago
Can you exemplify what kind of specialized languages you think we will see? Is Zig an example?
anon291 | 2 comments | 2 weeks ago
I honestly cannot take a comment criticizing rust compared to c++ for brutal compile times

And I'm a c++ programmer

rileymat2 | 1 comment | 2 weeks ago
Or any c++ programmer using templates, as far as cryptic compiler messages.
anon291 | 0 comments | 2 weeks ago
Yeah. Do MLIR for my dayjob, and I'm waiting several minutes in between dev cycles.
binary132 | 1 comment | 2 weeks ago
does Rust even support incremental compilation correctly yet? after how many years now?
steveklabnik | 0 comments | 2 weeks ago
Rust has had incremental compilation on by default in debug builds since February 2018.
Ferret7446 | 1 comment | 2 weeks ago
Data integrity in Git isn't that hard. It hashes things. And compresses things. It's not a file system. The kinds of bugs that would cause data integrity issues in Git wouldn't be improved by Rust, because they're regular old bugs, like adding or multiplying the wrong numbers.

In fact, Git is probably one of the types of programs that least benefit from Rust. As a one shot program, you technically don't even need any memory management. You can just malloc stuff and let the kernel collect it when the process exits.

cozzyd | 0 comments | 2 weeks ago
if anything, memory management makes it slower...
cadamsau | 0 comments | 2 weeks ago
In terms of the discussion detailed in the article let’s wait and see. It has to be a vastly superior alternative to make adding it worthwhile.

On the more fun side, when I read the headline I instantly thought of making a side project that lets you watch a bunch of language models in a chat room, infinitely bikeshedding among themselves about the merits of this decision.

Kind of like https://degenerative-sitcom.online/ but for bikeshedding :)

kazinator | 1 comment | 2 weeks ago
> making it easier for more people to contribute to Git

How far does that scale? How easy is it to contribute to any area of a project that is written in 17 different languages?

versteegen | 4 comments | 2 weeks ago
I actually co-maintain a project which has exactly 17 different languages* (though 3 of which are since removed, and 6 languages cover 99% of everything), and noone has ever complained when I add a new language for something throwaway... I think the real issue isn't using multiple languages, it's using a language as intimidating as Rust. Adding some C or C++ or JS to a project usually isn't nearly as problematic (although admittedly it certainly is for the sorts of inexperienced programmers who'd like to contribute to my project).

* If you're curious, in roughly decreasing order of use: FreeBasic/ReloadBasic, HamsterSpeak, Euphoria, C++, Python, C, Bash, Batch, XSLT, JS, Objective C, Emacs Lisp, Squirrel, GDB script. Removed languages: QuickBasic, x86 assembly, Makefile

_nalply | 0 comments | 2 weeks ago
When I saw "HamsterSpeak" I laughed out loud. Then I researched and found this gem: "HamsterSpeak is the scripting language used by the OHRRPGCE." This caused a second laugh.

Kudos to all HamsterSpeak programmers!

aaomidi | 0 comments | 2 weeks ago
Rust is like systemd, it brings the crazies out.
digdugdirk | 1 comment | 2 weeks ago
... How have I never heard of so many of those?

Out of curiosity, why would you choose to add a new language for throwaway tasks? Is the project niche enough in various areas that these languages are truly orders of magnitude better than a common alternative for the specific task? Or is it more of a "I'd like to learn this new language, might as well see how it works in production" sort of thing?

versteegen | 0 comments | 2 weeks ago
Well for example I decided to use Emacs Lisp to search through the FreeBasic code for certain constructs so that I could use some elisp functions I'd already written to help edit FB in Emacs. It's throwaway, noone else will ever want to edit (or probably even use) it. FB is niche enough that there isn't much tooling available for it.

I did indeed add Squirrel just to try it out (I'm considering using it as a scripting language), though I wouldn't be surprised if Euphoria and XSLT were also originally used for that reason. XSLT is there for generating .html documentation. C because I needed speed but didn't want to use C++, C++ because a C++ programmer contributed, Obj-C for the Mac port, JS for the web port, x86 assembly for the original DOS version, Bash, Batch and Python for scripts... any project can quickly reach 10 languages this way.

pabs3 | 1 comment | 2 weeks ago
Which project is this?
versteegen | 0 comments | 6 days ago
OHRRPGCE
cozzyd | 1 comment | 2 weeks ago
Git is already a large binary in size. Hopefully if rust is added it doesn't make the binary size grow significantly larger, otherwise git may be harder to use in embedded Linux applications.
yjftsjthsd-h | 1 comment | 2 weeks ago
I didn't realize git was used in embedded. Is it for pushing... configuration changes? Code?
cozzyd | 0 comments | 2 weeks ago
Not microcontrollers, but single board computers running off emmcs that are not too big. And yes, both code and configuration.
maximilianburke | 1 comment | 2 weeks ago
Honestly I'd have a lot more sympathy for hobbyists asking to hold off on using Rust because it'd break support for, I dunno, OS/2 or AmigaOS or Mac OS 9. If you're going to be flaunting the riches of the industry you represent maybe you can get them to chip in more to open source development.
riedel | 1 comment | 2 weeks ago
I use cygwin as my daily driver for many things. This is why I started to hate languages like rust or go because they easily become a nightmare for me.
palmfacehn | 0 comments | 2 weeks ago
Rust was fine in cygwin for me. The only issues I had were where the build system choked on non-rust dependencies.
inopinatus | 0 comments | 2 weeks ago
Who knows, Rust may even become a universal systems programming language within three or four decades.
binary132 | 0 comments | 2 weeks ago
"making it easier for more people to contribute to Git" doesn't seem like a good reason to introduce Rust. It is a constant refrain that Rust empowers unskilled people to write correct code, but I haven't seen evidence of this. I have seen a lot of intelligent people complaining about how difficult it is, and even after using it for quite some time, I still find it significantly more difficult than C++.
grayhatter | 1 comment | 2 weeks ago
oxide exists... why inflict the issues of a "split brain" repo on a perfectly functional one?

rust and cargo are both such a nightmare to use, I really hope the RIIR meme dies out soon... I actually like that I can compile code without an internet connection.

maximilianburke | 1 comment | 2 weeks ago
What makes Rust and Cargo a nightmare?
grayhatter | 7 comments | 2 weeks ago
Rust is just an aggravating language to use. Might just be a personal inability, but I lack the ability to tolerate arguing with the compiler when I know the code is correct just because the compiler can't prove it.

My issues with cargo, are less about the tool in isolation, but more how it's used. IMO Dependencies should be avoided by default, cargo encourages bad habits. If cargo as a tool behaved more like pip, where you'd call `cargo install dependency` and then completely unconnected `rustc build`. I'd have no issues with cargo. (Also note, pip has many more problems than cargo, but at least you don't use your package manager to run your python code)

It's possible I've still jaded because the first time I had to actually use cargo, it was setting it up for my team to work on it, and have it function, from within an air gapped network... never again!

do_not_redeem | 0 comments | 2 weeks ago
> If cargo as a tool behaved more like pip, where you'd call `cargo install dependency` and then completely unconnected `rustc build`

This has the problem that your deps can get out of sync with your lockfile... which is why most/all the newer python package managers have a run command that works more like cargo e.g. https://python-poetry.org/docs/basic-usage/#using-poetry-run

If you tried it a while ago things likely improved since then. `cargo fetch` and `cargo vendor` are both single-command solutions for airgapped networks.

oconnor663 | 0 comments | 2 weeks ago
> arguing with the compiler when I know the code is correct just because the compiler can't prove it

I don't want to assume too much about your specific use case, but in a lot of situations that people describe this way, the truth is that the code would've been correct if it was C but -- because it violates the no-mutable-aliasing rule -- it's genuinely broken under the Rust memory model and will trigger UB if you use unsafe code to work around the compiler errors. https://youtu.be/DG-VLezRkYQ

arjie | 1 comment | 2 weeks ago
I write Rust on an airplane with no Internet using Panamax. It’s pretty easy to setup if you have large disk https://wiki.roshangeorge.dev/index.php/Blog/2024-02-28/Rust...

If you find it aggravating to use, then it’s not likely this will make you happy but just in case it helps, you can just bake it into your image and be completely airgapped and the only real factor is storage because the actual functionality is easy.

ilyagr | 1 comment | 2 weeks ago
Nice tool to know about. How much storage do you need to use it?
arjie | 0 comments | 2 weeks ago
This is on my M1 Max Macbook Pro though it's probably the same on all platforms since the `dist` dir contains all platform distributions

   local du -h -d 1 .
 214G ./crates
  33G ./dist
 830M ./rustup
 2.7G ./crates.io-index
 250G
I'm fairly indiscriminate with my setup. I just used defaults everywhere.
thesuperbigfrog | 0 comments | 2 weeks ago
>> It's possible I've still jaded because the first time I had to actually use cargo, it was setting it up for my team to work on it, and have it function, from within an air gapped network... never again!

You can use the 'cargo vendor' command to download all of a project's dependencies and then transfer them to an air-gapped environment.

https://doc.rust-lang.org/cargo/commands/cargo-vendor.html

This allows for the project's dependencies to be checked before they are introduced in the air-gapped environment and also placed in version control for a full snapshot of the project.

At $WORK we have been using Rust this way for a few years now and it has been great. Cargo is much easier to use than cmake, make, and other custom build scripts we were using before. After a few trials, we have been migrating projects from C/C++ to Rust and management has been impressed with the results. The code is equally fast, errors are down, and our velocity is improving since we find and correct more problems earlier in our processes.

maximilianburke | 0 comments | 2 weeks ago
Fair enough.

Cargo does have an `offline` mode for `cargo build` which won't hit the network, and you can vendor dependencies. You can also invoke `rustc` directly outside of Cargo. In general though I think the Cargo team is optimizing usability for the 90%ile who can and do use the internet while developing (which is also unavoidable with other language ecosystems). But getting stuck if you're in that 10% is always hard.

LAC-Tech | 0 comments | 2 weeks ago
Rust is just an aggravating language to use. Might just be a personal inability, but I lack the ability to tolerate arguing with the compiler when I know the code is correct just because the compiler can't prove it.

That's what unsafe is for. From the rust book:

"Unsafe Rust exists because, by nature, static analysis is conservative. When the compiler tries to determine whether or not code upholds the guarantees, it’s better for it to reject some valid programs than to accept some invalid programs. Although the code might be okay, if the Rust compiler doesn’t have enough information to be confident, it will reject the code. In these cases, you can use unsafe code to tell the compiler, “Trust me, I know what I’m doing.” Be warned, however, that you use unsafe Rust at your own risk: if you use unsafe code incorrectly, problems can occur due to memory unsafety, such as null pointer dereferencing."

applied_heat | 1 comment | 2 weeks ago
Is the proprietary operating system that HP Nonstop uses just HP-UX? If so it doesn’t seem that different from other operating systems that rust can use?
ajayvk | 3 comments | 2 weeks ago
NonStop Kernel (NSK) is the OS for the Tandem hardware which had fault tolerant hardware (dual everything) and software (process pair with checkpoints) https://en.m.wikipedia.org/wiki/Tandem_Computers. The OS is not posix compliant, very different from HP-UX. It is used now mainly in financial systems, competes with IBM mainframes. I used to work on NonStop SQL databases.
MBCook | 1 comment | 2 weeks ago
I’m the one who posted the article. This is the first time I’ve ever even heard of NonStop.

From the entitle I assumed it had something to do with discussions that had been going on for a long time or kept coming up and it was just a typo or something.

Interesting to find out there was a an OS I never heard. Unfortunately the Wikipedia page isn’t very comprehensive.

dboreham | 1 comment | 2 weeks ago
I'd not heard of NonStop but I've definitely heard of Tandem. I think one is the other after going through a few decades of marketing spin.
sillywalk | 0 comments | 2 weeks ago
The original company was called Tandem Computers. They called their systems NonStop. The OS was originally called Guardian, then it was Guardian 90, then NonStop Kernel, which had both Guardian and POSIX "personalities". Tandem got purchased by Compaq, then Compaq got purchased by HP.
bigfatkitten | 0 comments | 2 weeks ago
Even their coffee mugs were fault tolerant.

https://www.computerhistory.org/collections/catalog/10262869...

sillywalk | 0 comments | 2 weeks ago
I don't know how complete it is, but NonStop has had POSIX support since the mid-1990s. It's called Open System Services. It's got ksh, and various unix/posix apis/utilities, and a hierarchical filesystem.
yoav | 0 comments | 2 weeks ago
I don’t want to be _that_ guy but I want this for zig instead of rust.
rendaw | 1 comment | 2 weeks ago
What I don't get is are people doing software development on these NonStop computers? Why? Or are they managing financial transactions using git?
cozzyd | 0 comments | 2 weeks ago
probably configuration control?
ImJamal | 0 comments | 2 weeks ago
It looks like NonStop supports Java. Is there a reason they can't just use JGit or something?
byyoung3 | 0 comments | 2 weeks ago
if its not broke ....
dlahoda | 0 comments | 2 weeks ago
gitoxide is written in rust. why would they want copy paste code from it?

also, why they hate cpp? cpp without exceptions and late binding virtual inheritance is nice, and gpt said nonstop has full 17 and partial 20 cpp standard support.

nixosbestos | 0 comments | 2 weeks ago
Ah yes, Git not running on a niche, highly proprietary system will surely kill it. Delusional response from Randall.

Edit: lol I have a feeling some of you didn't, you know, read the article.