menios
menios copied to clipboard
Research: Port Fish shell to meniOS
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)
- Complete cross-compiler toolchain (#29)
- Implement IPC primitives (#102-104)
- Build comprehensive utilities (#183, #187, #188)
- 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)
- Add C++ support to toolchain
- Port simpler shells (dash, ash)
- Possibly attempt Fish 3.x (C++ version)
- 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:
- Finish for basic shell milestone
- Build a Fish-inspired modern shell in C
- Implement Fish's best features gradually
- Keep it meniOS-native and maintainable