part of migration to gc

This commit is contained in:
ProgramSnail 2024-10-20 16:42:57 +03:00
parent fb1ec1c7ae
commit d782934f0c
5 changed files with 457 additions and 337 deletions

35
byterun/include/builtin.h Normal file
View file

@ -0,0 +1,35 @@
#pragma once
#include <stdio.h>
#include "operations.h"
inline void f_read(struct State *s) {
int x = 0;
printf("> "); // TODO: ??
scanf("%i", &x);
s_put_i(s, x);
}
inline void f_write(struct State *s) {
int x = s_take_i(s);
printf("%i", x);
// put 0 ??
}
inline void f_length(struct State *s) {
// TODO
}
inline void f_string(struct State *s) {
// TODO
}
inline void f_array(struct State *s, int sz) {
// TODO
}
inline void f_cons(struct State *s) {
// TODO
}