Extensive update of TODO file.
Chris Pressey
5 years ago
0 | 0 | TODO |
1 | 1 | ==== |
2 | 2 | |
3 | (some of these are possibly long-term plans) | |
3 | (Note, some of these are possibly long-term plans.) | |
4 | ||
5 | Opaque type | |
6 | ----------- | |
7 | ||
8 | Values of "opaque" type. Intrinsics `wrap` and `unwrap`. But note | |
9 | that only the functions implementing the ADT are guaranteed to be able | |
10 | to unwrap an opaque value, and those functions might be implemented | |
11 | natively, rather than as Robin code that uses `wrap` and `unwrap`. | |
12 | ||
13 | Then, can we provide environments as an abstract type? We would | |
14 | also provide `env->alist` and `alist->env` so they can be worked | |
15 | with easily. But they could be used natively to support symbol | |
16 | lookup, and if they are implemented as trees or hash tables, this | |
17 | might have performance benefits. (Or perhaps not.) | |
18 | ||
19 | Opaque type might also be useful for internals, e.g. signaling | |
20 | to runtime system that an error occurred. | |
21 | ||
22 | Stdlib | |
23 | ------ | |
24 | ||
25 | `(bound? sym)` returns `#t` if the symbol is bound, `#f` if not. | |
26 | ||
27 | `(compose f1 f2)` composes two functions. | |
28 | ||
29 | `macro?` should return `#t` on intrinsics, because they are | |
30 | intrinsic macros. Maybe a separate `intrinsic?` predicate. | |
31 | ||
32 | Other libs | |
33 | ---------- | |
34 | ||
35 | `schemeish` lib, that just gives you all the old jargon-y names | |
36 | as aliases. | |
37 | ||
38 | Static analysis lib. This is its own bucket of worms. It should | |
39 | expose a macro that can be wrapped around an arbitrary standard | |
40 | Robin program _p_ and, if static analysis of _p_ is successful, | |
41 | simply evaluates to whatever _p_ evaluates to. And if not | |
42 | successful, raises an error. Should probably start small -- | |
43 | statically check the arity of every application, for instance. | |
44 | Note that this relies on the assumption that all standard symbols | |
45 | have their standard meanings. | |
46 | ||
47 | Toplevels | |
48 | --------- | |
49 | ||
50 | `(require foo)` is conceptually sugar for `(assert (bound? foo))` | |
51 | but doesn't need `bound?` to be defined, and is also declarative, | |
52 | so an implementation can read it and perhaps try to find `foo` | |
53 | and load it. | |
54 | ||
55 | The intrinsics defining files need not be entirely empty; they | |
56 | should `(requires thesym)` because, being an intrinsic, it should | |
57 | be implemented, and available, and if it's not, it should fail. | |
58 | ||
59 | Tests | |
60 | ----- | |
61 | ||
62 | "Execute", not "Interpret", a Robin program (as these tests could also | |
63 | be used to test compilers.) | |
4 | 64 | |
5 | 65 | A way to evaluate a Robin expression and display it, mainly |
6 | 66 | to make the tests more concise - don't need to say `(display ...)` always. |
7 | 67 | |
8 | Environments as abstract maps, alist->env, env->alist | |
68 | Reactors | |
69 | -------- | |
9 | 70 | |
10 | Values of "opaque" type, to support that. | |
71 | Perhaps namespace each event name. | |
11 | 72 | |
12 | Rename `fun` to `function`. | |
73 | A more involved environment, with more facilities than just | |
74 | `line-terminal`. Multiplexed I/O would be a start, could write an | |
75 | IRC client. Could also define an environment for web pages. | |
13 | 76 | |
14 | Rename `raise` to `throw`. | |
77 | Subscription and unsubscription from facilities using standard commands. | |
78 | ||
79 | Example programs | |
80 | ---------------- | |
81 | ||
82 | Hunt the Wumpus. | |
83 | ||
84 | Implementation of a concatenative language in an idiomatic style, | |
85 | taking a list like `(1 2 + 3 *)` and folding `compose` over it to | |
86 | obtain a function, and applying that function. | |
87 | ||
88 | Rename | |
89 | ------ | |
90 | ||
91 | Rename `fun` to `function`. This is because Robin prefers full words | |
92 | over abbreviations, which are jargon-y. | |
93 | ||
94 | Rename `raise` to `throw`. This is because `throw` is the opposite | |
95 | of `catch`. Also "raise" suggests an error, but it might be merely a | |
96 | non-local exit. |