refactor: make interpreter portable with static pools and I/O hooks

Co-authored-by: aider (openrouter/moonshotai/kimi-k2.6) <aider@aider.chat>
This commit is contained in:
2026-05-03 22:35:21 +03:00
parent b115744991
commit f033187c6c
6 changed files with 145 additions and 153 deletions
+1 -5
View File
@@ -1,11 +1,7 @@
#include "forth.h"
Word* add_primitive(const char* name, void (*code)(Word*), uint8_t flags) {
Word* w = malloc(sizeof(Word));
if (!w) {
fprintf(stderr, "Out of memory\n");
exit(1);
}
Word* w = forth_alloc_word();
w->prev = dict_head;
dict_head = w;