From 48095489b4e1b85f82d80adf69abd691f9bc1679 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Wed, 13 Aug 2025 21:45:33 +0200 Subject: Update README and self-identification. --- README-ZIG.md | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 README-ZIG.md (limited to 'README-ZIG.md') diff --git a/README-ZIG.md b/README-ZIG.md deleted file mode 100644 index d965cd6..0000000 --- a/README-ZIG.md +++ /dev/null @@ -1,57 +0,0 @@ -# Dose - Zig Port - -This is a Zig port of the original Rust-based DOS command shell implementation. - -## Dependency Replacements - -The original Rust version used several external crates that have been replaced with Zig standard library functionality: - -### Rust → Zig Replacements -- **`rustyline`** (command-line editing) → Simple `stdin.readUntilDelimiterOrEofAlloc()` -- **`crossterm`** (terminal manipulation) → ANSI escape sequences for screen clearing -- **`prettytable-rs`** (table formatting) → Custom formatting with `print()` -- **`eyre`/`color-eyre`** (error handling) → Zig's built-in error handling -- **`thiserror`** (error derive macros) → Zig error unions -- **`regex`** (regular expressions) → Not needed in current implementation - -### Key Architectural Changes - -1. **Error Handling**: Replaced Rust's `Result` with Zig's error unions (`!T`) -2. **Memory Management**: Manual allocation/deallocation using Zig's allocators instead of Rust's ownership system -3. **String Handling**: Explicit memory management for strings vs Rust's `String`/`&str` -4. **Concurrency**: Removed complex threading from original Rust version for simplicity -5. **Command Line Editing**: Simplified to basic line reading (no history or editing features) - -### Missing Features (compared to Rust version) -- Command-line history and editing (rustyline features) -- Colored error output -- Advanced terminal manipulation -- Complex pipe/redirection handling -- Multi-threaded command execution - -## Build Instructions - -```bash -# Build and run in debug mode -zig build run - -# Build optimized release version -zig build -Doptimize=ReleaseFast - -# Run tests -zig build test -``` - -## Implementation Notes - -The Zig version focuses on core DOS command functionality while maintaining the same architectural patterns as the Rust original. The enum-based command system has been preserved using Zig's union types. - -Key DOS commands implemented: -- `ECHO` (with ON/OFF variants) -- `CLS` (clear screen) -- `EXIT` (exit shell) -- `VER` (version info) -- `DATE` and `TIME` (system date/time) -- `DIR` (directory listing) - -The implementation uses Zig's standard library exclusively, avoiding external dependencies for better portability and simplicity. -- cgit v1.2.1