Commit Graph

3 Commits

Author SHA1 Message Date
Michael Schimmel 4dfdc75545 Refactor: Introduce system library
- Add `rtl/system.myc` as the system library, containing core utilities
  like `while` and `cache`.
- Remove the duplicate `prelude.myc` from `src/ast/rtl/`.
- Modify `Environment::collect_dependencies` to implicitly add `#use
  system` when necessary.
- Update `Environment::with_cwd` to also add the `rtl` subdirectory to
  search paths.
- Add `target/` to `.geminiignore` to exclude build artifacts.
- Adjust example `sma.myc` to use the new `cache` macro and reduce
  sample data size.
- Update `rtl/sma.myc` to correctly initialize the `history` series with
  its `length`.
- Add `preload_dependencies` calls to `dump_ast` and `run_script` for
  proper module loading.
2026-03-08 12:09:32 +01:00
Michael Schimmel 595bcf09e5 Update examples to use StreamNode and Series with lookback
The `PipelineNode` has been refactored into `StreamNode`. This commit
updates the example files to reflect this change and also updates the
`series` constructor to accept a lookback parameter.

The `PipelineNode` was an artifact of a previous implementation and is
no longer needed. The `StreamNode` is the appropriate type for
representing the output of a pipe operation.

The `series` function now requires a `lookback` argument to specify the
maximum number of items to store. This makes the behavior of series more
explicit and prevents accidental unbounded memory growth.
2026-03-07 23:48:09 +01:00
Michael Schimmel 84ef3f9aed feat: Enhance #use directive for directories and cwd
The `#use` directive now supports referencing entire directories,
automatically including all `.myc` files within them. Additionally,
environments are now initialized with the current working directory as a
default search path, simplifying module resolution.
2026-03-06 21:07:27 +01:00