diff --git a/src/vm/wren_meta.c b/src/aux/wren_aux_meta.c similarity index 94% rename from src/vm/wren_meta.c rename to src/aux/wren_aux_meta.c index 3c95ac25..ddad1073 100644 --- a/src/vm/wren_meta.c +++ b/src/aux/wren_aux_meta.c @@ -1,12 +1,11 @@ -#include "wren_meta.h" +#include "wren_aux_meta.h" -#if WREN_USE_META_MODULE +#if WREN_AUX_META #include -#include "wren_primitive.h" - -#include "wren_meta.wren.inc" +#include "wren_vm.h" +#include "wren_aux_meta.wren.inc" void metaCompile(WrenVM* vm) { diff --git a/src/vm/wren_meta.h b/src/aux/wren_aux_meta.h similarity index 71% rename from src/vm/wren_meta.h rename to src/aux/wren_aux_meta.h index a79bf99b..c5cafc57 100644 --- a/src/vm/wren_meta.h +++ b/src/aux/wren_aux_meta.h @@ -1,12 +1,11 @@ -#ifndef wren_meta_h -#define wren_meta_h +#ifndef wren_aux_meta_h +#define wren_aux_meta_h #include "wren_common.h" - #include "wren.h" // This module defines the Meta class and its associated methods. -#if WREN_USE_META_MODULE +#if WREN_AUX_META void wrenLoadMetaModule(WrenVM* vm); diff --git a/builtin/meta.wren b/src/aux/wren_aux_meta.wren similarity index 100% rename from builtin/meta.wren rename to src/aux/wren_aux_meta.wren diff --git a/src/vm/wren_meta.wren.inc b/src/aux/wren_aux_meta.wren.inc similarity index 84% rename from src/vm/wren_meta.wren.inc rename to src/aux/wren_aux_meta.wren.inc index 843d120d..b80076df 100644 --- a/src/vm/wren_meta.wren.inc +++ b/src/aux/wren_aux_meta.wren.inc @@ -1,4 +1,4 @@ -// Generated automatically from builtin/meta.wren. Do not edit. +// Generated automatically from src/aux/wren_aux_meta.wren. Do not edit. static const char* metaModuleSource = "class Meta {\n" " static eval(source) {\n" diff --git a/src/aux/wren_aux_random.c b/src/aux/wren_aux_random.c new file mode 100644 index 00000000..8b400152 --- /dev/null +++ b/src/aux/wren_aux_random.c @@ -0,0 +1,156 @@ +#include "wren_aux_random.h" + +#if WREN_AUX_RANDOM + +#include +#include + +#include "wren.h" +#include "wren_vm.h" + +#include "wren_aux_random.wren.inc" + +// Implements the well equidistributed long-period linear PRNG (WELL512a). +// +// https://en.wikipedia.org/wiki/Well_equidistributed_long-period_linear +typedef struct +{ + uint32_t state[16]; + uint32_t index; +} Well512; + +// Code from: http://www.lomont.org/Math/Papers/2008/Lomont_PRNG_2008.pdf +static uint32_t advanceState(Well512* well) +{ + uint32_t a, b, c, d; + a = well->state[well->index]; + c = well->state[(well->index + 13) & 15]; + b = a ^ c ^ (a << 16) ^ (c << 15); + c = well->state[(well->index + 9) & 15]; + c ^= (c >> 11); + a = well->state[well->index] = b ^ c; + d = a ^ ((a << 5) & 0xda442d24U); + + well->index = (well->index + 15) & 15; + a = well->state[well->index]; + well->state[well->index] = a ^ b ^ d ^ (a << 2) ^ (b << 18) ^ (c << 28); + return well->state[well->index]; +} + +static void randomAllocate(WrenVM* vm) +{ + Well512* well = (Well512*)wrenAllocateForeign(vm, sizeof(Well512)); + well->index = 0; +} + +static void randomSeed0(WrenVM* vm) +{ + Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); + + srand((uint32_t)time(NULL)); + for (int i = 0; i < 16; i++) + { + well->state[i] = rand(); + } +} + +static void randomSeed1(WrenVM* vm) +{ + Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); + + srand((uint32_t)wrenGetArgumentDouble(vm, 1)); + for (int i = 0; i < 16; i++) + { + well->state[i] = rand(); + } +} + +static void randomSeed16(WrenVM* vm) +{ + Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); + + for (int i = 0; i < 16; i++) + { + well->state[i] = (uint32_t)wrenGetArgumentDouble(vm, i + 1); + } +} + +static void randomFloat(WrenVM* vm) +{ + Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); + + // A double has 53 bits of precision in its mantissa, and we'd like to take + // full advantage of that, so we need 53 bits of random source data. + + // First, start with 32 random bits, shifted to the left 21 bits. + double result = (double)advanceState(well) * (1 << 21); + + // Then add another 21 random bits. + result += (double)(advanceState(well) & ((1 << 21) - 1)); + + // Now we have a number from 0 - (2^53). Divide be the range to get a double + // from 0 to 1.0 (half-inclusive). + result /= 9007199254740992.0; + + wrenReturnDouble(vm, result); +} + +static void randomInt0(WrenVM* vm) +{ + Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); + + wrenReturnDouble(vm, (double)advanceState(well)); +} + +// TODO: The way these are wired up is pretty verbose and tedious. Also, the +// CLI has its own separate way of handling this. Figure out something cleaner. +static WrenForeignMethodFn bindForeignMethods(WrenVM* vm, + const char* module, + const char* className, + bool isStatic, + const char* signature) +{ + ASSERT(strcmp(module, "random") == 0, "Should be in random module."); + ASSERT(strcmp(className, "Random") == 0, "Should be in Random class."); + + if (strcmp(signature, "") == 0) return randomAllocate; + if (strcmp(signature, "seed_()") == 0) return randomSeed0; + if (strcmp(signature, "seed_(_)") == 0) return randomSeed1; + + if (strcmp(signature, "seed_(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)") == 0) + { + return randomSeed16; + } + + if (strcmp(signature, "float()") == 0) return randomFloat; + if (strcmp(signature, "int()") == 0) return randomInt0; + + ASSERT(false, "Unknown method."); + return NULL; +} + +static WrenForeignClassMethods bindForeignClass(WrenVM* vm, const char* module, + const char* className) +{ + WrenForeignClassMethods methods; + methods.allocate = randomAllocate; + methods.finalize = NULL; + return methods; +} + +// TODO: Lots of duplication between here and meta. +void wrenLoadRandomModule(WrenVM* vm) +{ + WrenBindForeignMethodFn previousBindMethodFn = vm->config.bindForeignMethodFn; + vm->config.bindForeignMethodFn = bindForeignMethods; + + WrenBindForeignClassFn previousBindClassFn = vm->config.bindForeignClassFn; + vm->config.bindForeignClassFn = bindForeignClass; + + wrenInterpretInModule(vm, "random", randomModuleSource); + + vm->config.bindForeignMethodFn = previousBindMethodFn; + vm->config.bindForeignClassFn = previousBindClassFn; +} + +#endif diff --git a/src/aux/wren_aux_random.h b/src/aux/wren_aux_random.h new file mode 100644 index 00000000..fe363789 --- /dev/null +++ b/src/aux/wren_aux_random.h @@ -0,0 +1,13 @@ +#ifndef wren_aux_random_h +#define wren_aux_random_h + +#include "wren_common.h" +#include "wren.h" + +#if WREN_AUX_RANDOM + +void wrenLoadRandomModule(WrenVM* vm); + +#endif + +#endif diff --git a/src/module/random.wren b/src/aux/wren_aux_random.wren similarity index 100% rename from src/module/random.wren rename to src/aux/wren_aux_random.wren diff --git a/src/module/random.wren.inc b/src/aux/wren_aux_random.wren.inc similarity index 100% rename from src/module/random.wren.inc rename to src/aux/wren_aux_random.wren.inc diff --git a/src/cli/modules.c b/src/cli/modules.c index c2cce73f..3fbc49ce 100644 --- a/src/cli/modules.c +++ b/src/cli/modules.c @@ -4,7 +4,6 @@ #include "modules.h" #include "io.wren.inc" -#include "random.wren.inc" #include "scheduler.wren.inc" #include "timer.wren.inc" @@ -16,12 +15,6 @@ extern void fileClose(WrenVM* vm); extern void fileDescriptor(WrenVM* vm); extern void fileReadBytes(WrenVM* vm); extern void fileSize(WrenVM* vm); -extern void randomAllocate(WrenVM* vm); -extern void randomSeed0(WrenVM* vm); -extern void randomSeed1(WrenVM* vm); -extern void randomSeed16(WrenVM* vm); -extern void randomFloat(WrenVM* vm); -extern void randomInt0(WrenVM* vm); extern void stdinReadStart(WrenVM* vm); extern void stdinReadStop(WrenVM* vm); extern void schedulerCaptureMethods(WrenVM* vm); @@ -105,16 +98,6 @@ static ModuleRegistry modules[] = STATIC_METHOD("readStop_()", stdinReadStop) END_CLASS END_MODULE - MODULE(random) - CLASS(Random) - STATIC_METHOD("", randomAllocate) - METHOD("seed_()", randomSeed0) - METHOD("seed_(_)", randomSeed1) - METHOD("seed_(_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_)", randomSeed16) - METHOD("float()", randomFloat) - METHOD("int()", randomInt0) - END_CLASS - END_MODULE MODULE(scheduler) CLASS(Scheduler) STATIC_METHOD("captureMethods_()", schedulerCaptureMethods) diff --git a/src/module/random.c b/src/module/random.c deleted file mode 100644 index 7fe83038..00000000 --- a/src/module/random.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "vm.h" -#include "wren.h" - -// Implements the well equidistributed long-period linear PRNG (WELL512a). -// -// https://en.wikipedia.org/wiki/Well_equidistributed_long-period_linear -// -// Code from: http://www.lomont.org/Math/Papers/2008/Lomont_PRNG_2008.pdf -typedef struct -{ - uint32_t state[16]; - uint32_t index; -} Well512; - -static uint32_t advanceState(Well512* well) -{ - uint32_t a, b, c, d; - a = well->state[well->index]; - c = well->state[(well->index + 13) & 15]; - b = a ^ c ^ (a << 16) ^ (c << 15); - c = well->state[(well->index + 9) & 15]; - c ^= (c >> 11); - a = well->state[well->index] = b ^ c; - d = a ^ ((a << 5) & 0xda442d24U); - well->index = (well->index + 15) & 15; - a = well->state[well->index]; - well->state[well->index] = a ^ b ^ d ^ (a << 2) ^ (b << 18) ^ (c << 28); - return well->state[well->index]; -} - -void randomAllocate(WrenVM* vm) -{ - Well512* well = (Well512*)wrenAllocateForeign(vm, sizeof(Well512)); - well->index = 0; -} - -void randomSeed0(WrenVM* vm) -{ - Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); - - srand((uint32_t)time(NULL)); - for (int i = 0; i < 16; i++) - { - well->state[i] = rand(); - } -} - -void randomSeed1(WrenVM* vm) -{ - Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); - - srand((uint32_t)wrenGetArgumentDouble(vm, 1)); - for (int i = 0; i < 16; i++) - { - well->state[i] = rand(); - } -} - -void randomSeed16(WrenVM* vm) -{ - Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); - - for (int i = 0; i < 16; i++) - { - well->state[i] = (uint32_t)wrenGetArgumentDouble(vm, i + 1); - } -} - -void randomFloat(WrenVM* vm) -{ - Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); - - // A double has 53 bits of precision in its mantissa, and we'd like to take - // full advantage of that, so we need 53 bits of random source data. - - // First, start with 32 random bits, shifted to the left 21 bits. - double result = (double)advanceState(well) * (1 << 21); - - // Then add another 21 random bits. - result += (double)(advanceState(well) & ((1 << 21) - 1)); - - // Now we have a number from 0 - (2^53). Divide be the range to get a double - // from 0 to 1.0 (half-inclusive). - result /= 9007199254740992.0; - - wrenReturnDouble(vm, result); -} - -void randomInt0(WrenVM* vm) -{ - Well512* well = (Well512*)wrenGetArgumentForeign(vm, 0); - - wrenReturnDouble(vm, (double)advanceState(well)); -} diff --git a/src/vm/wren_common.h b/src/vm/wren_common.h index 8356b2c5..1d33ad84 100644 --- a/src/vm/wren_common.h +++ b/src/vm/wren_common.h @@ -44,11 +44,15 @@ #endif #endif -// If true, loads the "meta" built in module. -// -// Defaults to on. -#ifndef WREN_USE_META_MODULE - #define WREN_USE_META_MODULE 1 +// The VM includes a number of optional "auxiliary" modules. You can choose to +// include these or not. By default, they are all available. To disable one, +// set the corresponding `WREN_AUX_` define to `0`. +#ifndef WREN_AUX_META + #define WREN_AUX_META 1 +#endif + +#ifndef WREN_AUX_RANDOM + #define WREN_AUX_RANDOM 1 #endif // These flags are useful for debugging and hacking on Wren itself. They are not diff --git a/src/vm/wren_vm.c b/src/vm/wren_vm.c index 35b46b35..af81aac2 100644 --- a/src/vm/wren_vm.c +++ b/src/vm/wren_vm.c @@ -8,8 +8,11 @@ #include "wren_debug.h" #include "wren_vm.h" -#if WREN_USE_META_MODULE - #include "wren_meta.h" +#if WREN_AUX_META + #include "wren_aux_meta.h" +#endif +#if WREN_AUX_RANDOM + #include "wren_aux_random.h" #endif #if WREN_DEBUG_TRACE_MEMORY || WREN_DEBUG_TRACE_GC @@ -57,10 +60,14 @@ WrenVM* wrenNewVM(WrenConfiguration* config) wrenInitializeCore(vm); - #if WREN_USE_META_MODULE + // TODO: Lazy load these. + #if WREN_AUX_META wrenLoadMetaModule(vm); #endif - + #if WREN_AUX_RANDOM + wrenLoadRandomModule(vm); + #endif + return vm; } @@ -449,17 +456,14 @@ static ObjFiber* loadModule(WrenVM* vm, Value name, const char* source) // multiple times. wrenMapSet(vm, vm->modules, name, OBJ_VAL(module)); - // Implicitly import the core module (unless we *are* core). - if (!IS_NULL(name)) + // Implicitly import the core module. + ObjModule* coreModule = getModule(vm, NULL_VAL); + for (int i = 0; i < coreModule->variables.count; i++) { - ObjModule* coreModule = getModule(vm, NULL_VAL); - for (int i = 0; i < coreModule->variables.count; i++) - { - wrenDefineVariable(vm, module, - coreModule->variableNames.data[i].buffer, - coreModule->variableNames.data[i].length, - coreModule->variables.data[i]); - } + wrenDefineVariable(vm, module, + coreModule->variableNames.data[i].buffer, + coreModule->variableNames.data[i].length, + coreModule->variables.data[i]); } } diff --git a/util/wren.mk b/util/wren.mk index 00ea9d90..21ab9a41 100644 --- a/util/wren.mk +++ b/util/wren.mk @@ -19,6 +19,9 @@ # Then, for the libraries, the correct extension is added. # Files. +AUX_HEADERS := $(wildcard src/aux/*.h) $(wildcard src/aux/*.wren.inc) +AUX_SOURCES := $(wildcard src/aux/*.c) + CLI_HEADERS := $(wildcard src/cli/*.h) CLI_SOURCES := $(wildcard src/cli/*.c) @@ -106,6 +109,7 @@ endif CFLAGS := $(C_OPTIONS) $(C_WARNINGS) +AUX_OBJECTS := $(addprefix $(BUILD_DIR)/aux/, $(notdir $(AUX_SOURCES:.c=.o))) CLI_OBJECTS := $(addprefix $(BUILD_DIR)/cli/, $(notdir $(CLI_SOURCES:.c=.o))) MODULE_OBJECTS := $(addprefix $(BUILD_DIR)/module/, $(notdir $(MODULE_SOURCES:.c=.o))) VM_OBJECTS := $(addprefix $(BUILD_DIR)/vm/, $(notdir $(VM_SOURCES:.c=.o))) @@ -134,26 +138,27 @@ cli: bin/$(WREN) test: $(BUILD_DIR)/test/$(WREN) # Command-line interpreter. -bin/$(WREN): $(CLI_OBJECTS) $(MODULE_OBJECTS) $(VM_OBJECTS) $(LIBUV) +bin/$(WREN): $(AUX_OBJECTS) $(CLI_OBJECTS) $(MODULE_OBJECTS) $(VM_OBJECTS) \ + $(LIBUV) @ printf "%10s %-30s %s\n" $(CC) $@ "$(C_OPTIONS)" @ mkdir -p bin @ $(CC) $(CFLAGS) $^ -o $@ -lm $(LIBUV_LIBS) # Static library. -lib/lib$(WREN).a: $(VM_OBJECTS) +lib/lib$(WREN).a: $(AUX_OBJECTS) $(VM_OBJECTS) @ printf "%10s %-30s %s\n" $(AR) $@ "rcu" @ mkdir -p lib @ $(AR) rcu $@ $^ # Shared library. -lib/lib$(WREN).$(SHARED_EXT): $(VM_OBJECTS) +lib/lib$(WREN).$(SHARED_EXT): $(AUX_OBJECTS) $(VM_OBJECTS) @ printf "%10s %-30s %s\n" $(CC) $@ "$(C_OPTIONS) $(SHARED_LIB_FLAGS)" @ mkdir -p lib @ $(CC) $(CFLAGS) -shared $(SHARED_LIB_FLAGS) -o $@ $^ # Test executable. -$(BUILD_DIR)/test/$(WREN): $(TEST_OBJECTS) $(MODULE_OBJECTS) $(VM_OBJECTS) \ - $(BUILD_DIR)/cli/modules.o $(BUILD_DIR)/cli/vm.o $(LIBUV) +$(BUILD_DIR)/test/$(WREN): $(AUX_OBJECTS) $(MODULE_OBJECTS) $(TEST_OBJECTS) \ + $(VM_OBJECTS) $(BUILD_DIR)/cli/modules.o $(BUILD_DIR)/cli/vm.o $(LIBUV) @ printf "%10s %-30s %s\n" $(CC) $@ "$(C_OPTIONS)" @ mkdir -p $(BUILD_DIR)/test @ $(CC) $(CFLAGS) $^ -o $@ -lm $(LIBUV_LIBS) @@ -172,14 +177,21 @@ $(BUILD_DIR)/module/%.o: src/module/%.c $(CLI_HEADERS) $(MODULE_HEADERS) \ @ mkdir -p $(BUILD_DIR)/module @ $(CC) -c $(CFLAGS) $(CLI_FLAGS) -o $@ $(FILE_FLAG) $< +# Aux object files. +$(BUILD_DIR)/aux/%.o: src/aux/%.c $(VM_HEADERS) $(AUX_HEADERS) + @ printf "%10s %-30s %s\n" $(CC) $< "$(C_OPTIONS)" + @ mkdir -p $(BUILD_DIR)/aux + @ $(CC) -c $(CFLAGS) -Isrc/include -Isrc/vm -o $@ $(FILE_FLAG) $< + # VM object files. $(BUILD_DIR)/vm/%.o: src/vm/%.c $(VM_HEADERS) @ printf "%10s %-30s %s\n" $(CC) $< "$(C_OPTIONS)" @ mkdir -p $(BUILD_DIR)/vm - @ $(CC) -c $(CFLAGS) -Isrc/include -o $@ $(FILE_FLAG) $< + @ $(CC) -c $(CFLAGS) -Isrc/include -Isrc/aux -Isrc/vm -o $@ $(FILE_FLAG) $< # Test object files. -$(BUILD_DIR)/test/%.o: test/api/%.c $(MODULE_HEADERS) $(VM_HEADERS) $(TEST_HEADERS) $(LIBUV) +$(BUILD_DIR)/test/%.o: test/api/%.c $(AUX_HEADERS) $(MODULE_HEADERS) \ + $(VM_HEADERS) $(TEST_HEADERS) $(LIBUV) @ printf "%10s %-30s %s\n" $(CC) $< "$(C_OPTIONS)" @ mkdir -p $(dir $@) @ $(CC) -c $(CFLAGS) $(CLI_FLAGS) -o $@ $(FILE_FLAG) $< @@ -193,6 +205,9 @@ $(LIBUV): $(LIBUV_DIR)/build/gyp/gyp util/libuv.py @ ./util/libuv.py build $(LIBUV_ARCH) # Wren modules that get compiled into the binary as C strings. +src/aux/wren_aux_%.wren.inc: src/aux/wren_aux_%.wren util/wren_to_c_string.py + @ ./util/wren_to_c_string.py $@ $< + src/vm/wren_%.wren.inc: builtin/%.wren util/wren_to_c_string.py @ ./util/wren_to_c_string.py $@ $< diff --git a/util/wren_to_c_string.py b/util/wren_to_c_string.py index 445b7be8..c93b1b1a 100755 --- a/util/wren_to_c_string.py +++ b/util/wren_to_c_string.py @@ -42,6 +42,8 @@ def main(): wren_source_lines = f.readlines() module = os.path.splitext(os.path.basename(args.input))[0] + module = module.replace("wren_aux_", "") + c_source = wren_to_c_string(args.input, wren_source_lines, module) with open(args.output, "w") as f: diff --git a/util/xcode/wren.xcodeproj/project.pbxproj b/util/xcode/wren.xcodeproj/project.pbxproj index 88752a25..53b8331f 100644 --- a/util/xcode/wren.xcodeproj/project.pbxproj +++ b/util/xcode/wren.xcodeproj/project.pbxproj @@ -25,6 +25,14 @@ 29729F321BA70A620099CA20 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 29729F2E1BA70A620099CA20 /* io.c */; }; 29729F331BA70A620099CA20 /* io.wren.inc in Sources */ = {isa = PBXBuildFile; fileRef = 29729F301BA70A620099CA20 /* io.wren.inc */; }; 2986F6D71ACF93BA00BCE26C /* wren_primitive.c in Sources */ = {isa = PBXBuildFile; fileRef = 2986F6D51ACF93BA00BCE26C /* wren_primitive.c */; }; + 29AF31F11BD2E38F00AAD156 /* wren_aux_meta.c in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31EF1BD2E38F00AAD156 /* wren_aux_meta.c */; }; + 29AF31F21BD2E38F00AAD156 /* wren_aux_meta.c in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31EF1BD2E38F00AAD156 /* wren_aux_meta.c */; }; + 29AF31F61BD2E98600AAD156 /* wren_aux_meta.wren.inc in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31F31BD2E98600AAD156 /* wren_aux_meta.wren.inc */; }; + 29AF31F71BD2E98600AAD156 /* wren_aux_meta.wren.inc in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31F31BD2E98600AAD156 /* wren_aux_meta.wren.inc */; }; + 29AF31F81BD2E98600AAD156 /* wren_aux_random.c in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31F41BD2E98600AAD156 /* wren_aux_random.c */; }; + 29AF31F91BD2E98600AAD156 /* wren_aux_random.c in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31F41BD2E98600AAD156 /* wren_aux_random.c */; }; + 29AF31FA1BD2E98600AAD156 /* wren_aux_random.wren.inc in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31F51BD2E98600AAD156 /* wren_aux_random.wren.inc */; }; + 29AF31FB1BD2E98600AAD156 /* wren_aux_random.wren.inc in Sources */ = {isa = PBXBuildFile; fileRef = 29AF31F51BD2E98600AAD156 /* wren_aux_random.wren.inc */; }; 29C8A9331AB71FFF00DEC81D /* vm.c in Sources */ = {isa = PBXBuildFile; fileRef = 29C8A9311AB71FFF00DEC81D /* vm.c */; }; 29DC149F1BBA2FCC008A8274 /* vm.c in Sources */ = {isa = PBXBuildFile; fileRef = 29C8A9311AB71FFF00DEC81D /* vm.c */; }; 29DC14A01BBA2FD6008A8274 /* timer.c in Sources */ = {isa = PBXBuildFile; fileRef = 2901D7621B74F4050083A2C8 /* timer.c */; }; @@ -32,7 +40,6 @@ 29DC14A21BBA300A008A8274 /* wren_compiler.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C921AB4E6430073018D /* wren_compiler.c */; }; 29DC14A31BBA300D008A8274 /* wren_core.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C931AB4E6430073018D /* wren_core.c */; }; 29DC14A41BBA3010008A8274 /* wren_debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C941AB4E6430073018D /* wren_debug.c */; }; - 29DC14A51BBA3013008A8274 /* wren_meta.c in Sources */ = {isa = PBXBuildFile; fileRef = 29DE39511AC3A50A00987D41 /* wren_meta.c */; }; 29DC14A61BBA3017008A8274 /* wren_primitive.c in Sources */ = {isa = PBXBuildFile; fileRef = 2986F6D51ACF93BA00BCE26C /* wren_primitive.c */; }; 29DC14A71BBA301A008A8274 /* wren_utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C961AB4E6430073018D /* wren_utils.c */; }; 29DC14A81BBA301D008A8274 /* wren_value.c in Sources */ = {isa = PBXBuildFile; fileRef = 29205C971AB4E6430073018D /* wren_value.c */; }; @@ -41,11 +48,6 @@ 29DC14AB1BBA3038008A8274 /* foreign_class.c in Sources */ = {isa = PBXBuildFile; fileRef = 29D009A81B7E39A8000CE58C /* foreign_class.c */; }; 29DC14AC1BBA303D008A8274 /* returns.c in Sources */ = {isa = PBXBuildFile; fileRef = 29D009AA1B7E39A8000CE58C /* returns.c */; }; 29DC14AD1BBA3040008A8274 /* value.c in Sources */ = {isa = PBXBuildFile; fileRef = 29D009AC1B7E39A8000CE58C /* value.c */; }; - 29DE39531AC3A50A00987D41 /* wren_meta.c in Sources */ = {isa = PBXBuildFile; fileRef = 29DE39511AC3A50A00987D41 /* wren_meta.c */; }; - 29F384141BD20FF1002F84E0 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 29F384121BD20FF1002F84E0 /* random.c */; }; - 29F384151BD20FF1002F84E0 /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 29F384121BD20FF1002F84E0 /* random.c */; }; - 29F384161BD20FF1002F84E0 /* random.wren.inc in Sources */ = {isa = PBXBuildFile; fileRef = 29F384131BD20FF1002F84E0 /* random.wren.inc */; }; - 29F384171BD20FF1002F84E0 /* random.wren.inc in Sources */ = {isa = PBXBuildFile; fileRef = 29F384131BD20FF1002F84E0 /* random.wren.inc */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -102,6 +104,12 @@ 2986F6D51ACF93BA00BCE26C /* wren_primitive.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wren_primitive.c; path = ../../src/vm/wren_primitive.c; sourceTree = ""; }; 2986F6D61ACF93BA00BCE26C /* wren_primitive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_primitive.h; path = ../../src/vm/wren_primitive.h; sourceTree = ""; }; 29AB1F061816E3AD004B501E /* wren */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = wren; sourceTree = BUILT_PRODUCTS_DIR; }; + 29AF31EF1BD2E38F00AAD156 /* wren_aux_meta.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wren_aux_meta.c; path = ../../src/aux/wren_aux_meta.c; sourceTree = ""; }; + 29AF31F01BD2E38F00AAD156 /* wren_aux_meta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_aux_meta.h; path = ../../src/aux/wren_aux_meta.h; sourceTree = ""; }; + 29AF31F31BD2E98600AAD156 /* wren_aux_meta.wren.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = wren_aux_meta.wren.inc; path = ../../src/aux/wren_aux_meta.wren.inc; sourceTree = ""; }; + 29AF31F41BD2E98600AAD156 /* wren_aux_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wren_aux_random.c; path = ../../src/aux/wren_aux_random.c; sourceTree = ""; }; + 29AF31F51BD2E98600AAD156 /* wren_aux_random.wren.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = wren_aux_random.wren.inc; path = ../../src/aux/wren_aux_random.wren.inc; sourceTree = ""; }; + 29AF31FC1BD2E9B300AAD156 /* wren_aux_random.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_aux_random.h; path = ../../src/aux/wren_aux_random.h; sourceTree = ""; }; 29C8A9311AB71FFF00DEC81D /* vm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vm.c; path = ../../src/cli/vm.c; sourceTree = ""; }; 29C8A9321AB71FFF00DEC81D /* vm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vm.h; path = ../../src/cli/vm.h; sourceTree = ""; }; 29D009A61B7E3993000CE58C /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = main.c; path = ../../test/api/main.c; sourceTree = ""; }; @@ -111,11 +119,7 @@ 29D009AB1B7E39A8000CE58C /* returns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = returns.h; path = ../../test/api/returns.h; sourceTree = ""; }; 29D009AC1B7E39A8000CE58C /* value.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = value.c; path = ../../test/api/value.c; sourceTree = ""; }; 29D009AD1B7E39A8000CE58C /* value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = value.h; path = ../../test/api/value.h; sourceTree = ""; }; - 29DE39511AC3A50A00987D41 /* wren_meta.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wren_meta.c; path = ../../src/vm/wren_meta.c; sourceTree = ""; }; - 29DE39521AC3A50A00987D41 /* wren_meta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wren_meta.h; path = ../../src/vm/wren_meta.h; sourceTree = ""; }; 29F384111BD19706002F84E0 /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = io.h; path = ../../src/module/io.h; sourceTree = ""; }; - 29F384121BD20FF1002F84E0 /* random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = random.c; path = ../../src/module/random.c; sourceTree = ""; }; - 29F384131BD20FF1002F84E0 /* random.wren.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = random.wren.inc; path = ../../src/module/random.wren.inc; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -144,8 +148,6 @@ 29F384111BD19706002F84E0 /* io.h */, 29729F2E1BA70A620099CA20 /* io.c */, 29729F301BA70A620099CA20 /* io.wren.inc */, - 29F384121BD20FF1002F84E0 /* random.c */, - 29F384131BD20FF1002F84E0 /* random.wren.inc */, 291647C31BA5EA45006142EE /* scheduler.h */, 291647C21BA5EA45006142EE /* scheduler.c */, 291647CD1BA5ED26006142EE /* scheduler.wren.inc */, @@ -165,8 +167,6 @@ 29205C931AB4E6430073018D /* wren_core.c */, 29205CA41AB4E65E0073018D /* wren_debug.h */, 29205C941AB4E6430073018D /* wren_debug.c */, - 29DE39521AC3A50A00987D41 /* wren_meta.h */, - 29DE39511AC3A50A00987D41 /* wren_meta.c */, 296371B31AC713D000079FDA /* wren_opcodes.h */, 2986F6D61ACF93BA00BCE26C /* wren_primitive.h */, 2986F6D51ACF93BA00BCE26C /* wren_primitive.c */, @@ -203,6 +203,7 @@ 29AB1EFD1816E3AD004B501E = { isa = PBXGroup; children = ( + 29AF31EE1BD2E37F00AAD156 /* aux */, 29205CA91AB4E67B0073018D /* cli */, 29205CAA1AB4E6840073018D /* include */, 2901D7611B74F3E20083A2C8 /* module */, @@ -222,6 +223,19 @@ name = Products; sourceTree = ""; }; + 29AF31EE1BD2E37F00AAD156 /* aux */ = { + isa = PBXGroup; + children = ( + 29AF31F01BD2E38F00AAD156 /* wren_aux_meta.h */, + 29AF31EF1BD2E38F00AAD156 /* wren_aux_meta.c */, + 29AF31F31BD2E98600AAD156 /* wren_aux_meta.wren.inc */, + 29AF31FC1BD2E9B300AAD156 /* wren_aux_random.h */, + 29AF31F41BD2E98600AAD156 /* wren_aux_random.c */, + 29AF31F51BD2E98600AAD156 /* wren_aux_random.wren.inc */, + ); + name = aux; + sourceTree = ""; + }; 29D0099A1B7E394F000CE58C /* api_test */ = { isa = PBXGroup; children = ( @@ -312,23 +326,24 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 29AF31F11BD2E38F00AAD156 /* wren_aux_meta.c in Sources */, 29205C991AB4E6430073018D /* wren_compiler.c in Sources */, 2986F6D71ACF93BA00BCE26C /* wren_primitive.c in Sources */, 291647C71BA5EC5E006142EE /* modules.c in Sources */, 29205C9A1AB4E6430073018D /* wren_core.c in Sources */, 2901D7641B74F4050083A2C8 /* timer.c in Sources */, 29729F331BA70A620099CA20 /* io.wren.inc in Sources */, + 29AF31F61BD2E98600AAD156 /* wren_aux_meta.wren.inc in Sources */, 29C8A9331AB71FFF00DEC81D /* vm.c in Sources */, + 29AF31F81BD2E98600AAD156 /* wren_aux_random.c in Sources */, 291647C41BA5EA45006142EE /* scheduler.c in Sources */, 29205C9B1AB4E6430073018D /* wren_debug.c in Sources */, 29205C9D1AB4E6430073018D /* wren_utils.c in Sources */, - 29F384141BD20FF1002F84E0 /* random.c in Sources */, 29729F311BA70A620099CA20 /* io.c in Sources */, 29205C9E1AB4E6430073018D /* wren_value.c in Sources */, 29205C9F1AB4E6430073018D /* wren_vm.c in Sources */, - 29DE39531AC3A50A00987D41 /* wren_meta.c in Sources */, 29205C8F1AB4E5C90073018D /* main.c in Sources */, - 29F384161BD20FF1002F84E0 /* random.wren.inc in Sources */, + 29AF31FA1BD2E98600AAD156 /* wren_aux_random.wren.inc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -339,22 +354,23 @@ 29729F321BA70A620099CA20 /* io.c in Sources */, 291647C81BA5EC5E006142EE /* modules.c in Sources */, 29DC14A11BBA2FEC008A8274 /* scheduler.c in Sources */, + 29AF31F21BD2E38F00AAD156 /* wren_aux_meta.c in Sources */, 29DC14A01BBA2FD6008A8274 /* timer.c in Sources */, 29DC149F1BBA2FCC008A8274 /* vm.c in Sources */, 29DC14A21BBA300A008A8274 /* wren_compiler.c in Sources */, - 29F384151BD20FF1002F84E0 /* random.c in Sources */, 29DC14A31BBA300D008A8274 /* wren_core.c in Sources */, 29DC14A41BBA3010008A8274 /* wren_debug.c in Sources */, - 29DC14A51BBA3013008A8274 /* wren_meta.c in Sources */, 29DC14A61BBA3017008A8274 /* wren_primitive.c in Sources */, 29DC14A71BBA301A008A8274 /* wren_utils.c in Sources */, + 29AF31FB1BD2E98600AAD156 /* wren_aux_random.wren.inc in Sources */, + 29AF31F91BD2E98600AAD156 /* wren_aux_random.c in Sources */, 29DC14A81BBA301D008A8274 /* wren_value.c in Sources */, 29DC14A91BBA302F008A8274 /* wren_vm.c in Sources */, - 29F384171BD20FF1002F84E0 /* random.wren.inc in Sources */, 29DC14AA1BBA3032008A8274 /* main.c in Sources */, 293D46961BB43F9900200083 /* call.c in Sources */, 29DC14AB1BBA3038008A8274 /* foreign_class.c in Sources */, 29DC14AC1BBA303D008A8274 /* returns.c in Sources */, + 29AF31F71BD2E98600AAD156 /* wren_aux_meta.wren.inc in Sources */, 29DC14AD1BBA3040008A8274 /* value.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0;