feat: add libuv event loop integration with timer module and CLI restructuring

Add a vertical slice of real libuv integration by introducing a "timer" CLI module with a Timer class and static sleep() method. This required significant infrastructure changes: setting up libuv event loop in the CLI, creating a new src/module directory for CLI modules, updating all build scripts (Makefile, wren.mk, Xcode project) to handle the new module compilation, and reorganizing CLI code by moving REPL logic from main.c to vm.c. The generate_builtins.py script was also updated to support copying Wren sources into the module directory.
This commit is contained in:
Bob Nystrom
2015-08-07 15:10:55 +00:00
parent e7bdca2cfa
commit 810da1f0fc
13 changed files with 456 additions and 70 deletions
+4 -4
View File
@@ -4,15 +4,15 @@
# Executables are built to bin/. Libraries are built to lib/.
LIB_UV := build/libuv/build/Release/libuv.a
LIBUV := build/libuv/build/Release/libuv.a
# A normal, optimized release build for the current CPU architecture.
release: $(LIB_UV)
release: $(LIBUV)
@ $(MAKE) -f script/wren.mk
@ cp bin/wren wren # For convenience, copy the interpreter to the top level.
# A debug build for the current architecture.
debug: $(LIB_UV)
debug: $(LIBUV)
@ $(MAKE) -f script/wren.mk MODE=debug
# A release build of just the VM. Does not require libuv.
@@ -33,7 +33,7 @@ all: debug release
@ $(MAKE) -f script/wren.mk MODE=debug LANG=cpp ARCH=64
# Download and build libuv to a static library.
$(LIB_UV): script/libuv.py
$(LIBUV): script/libuv.py
@ ./script/libuv.py
# Remove all build outputs and intermediate files.