menios icon indicating copy to clipboard operation
menios copied to clipboard

Research: Port Fish shell to meniOS

Open pbalduino opened this issue 4 months ago • 0 comments

Context

Evaluate feasibility of porting Fish (Friendly Interactive Shell) to meniOS.

Important Discovery

Fish 4.0+ is now written in Rust (no longer C++), which significantly changes the porting strategy.

Fish Requirements Analysis

Language Requirements

  • Rust compiler (rustc + cargo)
  • Rust standard library
  • Or: Fish 3.x (C++ version) - deprecated

System Dependencies

Fish requires these POSIX utilities:

  • Core: cat, cut, dirname, ls, mkdir, rm, sort, tr, uname, sed
  • Preferred: Full coreutils, find, awk
  • For help: man pages
  • For config: Python 3.5+

meniOS Prerequisites

For Rust Fish (4.0+)

  • [ ] Rust compiler port to meniOS (very large undertaking)
  • [ ] Rust std library port
  • [ ] All POSIX utilities (#183 is just basic ones)
  • [ ] Threading (#109-111)
  • [ ] Signals (#103)
  • [ ] Pipes (#102)
  • [ ] Terminal control (termios)
  • [ ] File write support (#189)
  • [ ] Job control

For C++ Fish (3.x - deprecated)

  • [ ] C++ compiler support
  • [ ] libstdc++ or libc++
  • [ ] Same system requirements as above

Difficulty Assessment

Modern Fish (Rust): 10/10 - Extremely difficult

  • Requires entire Rust toolchain
  • Rust is harder to port than C/C++
  • Still in active development

Legacy Fish (C++): 9/10 - Very difficult

  • Deprecated version
  • Still needs C++ support
  • Complex codebase

Recommendation Path

Short Term (Current)

Focus on shell milestone - simple, C-based, meniOS-native

Medium Term (6-12 months)

  1. Complete cross-compiler toolchain (#29)
  2. Implement IPC primitives (#102-104)
  3. Build comprehensive utilities (#183, #187, #188)
  4. Consider: Build Fish-inspired shell in C for meniOS
    • Take Fish's best UX ideas
    • Implement in portable C
    • Design for meniOS from the ground up
    • Much more realistic than porting

Long Term (12-24 months)

  1. Add C++ support to toolchain
  2. Port simpler shells (dash, ash)
  3. Possibly attempt Fish 3.x (C++ version)
  4. Or: Port minimal Rust runtime + Fish 4.x

Alternative: meniOS-native Modern Shell

Instead of porting Fish, create fiOS (Fish-inspired OS shell):

  • Written in C (works with current toolchain)
  • Fish-like features: syntax highlighting, autosuggestions, tab completion
  • Designed for meniOS constraints
  • Lightweight and fast
  • Can iterate quickly

Benefits

  • No dependency hell
  • Educational value (learn shell design)
  • Optimized for meniOS
  • Can ship sooner

Timeline Estimates

  • Port Rust Fish: 24+ months (requires Rust toolchain port)
  • Port C++ Fish 3.x: 18-24 months (requires C++ support)
  • Build Fish-inspired shell: 6-12 months (after #29 complete)

Recommendation

Don't port Fish directly. Instead:

  1. Finish for basic shell milestone
  2. Build a Fish-inspired modern shell in C
  3. Implement Fish's best features gradually
  4. Keep it meniOS-native and maintainable

pbalduino avatar Oct 05 '25 14:10 pbalduino