Port fish-shell's core from C++ to Rust
Reimplement eight core modules of fish-shell — the tokenizer, redirections, the topic monitor, feature flags, and the echo/emit/wait builtins — in Rust, against the exact cxx/autocxx FFI surface the rest of the tree already expects.
- Modules8 core, ported in full
- Oraclefish's own test suite
- DifficultyHard · long-horizon
// Return microseconds since the epoch.
long long get_time() {
struct timeval time_struct;
gettimeofday(&time_struct, nullptr);
return 1000000LL * time_struct.tv_sec
+ time_struct.tv_usec;
}
/// Get the current time in microseconds since Jan 1, 1970.
pub fn get_time() -> i64 {
match time::SystemTime::now()
.duration_since(time::UNIX_EPOCH)
{
Ok(difference) => difference.as_micros() as i64,
Err(until_epoch) =>
-(until_epoch.duration().as_micros() as i64),
}
}