demo.c
1 #include <stdio.h>
2 #include <kuroko/kuroko.h>
3 #include <kuroko/vm.h>
4 
5 int main(int argc, char *argv[]) {
6  krk_initVM(0);
7  krk_startModule("__main__");
8  krk_interpret("import kuroko\nprint('Kuroko',kuroko.version)\n", "<stdin>");
9  krk_freeVM();
10  return 0;
11 }
12 
Top-level header with configuration macros.
void krk_freeVM(void)
Release resources from the VM.
Definition: vm.c:953
void krk_initVM(int flags)
Initialize the VM at program startup.
Definition: vm.c:868
Core API for the bytecode virtual machine.
KrkValue krk_interpret(const char *src, const char *fromFile)
Compile and execute a source code input.
Definition: vm.c:3219
KrkInstance * krk_startModule(const char *name)
Set up a new module object in the current thread.
Definition: vm.c:3209