FreeBSD considers Rust in the base system
The FreeBSD Project is reconsidering integrating Rust into its base system, with developers divided on its benefits and challenges, influenced by past experiences with Perl's integration. No concrete plans exist yet.
Read original articleThe FreeBSD Project is revisiting the idea of incorporating Rust into its base system, following earlier discussions this year. Alan Somers has contributed by demonstrating potential implementations of Rust code within the FreeBSD source tree. Currently, FreeBSD's base system supports languages like C, C++, and assembly, while Rust is only available in the ports collection, which includes over 500 Rust packages. The discussions have highlighted both the advantages and challenges of integrating Rust, including concerns about build times and backward compatibility. Some developers advocate for Rust's inclusion, citing its productivity and reduced bugs compared to C++, while others express skepticism, referencing past experiences with Perl's integration into FreeBSD. The conversation has also touched on the need for successful Rust projects to encourage its adoption and the possibility of using an external toolchain for Rust rather than embedding it in the base system. Despite the ongoing discussions, no concrete plans have emerged for Rust's inclusion, and the topic may resurface as developers explore build-system integration.
- FreeBSD is considering integrating Rust into its base system after previous discussions.
- Rust is currently only available in FreeBSD's ports collection, not in the base system.
- Developers are divided on Rust's inclusion, citing both potential benefits and logistical challenges.
- Past experiences with Perl's integration into FreeBSD are influencing current opinions on Rust.
- Future discussions may focus on build-system integration for Rust within FreeBSD.
Related
2024 FreeBSD Developer Summit: Integration with Rust
The 2024 FreeBSD Developer Summit discussed integrating Rust into FreeBSD for modernization and security. Challenges include Rust's update pace differing from FreeBSD's. Coordination with Rust community is vital for compatibility and stability.
Rust for Filesystems
At the 2024 Linux Summit, Wedson Almeida Filho and Kent Overstreet explored Rust for Linux filesystems. Rust's safety features offer benefits for kernel development, despite concerns about compatibility and adoption challenges.
Rust Port for Fish Shell Is Almost Ready for a Beta Release
The Fish shell is approaching a beta release of its Rust-based version, enhancing maintainability. An open beta will help identify bugs, with installation instructions for Linux and macOS provided.
FreeBSD considers Rust in the base system
FreeBSD is discussing the potential integration of Rust into its base system, facing concerns about build times and compatibility, while no concrete plans have been established yet.
FreeBSD-rustdate, a reimplementation of FreeBSD-update
freebsd-rustdate is a new, faster implementation of freebsd-update, written in Rust. It is experimental, not recommended for production, and users should exercise caution on critical systems.
- Some commenters advocate for forking FreeBSD to create a Rust-based version, expressing skepticism about integrating Rust into the existing system.
- Others highlight the productivity benefits of Rust over C++, citing fewer bugs and simpler syntax as advantages.
- Concerns are raised about the potential quality issues associated with package systems in Rust, similar to those seen in other languages.
- There is a call for exploring alternative languages like Zig that may offer similar benefits without the complexities of Rust's ecosystem.
- Some participants emphasize the importance of maintaining the integrity of the base system and suggest that Rust may not be suitable for this purpose.
https://www.phoronix.com/news/Rust-Linux-Maintainer-Step-Dow...
I don't get this fixation rust proponents have to try and force-jam it into pre-existing projects, instead of writing their own rust software.
Personally I'd prefer if it stays out of FreeBSD. All languages with package systems turn into a horrible quality over time. PHP Composer, Python Pip, node NPM and so on, initially it seems effective but the version dependency/issue hells are true nightmares. And I fear rust with cargo is going to be the same. Maybe I'm wrong, and in case it does go into base, I really hope I'm wrong so the quality of FreeBSD doesn't go down...
I wrote some small games in Zig, I made some money writing Go. I dabbled in Elixir, Erlang, some Lisps, it goes on. I love programming. After my 9-5 C# Job nowadays I usually spend a few hours programming with my friends.
I was extremely skeptical of Rust, due to the hype and some very obnoxious Rust proponents. I learned Rust, I'm still learning it, but I've shipped a few smaller backend apps and worked on a few larger projects now.
The main reason why I think that Rust should replace C++ in all new projects is actually very simple: Tagged unions, pattern matching, reflection, no OOP and the toolchain. There is a lot of syntax in Rust that is beautiful, but besides that, those are the most useful features. They save hundreds to thousands of lines of code per codebase, compared to C++. The Option<T> alone is a simple
enum Option<T> {
Some(T),
None,
}
Whereas in C++, std::optional<T> is a massive class with edge cases, weird implicit conversions ({} = std::nullopt, beware), and don't even start with differences between different STL implementations. What about `std::make_optional`? At least C++23 adds monadic operations like `.and_then()`, but with the "let's capture by reference why not" lambdas in C++, you easily have dangling references in your lambdas if you do anything multithreaded.In Rust, I just write code, and if it compiles, it runs and does *exactly* what it says. I don't have to run the code to see if it crashes just because I'm using multiple threads, or a bunch of tokio async tasks. In C++, sure, if it compiles you cleared the first hurdle, but about 60% of the time the code has edge cases you're not considering. Most if not all C++ code I've seen makes assumptions about the lifetimes of things, and/or uses globals, and/or happily uses shared pointers in ways that they were not designed. Anything using `boost::asio` is a gigantic clusterfuck of "make sure you pass by value, by rvalue reference, or as a shared pointer" that, of course, not a single linter or compiler will tell you about if you don't. They don't have to tell you, because that's UB, and that probably crashes horribly, but maybe not!
I can't wait for more people to use Rust so their ecosystem matures a little more.
C++ wasn't put into critical dependency in the kernel in FreeBSD either. If you think it's just a dialect of C (I don't) then that speaks to the strength of opposition.
Lua was put in the kernel. Perhaps because "it's just forth" and has less risk of drift from a critical dependency.
When the pace of change of Rust moves to less-than-annual, I think it might be valid but frankly I think RustBSD is a better model: fork the code, write a rust kernel, maintain an ABI which C can live with, move forward.
The codebase is bsd-license, it's as good (fork-wise) as it can be.
So go ahead, fork it and explore your ideas... If they're good, they can still be merged back into upstream.
People in the FLOSS scene nowadays are too much fork-a-phobic in my opinion.
I'm saying that as one who knows little about the language.
Related
2024 FreeBSD Developer Summit: Integration with Rust
The 2024 FreeBSD Developer Summit discussed integrating Rust into FreeBSD for modernization and security. Challenges include Rust's update pace differing from FreeBSD's. Coordination with Rust community is vital for compatibility and stability.
Rust for Filesystems
At the 2024 Linux Summit, Wedson Almeida Filho and Kent Overstreet explored Rust for Linux filesystems. Rust's safety features offer benefits for kernel development, despite concerns about compatibility and adoption challenges.
Rust Port for Fish Shell Is Almost Ready for a Beta Release
The Fish shell is approaching a beta release of its Rust-based version, enhancing maintainability. An open beta will help identify bugs, with installation instructions for Linux and macOS provided.
FreeBSD considers Rust in the base system
FreeBSD is discussing the potential integration of Rust into its base system, facing concerns about build times and compatibility, while no concrete plans have been established yet.
FreeBSD-rustdate, a reimplementation of FreeBSD-update
freebsd-rustdate is a new, faster implementation of freebsd-update, written in Rust. It is experimental, not recommended for production, and users should exercise caution on critical systems.