diff options
| author | LLLL Colonq <llll@colonq> | 2026-08-14 14:51:01 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-08-14 14:51:01 -0400 |
| commit | fece4fc3d4decb70c94b49ab854fa9ae93b4d887 (patch) | |
| tree | 71e355aaae2381078d0a403f89abfc6e6d7343f6 /pit/include/lcq | |
| parent | 7b9c4a3ac265026d98624ac614eead866a190042 (diff) | |
pit: More VM-style evaluation
Diffstat (limited to 'pit/include/lcq')
| -rw-r--r-- | pit/include/lcq/pit/runtime.h | 1 | ||||
| -rw-r--r-- | pit/include/lcq/pit/runtime/compile.h | 9 | ||||
| -rw-r--r-- | pit/include/lcq/pit/runtime/eval.h | 3 | ||||
| -rw-r--r-- | pit/include/lcq/pit/runtime/value/func.h | 3 |
4 files changed, 13 insertions, 3 deletions
diff --git a/pit/include/lcq/pit/runtime.h b/pit/include/lcq/pit/runtime.h index 075d94c..70e65ca 100644 --- a/pit/include/lcq/pit/runtime.h +++ b/pit/include/lcq/pit/runtime.h @@ -98,6 +98,7 @@ void pit_repl(pit_runtime *rt); #include <lcq/pit/runtime/symtab.h> #include <lcq/pit/runtime/dump.h> #include <lcq/pit/runtime/macroexpand.h> +#include <lcq/pit/runtime/compile.h> #include <lcq/pit/runtime/eval.h> #include <lcq/pit/runtime/gc.h> diff --git a/pit/include/lcq/pit/runtime/compile.h b/pit/include/lcq/pit/runtime/compile.h new file mode 100644 index 0000000..ba0acb3 --- /dev/null +++ b/pit/include/lcq/pit/runtime/compile.h @@ -0,0 +1,9 @@ +#ifndef LCOLONQ_PIT_RUNTIME_COMPILE_H +#define LCOLONQ_PIT_RUNTIME_COMPILE_H + +#include <lcq/pit/runtime.h> + +pit_value pit_compile(pit_runtime *rt, pit_value top); +void pit_compile_install_special_forms(pit_runtime *rt); + +#endif diff --git a/pit/include/lcq/pit/runtime/eval.h b/pit/include/lcq/pit/runtime/eval.h index 41ec046..27df557 100644 --- a/pit/include/lcq/pit/runtime/eval.h +++ b/pit/include/lcq/pit/runtime/eval.h @@ -3,7 +3,8 @@ #include <lcq/pit/runtime.h> -pit_value pit_vm_compile(pit_runtime *rt, pit_value top); +bool pit_vm_run_one(pit_runtime *rt); pit_value pit_vm_eval(pit_runtime *rt, pit_value v); +pit_value pit_vm_apply(pit_runtime *rt, pit_value f, pit_value args); #endif diff --git a/pit/include/lcq/pit/runtime/value/func.h b/pit/include/lcq/pit/runtime/value/func.h index 852c90d..5855047 100644 --- a/pit/include/lcq/pit/runtime/value/func.h +++ b/pit/include/lcq/pit/runtime/value/func.h @@ -7,9 +7,8 @@ /* heavy value - func / nativefunc */ bool pit_value_is_func(pit_runtime *rt, pit_value a); bool pit_value_is_nativefunc(pit_runtime *rt, pit_value a); -pit_value pit_value_func_lambda(pit_runtime *rt, pit_value args, pit_value body); +pit_value pit_value_func_lambda(pit_runtime *rt, pit_value args, pit_value freevars, pit_value compiled); pit_value pit_value_nativefunc_new_with_data(pit_runtime *rt, pit_nativefunc f, void *data); pit_value pit_value_nativefunc_new(pit_runtime *rt, pit_nativefunc f); -pit_value pit_value_apply(pit_runtime *rt, pit_value f, pit_value args); #endif |
