Commit Graph

4 Commits

Author SHA1 Message Date
46fc2e2470 feat: add async/await keywords, Num/String extensions, and Jinja markdown example
Add `async` and `await` token support to the Wren compiler with scheduler resolution logic, extend `Num` with `e` constant, hyperbolic trig, base conversion, and new methods (`isZero`, `gcd`, `lcm`, `digits`, etc.), extend `String` with `lower`, `upper`, `capitalize`, `title`, and regenerate `wren_core.wren.inc`. Include `Makefile` for multi-platform builds, rewrite `README.md` with updated build instructions, and add `example/await_demo.wren` and `example/jinja_markdown.wren` demonstrating new features.
2026-01-25 03:58:39 +00:00
Josh Goebel
27cf54d449 feat: add Directory.create/delete and refactor io module to use Scheduler.await_
Add foreign static methods `create_` and `delete_` to the Directory class in the Wren io module, backed by C implementations using `uv_fs_mkdir` and `uv_fs_rmdir` with proper error handling via `schedulerResumeError`. Refactor existing `Directory.list` and `File.delete` to use the new `Scheduler.await_` helper instead of manually calling `runNextScheduled_`, and rename `ensurePath_` to `ensureString_` for consistency across both classes. Introduce a new test file `create_delete.wren` that validates directory creation, existence checks, and deletion on both POSIX and Windows platforms.
2021-05-01 22:58:17 +00:00
Bob Nystrom
8fd9449196 feat: implement async file I/O with open/close/readBytes and scheduler error handling
Add foreign class File with static open, read, size methods and instance methods for close, size, readBytes. Implement async file operations using libuv callbacks that resume fibers on completion. Introduce schedulerResumeError and resumeError_ to propagate I/O errors as fiber errors. Add setExitCode to CLI vm for runtime error exit handling. Bump MAX_METHODS_PER_CLASS from 2 to 9 to accommodate new File methods.
2015-10-01 04:13:36 +00:00
Bob Nystrom
34bcc6bd2d feat: add scheduler module and refactor built-in module loading into shared modules.c
Introduce a new scheduler module with fiber-based cooperative multitasking, including native bindings for resume operations and a Wren class for scheduling callables. Refactor the existing timer module and CLI code to use a centralized built-in module registry in modules.c, replacing direct includes of timer.h and timer.wren.inc. Update Xcode project and Makefile to compile the new scheduler.c, modules.c, and their generated .wren.inc sources.
2015-09-13 18:32:39 +00:00