Hit the TODO list with a blunt instrument a couple of times.
Chris Pressey
10 years ago
2 | 2 | |
3 | 3 | ### higher-priority ### |
4 | 4 | |
5 | * apropos to that, using an ad-hoc syntax, is: | |
6 | * `production @ %stdin` is the default; it is implied when no `@` | |
7 | * `production @ %mmap` to use the mmap scanner | |
8 | * `production @ %line` to use an interactive terminal line editor-ish | |
9 | scanner or something. | |
5 | * allow switching the kind of buffer that is used when `@` is used: | |
6 | * `rule @ %stdin` is the default; it is implied when no `@` | |
7 | * `rule @ %mmap` to use an MmapBuffer | |
8 | * `rule @ %line` to use a LineEditorBuffer | |
9 | * `rule @ $:open('file.txt')` ? | |
10 | 10 | * `$:add`, `$:sub`, `$:mul`, `$:div`, `$:rem`, for atoms which look like |
11 | integers: `["-"] & {$:digit}`. or for an actual integer type. | |
11 | integers: `["-"] & {$:digit}`. | |
12 | 12 | * `$:tell` and `$:seek` the implicit buffer — for VM's etc — although |
13 | 13 | note, this may have scary consequences when combined with backtracking |
14 | 14 | * pattern match in send: (can't go in set b/c it looks like a nonterminal) |
15 | 15 | * `fields → fields(H,T) & H` |
16 | ||
17 | ### medium-priority ### | |
18 | ||
19 | * Starting with knowns about `$` builtins, an analysis to determine, for Rule: | |
20 | - may consume input, never consumes input | |
21 | - may fail, always fails | |
22 | - may succeed, always succeeds... (may_backtrack?) | |
23 | * production values | |
24 | * `$:fold(^production, nil, cons)` | |
25 | * `$:fold(^($:alnum & " "), '', ^L+','+R)` | |
16 | 26 | * codegen and emitter phases in compiler. take current compiler phase, |
17 | 27 | make it construct a low-level representation instead (codegen), then |
18 | 28 | have a phase that writes out C code from that low-level repr (emitter) |
29 | * non-backtracking versions of `|` and `{}`: `|!` and `{}!` | |
19 | 30 | |
20 | 31 | ### testing ### |
21 | 32 | |
29 | 40 | |
30 | 41 | ### lower-priority ### |
31 | 42 | |
32 | * `(foo → S | ok)` & print S ... should set S to error if foo failed? | |
33 | * or `(foo |→ S ok)` ? | |
34 | 43 | * `ctype` module, with `alpha` and `digit` and etc. |
35 | 44 | * `list` module: `deep_reverse` |
36 | 45 | * use Tamsin repr in error messages |
37 | 46 | * __str__ should be Tamsin repr()? |
38 | * `format`, using `@` — in Tamsin (don't we have this?) | |
39 | * `\s` production for whitespace | |
40 | * `\f` escape for form feed (why??) | |
41 | * non-backtracking versions of `|` and `{}`: `|!` and `{}!` | |
47 | * regex-like shortcuts: `\w` for "word", `\s` for "whitespace", etc. | |
42 | 48 | * have compiler replace calls to `list` functions |
43 | 49 | by "more efficient" versions written in C -- if they really are... |
44 | 50 | * and maybe even garbage-collect terms in libtamsin |
45 | 51 | * figure out why reading a 4M file in a compiled program TAKES DOWN UBUNTU |
46 | 52 | * make it possible to recover from more errors using `|` (don't throw |
47 | 53 | exceptions so often) |
48 | * fold: often you want to construct terms "the other way" or to "join" | |
49 | a string with delimiters; can we handle those cases too? | |
50 | * actual production values would be really nice; then we could | |
51 | `$:fold(production, nil, cons)` | |
52 | or even | |
53 | `$:fold(^($:alnum & " "), '', ^L+','+R)` | |
54 | 54 | * stronger tests for scanner, parser: dump all falderal testbodies to files |
55 | 55 | * option for ref interp to not output result (or by default, don't) |
56 | 56 | * "mini" interpreter that handles variables (ouch) |
57 | * SOME WAY TO DISTINGUISH PRODUCTIONS WHICH MAY CONSUME INPUT AND | |
58 | PRODUCTIONS WHICH NEVER CONSUME INPUT (in the `$` module, and generally). | |
59 | * actual numeric values, rather than atoms-which-contain-only-digits | |
60 | 57 | * error handling: skip to next sentinel and report more errors |
61 | 58 | * module-level updatable variables. or globals. or "process dictionary" |
62 | 59 | `$:store()` and `$:fetch()`. or database. |
67 | 64 | * `walk(T@tree(L,R)) = ...` |
68 | 65 | * maps, implemented as hash tables. |
69 | 66 | * `Table ← {} & fields → F@fields(H,T) & Table[H] ← T` |
70 | * on that topic — production values and/or lambda productions... | |
71 | 67 | * pretty-print AST for error messages |
72 | 68 | |
73 | 69 | ### symbol fun ### |
95 | 91 | * term-rewriting library; a la Treacle; should make desugarer almost trivial |
96 | 92 | * algebraically cool version of `|`, perhaps as a worked example |
97 | 93 | (implement Bakerloo in Tamsin) |
98 | * analysis: always_succeeds(Rule) | |
99 | * analysis: may_backtrack(Rule) | |
100 | * analysis: may_consume_input(Rule) | |
101 | * regex-like shortcuts: `\w` for "word", `\s` for "whitespace", etc. | |
102 | 94 | * EOF and nil are the same? it would make sense... call it `end`? (do we?) |
103 | 95 | * productions with names with arbitrary characters in them. |
104 | 96 | * something like «foo» but foo is the name of a *non*terminal — symbolic |
120 | 112 | I don't think this is very necessary because you can usually just say |
121 | 113 | `(foo & bar) | baz` — but only if `bar` always succeeds, which it |
122 | 114 | usually does (to return something) |
123 | ||
115 | * `(foo → S | ok)` & print S ... should set S to error if foo failed? | |
116 | or `(foo |→ S ok)` ? |