start work on new interpreter
This commit is contained in:
parent
7efa99d064
commit
2ac2f85512
15 changed files with 780 additions and 30 deletions
18
next/main.c
Normal file
18
next/main.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "core/opcodes.h"
|
||||
#include <growl.h>
|
||||
|
||||
static uint8_t code[] = {
|
||||
GOP_PUSH_NIL,
|
||||
GOP_RETURN,
|
||||
};
|
||||
|
||||
int main(void) {
|
||||
GrowlVM *vm = growl_vm_init();
|
||||
|
||||
Growl quot_obj = growl_make_quotation(vm, code, sizeof(code), NULL, 0);
|
||||
GrowlQuotation *quot = (GrowlQuotation *)(GROWL_UNBOX(quot_obj) + 1);
|
||||
vm_doquot(vm, quot);
|
||||
|
||||
growl_gc_collect(vm);
|
||||
growl_vm_free(vm);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue