Rewrite it in Rust by ridiculousfish · Pull Request #9512 · fish-shell/fish-shell.
(Sorry for the meme; also this is obligatory.)
I think we should transition to Rust and aim to have it done by the next major release:
Nobody really likes C++ or CMake, and there’s no clear path f…
Read in full here:
fish-shell:master
← ridiculousfish:riir
opened 06:24PM - 28 Jan 23 UTC
(Sorry for the [meme](https://transitiontech.ca/random/RIIR); also [this is obli… gatory](https://github.com/ansuz/RIIR).)
I think we should transition to Rust and aim to have it done by the next major release:
- Nobody really likes C++ or CMake, and there's no clear path for getting off old toolchains. Every year the pain will get worse.
- C++ is becoming a legacy language and finding contributors in the future will become difficult, while Rust has an active and growing community.
- Rust is what we need to turn on concurrent function execution.
- Being written in Rust will help fish continue to be perceived as modern and relevant.
This should be thought of as a "port" instead of a "rewrite" because we would not start from scratch; instead we would translate C++ to Rust, incrementally, module by module, in the span of one release. We'll use an FFI so the Rust and C++ bits can talk to each other until C++ is gone, and tests and CI keep passing at every commit.
To prove it can work, in this PR I've ported FLOG, topic monitor, wgetopt, builtin_wait, and some others to Rust. The Rust bits live in a crate that lives inside the C++ and links with it. You can just build it the usual way:
1. [Install Rust](https://www.rust-lang.org/tools/install) 1.67 or later
2. cmake as usual, and it should work, by way of [corrosion](https://github.com/corrosion-rs/corrosion)
It works in [GH Actions CI](https://github.com/ridiculousfish/fish-shell/actions/runs/4027937935) too.
The [Plan](https://github.com/ridiculousfish/fish-shell/blob/riir/doc_internal/fish-riir-plan.md) has a high level description, and the [Development Guide](https://github.com/ridiculousfish/fish-shell/blob/riir/doc_internal/rust-devel.md) has more technical details on how to proceed. Please consider both to be part of this PR.
This thread was posted by one of our members via one of our news source trackers.
bot
31 January 2023 15:59
#2
Corresponding tweet for this thread:
Share link for this tweet.