diff options
| -rw-r--r-- | README | 23 | ||||
| -rw-r--r-- | functions.txt | 132 |
2 files changed, 155 insertions, 0 deletions
@@ -0,0 +1,23 @@ +# neb + +now in bytecode + +## broken things +[ ] VM immediately returns after a `def` +[ ] lists work for atoms like `(list 1 2 3)` but not evaluated expressions + like `(list (+ 2 3) 4 5)` (i think that only includes 3 4 5). might need + something like a MAKE_LIST op, followed by a length of how many items? + i feel like i'm really bastardizing bytecode instructions. +[ ] the emitted code is lousy with runtime typechecks. these are good to have, + generally speaking, but a) should be able to do more compile time type + checks to avoid some of them, b) should only need to type check certain + things once (so long as variables can't change type), and c) should probably + generalize the typecheck op with a parameter to enable more flexibility +[ ] i mean, nearly nothing works + +## things that hopefully work +[x] addition! +[x] subtraction! +[x] `if`/`and`/`or`! +[x] `>`/`<` and co. +[x] `func` to define a function, assuming it only has ^^ those things diff --git a/functions.txt b/functions.txt new file mode 100644 index 0000000..986164f --- /dev/null +++ b/functions.txt @@ -0,0 +1,132 @@ +CONTROL FLOW: +[x] and +[ ] branch +[ ] drop-while +[ ] for-count +[ ] for-each +[x] if +[x] or +[ ] take-while +[ ] while + +DEFINITIONS: +[x] def +[-] func +[ ] redef +[ ] type +[ ] use +[ ] use-as + +FILES: +[ ] close +[ ] exists? +[ ] glob +[ ] open-append +[ ] open-read +[ ] open-write +[ ] read +[ ] read-lines +[ ] unlink +[ ] write + +HOF: +[ ] filter +[ ] map +[ ] reduce + +LISP-Y: +[ ] apply +[x] block +[ ] parse-neb +[ ] eval +[ ] lambda +[ ] quote + +LISTS: +[ ] append +[ ] empty? +[ ] first +[ ] in? +[ ] last +[ ] length +[-] list (works, but adds every item as a constant?) +[ ] most +[ ] prepend +[ ] rest +[ ] reverse +[ ] shuf +[ ] slice + +LOGIC: +[x] < +[x] <= +[x] > +[x] >= +[ ] eq? +[x] not + +MATH: +[ ] * +[x] + +[x] - +[ ] / +[ ] floor + +META: +[ ] funcs +[ ] howto +[ ] symbols +[ ] syntax +[ ] user-funcs +[ ] user-symbols + +STRINGS: +[-] concat (accepts a single string) (this should be a Native function) +[ ] first +[ ] join +[ ] last +[ ] length +[ ] most +[ ] ord +[ ] raw +[ ] rest +[ ] reverse +[ ] slice +[ ] split +[ ] strip + +TERMINAL: +[ ] $ +[ ] argv +[ ] clear +[ ] env +[ ] exit +[ ] print +[ ] read-char +[ ] read-line + +TYPES: +[ ] ->string +[ ] any? +[ ] bool? +[ ] float? +[ ] handle? +[ ] int? +[ ] list? +[ ] literal? +[ ] nil? +[ ] number? +[ ] string->float +[ ] string->int +[ ] string? +[ ] type? +[ ] typeof + + +OTHER: +[ ] remove +[ ] zip +[ ] assert +[ ] bench +[ ] try + |
