You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
6 hours ago | |
---|---|---|
Makefile | 2 weeks ago | |
README.md | 6 hours ago | |
chunk.d | 2 days ago | |
compiler.d | 6 hours ago | |
core.neb | 6 hours ago | |
dbg.d | 2 days ago | |
fib.neb | 3 weeks ago | |
functions.txt | 1 day ago | |
main.d | 1 day ago | |
parser.d | 1 day ago | |
vm.d | 6 hours ago |
README.md
neb
now in bytecode
broken things
VM immediately returns after a(fixed with d13ae11c4f?)def
lists work for atoms likefixed with d95e4f6f98 and 9fe6496202. i'm almost definitely still bastardizing bytecode.(list 1 2 3)
but not evaluated expressions like(list (+ 2 3) 4 5)
- 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
- [-]
compiler errors don't stop the VM from running, and are not particularly helpfulstopped running with 11e9f1d854, helful? not really, not yet. defining multiple functions in a script doesn't seem to work?fixed with fb4a026dc1- there are many instances of popping on an empty stack. i have a warning emitted, which should help me track it down at some point, but at least it doesn't crash. Update 6/5: this is starting to really concern me
fixed with af07e3fba5append
on an empty list segfaults- arity checking is entirely arbitrary for builtins, non-existant for user-defined functions
- [-]
parsing does not handle types correctly, or comments at allparse (but ignore) types with 919994fd32, parse comments with 9867aade2a - bounds issues (
first
/last
on empty sequences) crashes entirely - constants get duplicated in chunks
- a space at the end of (definitions? lists?) crashes
- [-]
HOF can't take in builtins (they're not actually in the global environment)hacky non-final solution with 4446f10ea7 - looking up local variables in surrounding scopes does not work
- i mean, nearly nothing works
things that hopefully work
- math (*+/-)
- control flow (
if
/and
/or
) - logic (
>
/<
/eq?
/not
and co.) - [-]
func
to define a function (global only?),lambda
to make one on the fly def
, globally and locallyblock
? maybe?print
(works on everything, no need to->string
)- [-] lists/strings:
first
rest
most
last
reverse
length
concat
/append
in?
(membership for lists, substrings for strings)
- [-] types:
any?
/nil?
- [-] higher-order functions
map
! (i'm particularly excited about figuring out how to do this on the stack, though i'm sure it's quite a naive implementation)reduce