Live data from Hacker News

The Case for Rust in the base system

mail-archive.freebsd.org

11–20 of 155 posts

Re: The Case for Rust in the base system

#13

That would be amazing :D I run FreeBSD on my servers and use scripts to manage jails and send and receive ZFS snapshots between hosts. I've been wanting to write some more robust tools of my own for those things, than the scripts I have now, and my favourite programming language is Rust!

Can't you do that now? The article lists ports tools doing those things already

Re: The Case for Rust in the base system

#15
post #4

I am not familiar with FreeBSD's development model. What constitutes the "base system"?

The stuff that’s included in the system after a standard install, before you install any additional stuff. It’s all in one repository and it’s maintained by the FreeBSD project. Stuff like the kernel, libc, utils, dtrace, compilers needed to build base, ... Basically everything that’s needed for a usable system. It’s updated all together through binary patches, not separately through packages like on Linux. When you want something more, you either compile it from source using Makefiles stored in a repository called “ports” (the Makefiles download the tarballs with source code, verify their checksums, build them etc), or you install pre-built packages using the pkg package manager.

The FreeBSD project tends to like to slim the base system down. E.g. some years ago they removed Perl from the base system. So out-of-the-box the only scripting language that’s available is shell. In contrast, OpenBSD has more stuff in its base system and on the subject of Perl they doubled down on it (their package manager e.g. is written in Perl). It’s also visible, when you download the base system repos for each of them and run tokei to find out the numbers of LOC. (I don’t remember the numbers off the top of my head.) That said, FreeBSD still includes a full LLVM toolchain due to the rule “base builds base”, and LLVM is... a lot. It’s the biggest source of bloat in my jails to be honest. I keep meaning to find out if I can remove it from them.

Re: The Case for Rust in the base system

#17
post #5

Very naive question. What's the main selling point of Rust besides being stably sponsored by Mozilla?

Rust‘s type system prevents memory safety bugs because it reasons about object lifetimes statically. At the same time rust allows you to write systems code on bare metal.

Re: The Case for Rust in the base system

#19
To strongman the "anti" case: I believe that FreeBSD still nominally supports a number of architectures that have immature or no Rust support, which seems like a major blocker to (at least) rewriting major system components like devd in Rust. And build times are already a problem -- the joke five years ago was that the FreeBSD build was a wart on the side of Clang. Doubling that isn't ideal.

That said, I'm a big Rust believer and think it's the right tool for the job in a lot of situations where the historical answer was C or C++. Maybe it's the right tool for FreeBSD, too.

Post reply on HN