Skip to content

Translating Oils to Rust

andychu edited this page Jun 16, 2025 · 11 revisions

Why?

Why create liboils?

  • Tools like resholve are built on top of the Oils AST (lossless syntax tree)
  • I want somebody to write an auto-formatter for YSH, and

Issues

  • mycpp Modules
    • and refactoring to modules: the C++ build should have a pure "liboils" + the Unix I/O
  • Zephyr ASDL subtyping - multiple inheritance, graph-shaped type relationships
  • mycpp: classes with single inheritance should be easy
  • Garbage Collection
    • Rc<T> is possible, but probably not fast, and would leak cycles
    • I would start out with Arena
    • maybe do OHeap-like "data-oriented design" - Compact AST Representation
    • later: copying collector

Related

Oils for Windows

Rewriting YSH Only in Rust

Oils vs. Bash-Compatible Shells

  • has YSH too
    • simple word evaluation
    • better handling
  • less binary code than shells in Rust
    • though we dynamically link GNU readline, so that is not a totally fair comparison
Clone this wiki locally