diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cc3f563..98a0da3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -2,6 +2,18 @@ # Core Language +- new words + + - n:add + - n:sub + - n:mul + - n:div + - n:divmod + - n:mod + - d:hash + - d:rehash + - d:Hash-Function + # VM ## nga-c @@ -10,6 +22,7 @@ - global state now in a struct - minimal, functional FFI + - malloc/free support (from Rick C) # Documentation @@ -17,3 +30,10 @@ # Examples +- port of retroforth/ilo block editor + +---------------------------------------------------------------- +Important notes: + +- future releases will use 64-bit cells by default +---------------------------------------------------------------- diff --git a/example/amalgamate.retro b/example/amalgamate.retro index ab73153..df1d756 100644 --- a/example/amalgamate.retro +++ b/example/amalgamate.retro @@ -19,12 +19,18 @@ Include compilation instructions and enable i/o devices. ~~~ '/*_Build_with_`cc_-lm_-O2_retro-unix.c_-o_retro`_*/ s:put nl nl -{ 'FLOATS +'#define_BIT64 s:put nl + +{ 'CLOCK 'FILES - 'UNIX + 'FLOATS + 'MALLOC + 'MULTICORE 'RNG - 'CLOCK 'SCRIPTING + 'SIGNALS + 'UNIX + 'UNSIGNED } [ '#define_ENABLE\_%s s:format s:put nl ] a:for-each nl ~~~ diff --git a/interface/malloc.retro b/interface/malloc.retro new file mode 100644 index 0000000..8a33d4b --- /dev/null +++ b/interface/malloc.retro @@ -0,0 +1,21 @@ +# Malloc + +~~~ + +{{ + :mem:invoke #15 io:scan-for io:invoke ; + #0 'ALLOC const + #1 'FREE const + #2 'STORE const + #3 'FETCH const + +---reveal--- + + :mem:alloc (n--aa) ALLOC mem:invoke ; + :mem:set (an--) STORE mem:invoke ; + :mem:get (a--n) FETCH mem:invoke ; + :mem:free (aa--) FREE mem:invoke ; + +}} + +~~~ diff --git a/vm/nga-c/retro.c b/vm/nga-c/retro.c index 6598a33..cadaaff 100644 --- a/vm/nga-c/retro.c +++ b/vm/nga-c/retro.c @@ -24,11 +24,6 @@ #include #include -#ifdef ENABLE_TERMINAL -#include "linenoise.h" -#include "linenoise.c" -#endif - #ifdef ENABLE_SIGNALS #include #endif @@ -880,15 +875,6 @@ void io_filesystem(NgaState *vm) { } -#ifdef ENABLE_TERMINAL -void query_terminal(NgaState *vm) { -} - -void io_termina(NgaState *vm) { -} -#endif - - #ifdef ENABLE_UNIX /*--------------------------------------------------------------------- `unix_open_pipe()` is like `file_open()`, but for pipes. This pulls