1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# neb
now in bytecode
## broken things
- [x] ~~VM immediately returns after a `def`~~ (fixed with [d13ae11c4f](https://git.rawtext.club/mryouse/neb-d/commit/d13ae11c4f7cccd8f5e3ad072597c55c9471a638)?)
- [x] ~~lists work for atoms like `(list 1 2 3)` but not evaluated expressions
like `(list (+ 2 3) 4 5)`~~ fixed with [d95e4f6f98](https://git.rawtext.club/mryouse/neb-d/commit/d95e4f6f988b16bbd95a9c78c0355d190390f003)
and [9fe6496202](https://git.rawtext.club/mryouse/neb-d/commit/9fe6496202bd95d252ed2323a88fd24781780b64).
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](https://git.rawtext.club/mryouse/neb-d/commit/11e9f1d854602aae7cb895cfb2f9fc5dd338e6f8),
helful? not really, not yet.
- [x] ~~defining multiple functions in a script doesn't seem to work?~~ fixed with [fb4a026dc1](https://git.rawtext.club/mryouse/neb-d/commit/fb4a026dc1a5b6469ff1da013874bc570fe41439)
- [ ] 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](https://git.rawtext.club/mryouse/neb-d/commit/af07e3fba55ef98aabd54057c6e3433734b81111)
- [ ] 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](https://git.rawtext.club/mryouse/neb-d/commit/919994fd3224b6e3cb3e1ce534ae335cecd97f52),
parse comments with [9867aade2a](https://git.rawtext.club/mryouse/neb-d/commit/9867aade2a94ab13aec70f74ccf37d6c38e66fd0)
- [ ] 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)
- [ ] 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)
|