Go over TODO.
Chris Pressey
10 years ago
0 | 0 | TODO |
1 | ---- | |
1 | ==== | |
2 | ||
3 | ### higher-priority ### | |
2 | 4 | |
3 | 5 | * don't consume stdin until asked to scan. demand_buffer. per-line loop. |
4 | 6 | or rather, per-inputconsumechunk |
7 | * apropos to that, using an ad-hoc syntax, is: | |
8 | * `production @ %stdin` is the default; it is implied when no `@` | |
9 | * `production @ %mmap` to use the mmap scanner | |
10 | * `production @ %line` to use an interactive terminal line editor-ish | |
11 | scanner or something. | |
12 | * `$:add`, `$:sub`, `$:mul`, `$:div`, `$:rem`, for atoms which look like | |
13 | integers: `["-"] & {$:digit}`. or for an actual integer type. | |
14 | * `$:tell` and `$:seek` the implicit buffer — for VM's etc — although | |
15 | note, this may have scary consequences when combined with backtracking | |
16 | * error reporting: line and column number (at least in Python version) | |
17 | * pattern match in send: (can't go in set b/c it looks like a nonterminal) | |
18 | * `fields → fields(H,T) & H` | |
19 | * codegen and emitter phases in compiler. take current compiler phase, | |
20 | make it construct a low-level representation instead (codegen), then | |
21 | have a phase that writes out C code from that low-level repr (emitter) | |
5 | 22 | |
6 | 23 | ### testing ### |
7 | 24 | |
13 | 30 | * test for mismatched # of formals in prod branches |
14 | 31 | * document the modules. in own document. plus tests. |
15 | 32 | |
16 | ### support for simulating machines and vms ### | |
17 | ||
18 | * `$:add`, `$:sub`, `$:mul`, `$:div`, `$:rem`, for atoms which look like | |
19 | integers: `["-"] & {$:digit}`. | |
20 | * `$:tell` and `$:seek` the implicit buffer -- for VM's etc -- although | |
21 | note, this may have scary consequences when combined with backtracking | |
22 | * non-backtracking versions of `|` and `{}`: `|!` and `{}!` | |
23 | ||
24 | 33 | ### lower-priority ### |
25 | 34 | |
26 | 35 | * `ctype` module, with `alpha` and `digit` and etc. |
27 | 36 | * `list` module: `deep_reverse` |
28 | 37 | * use Tamsin repr in error messages |
29 | 38 | * __str__ should be Tamsin repr()? |
30 | * `format`, using `@` -- in Tamsin | |
39 | * `format`, using `@` — in Tamsin (don't we have this?) | |
31 | 40 | * `\s` production for whitespace |
32 | * `\f` escape for form feed | |
41 | * `\f` escape for form feed (why??) | |
42 | * non-backtracking versions of `|` and `{}`: `|!` and `{}!` | |
33 | 43 | * have compiler replace calls to `list` functions |
34 | 44 | by "more efficient" versions written in C -- if they really are... |
35 | 45 | * and maybe even garbage-collect terms in libtamsin |
48 | 58 | * SOME WAY TO DISTINGUISH PRODUCTIONS WHICH MAY CONSUME INPUT AND |
49 | 59 | PRODUCTIONS WHICH NEVER CONSUME INPUT (in the `$` module, and generally). |
50 | 60 | * actual numeric values, rather than atoms-which-contain-only-digits |
51 | * error reporting: line number | |
52 | 61 | * error handling: skip to next sentinel and report more errors |
53 | 62 | * module-level updatable variables. or globals. or "process dictionary" |
54 | 63 | `$:store()` and `$:fetch()`. or database. |
57 | 66 | * should be able to import ("open") other modules into your own namespace. |
58 | 67 | * `@` a la Haskell in pattern-match: |
59 | 68 | * `walk(T@tree(L,R)) = ...` |
60 | * pattern match in send: (can't go in set b/c it looks like a nonterminal) | |
61 | * `fields → fields(H,T) & H` | |
62 | 69 | * maps, implemented as hash tables. |
63 | 70 | * `Table ← {} & fields → F@fields(H,T) & Table[H] ← T` |
64 | 71 | * on that topic — production values and/or lambda productions... |
69 | 76 | * `~` (Lua) for not and `!` (Prolog) for non-backtracking? |
70 | 77 | * lowercase greek letters are variables too! |
71 | 78 | * use `←` instead of `@`, why not? |
72 | * `A;B` — like `&` except assert (statically) that `A` always succeeds? | |
79 | * I'm always typing `prod() → rule` instead of `=`, so why not? | |
80 | * `A;B` — like `&` except assert (statically) that `A` always succeeds | |
73 | 81 | * be generous and allow `"xyz"` in term context position? |
74 | 82 | * denotational semantics sugar! something like... |
75 | 83 | |
92 | 100 | * analysis: may_backtrack(Rule) |
93 | 101 | * analysis: may_consume_input(Rule) |
94 | 102 | * regex-like shortcuts: `\w` for "word", `\s` for "whitespace", etc. |
95 | * EOF and nil are the same? it would make sense... call it `end`? | |
103 | * EOF and nil are the same? it would make sense... call it `end`? (do we?) | |
96 | 104 | * productions with names with arbitrary characters in them. |
97 | 105 | * something like «foo» but foo is the name of a *non*terminal — symbolic |
98 | 106 | production references (like Perl's horrible globs as a cheap substitute |
109 | 117 | * special form that consumes rest of input from the Tamsin source -- |
110 | 118 | maybe not such a gimmick since micro-tamsin does this |
111 | 119 | * feature-testing: `$.exists(module) | do_without_module` |
112 | * ternary: `foo ? bar : baz` -- if foo succeeded, do bar, else do baz. | |
120 | * ternary: `foo ? bar : baz` — if foo succeeded, do bar, else do baz. | |
121 | I don't think this is very necessary because you can usually just say | |
122 | `(foo & bar) | baz` — but only if `bar` always succeeds, which it | |
123 | usually does (to return something) | |
124 |