aboutsummaryrefslogtreecommitdiff

neb

now in bytecode

broken things

  • [x] ~~VM immediately returns after a def~~ (fixed with d13ae11c4f?)
  • [x] ~~lists work for atoms like (list 1 2 3) but not evaluated expressions like (list (+ 2 3) 4 5)~~ fixed with d95e4f6f98 and 9fe6496202. i'm almost definitely still bastardizing bytecode.
  • [ ] 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 helpful~~ stopped running with 11e9f1d854, helful? not really, not yet.
  • [x] ~~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
  • [x] ~~append on an empty list segfaults~~ fixed with af07e3fba5
  • [ ] arity checking is entirely arbitrary for builtins, non-existant for user-defined functions
  • [-] ~~parsing does not handle types correctly, or comments at all~~ parse (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

  • [x] math (*+/-)
  • [x] control flow (if/and/or)
  • [x] logic (>/</eq?/not and co.)
  • [-] func to define a function (global only?), lambda to make one on the fly
  • [x] def, globally and locally
  • [x] block? maybe?
  • [x] print (works on everything, no need to ->string)
  • [-] lists/strings:
    • [x] first
    • [x] rest
    • [x] most
    • [x] last
    • [x] reverse
    • [x] length
    • [x] concat/append
    • [x] in? (membership for lists, substrings for strings)
  • [-] types:
    • [x] any?/nil?
  • [-] higher-order functions
    • [x] 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)
    • [x] reduce