Conversation
⏺ Phase 2 implementation complete. Summary of changes:
Runtime (crates/runtime/src/os.rs):
- patch_seq_path_exists - check if path exists
- patch_seq_path_is_file - check if path is a regular file
- patch_seq_path_is_dir - check if path is a directory
Compiler updates:
- ast.rs - added intrinsics: path-exists, path-is-file, path-is-dir
- builtins.rs - added stack effects: ( String -- Int ) for all three
- codegen.rs - added mappings and extern declarations (both locations)
- lib.rs - added exports for all OS functions (including Phase 1 exports that were missing)
Demo updated (examples/os/os-demo.seq):
- Tests all three new functions with ., a non-existent path, and home directory
All 489 tests pass, and the demo output shows:
Path operations:
'.' exists: yes
'.' is directory: yes
'.' is file: no
Non-existent path exists: no
Testing home dir: /Users/navicore
exists: yes
is directory: yes
is file: no
PR Review: OS Phase 2 ImplementationSummaryThis PR implements three new path-checking intrinsics ( ✅ Code Quality & Best PracticesStrengths:
Minor observations:
✅ Potential Bugs or IssuesNo critical bugs found. The implementation is sound:
Edge case consideration (informational):
✅ Performance ConsiderationsNo performance concerns:
These are lightweight syscall wrappers with negligible performance impact. ✅ Security ConcernsNo security issues identified:
Note: These functions expose filesystem state, which is expected for OS intrinsics. The Seq language user is responsible for handling paths securely in their application code.
|
⏺ Phase 2 implementation complete. Summary of changes:
Runtime (crates/runtime/src/os.rs):
Compiler updates:
Demo updated (examples/os/os-demo.seq):
All 489 tests pass, and the demo output shows:
Path operations:
'.' exists: yes '.' is directory: yes '.' is file: no