-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTODO
67 lines (64 loc) · 3.37 KB
/
TODO
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
55
56
57
58
59
60
61
62
63
64
65
66
67
I have lots of ideas for this. Here are some.
Baseline functionality
- (load) function preferably compatible with the REPL
DONE Implement printing s-expressions instead of Python data.
- Integer division (rationals) using quote notation
DONE Integer-coded character data.
PARTIAL Compare magnitude of integers:
DONE for balanced-ternary integers
- TODO for binary integers
Application programming
DONE Implement computation of fibonacci numbers. This is easily in reach.
- Do some timing of fibonacci. Compare with a few mature languages that have
various degrees of support for this kind of thing.
DONE Implement computation of factorials.
- How fast are factorials? How big an input
can this language, its library, and its interpreter support?
What's the limiting factor? Do you hit Python's recursion stack limit?
Do you run out of patience?
Advances
- Explicit call stack in the interpreter.
- Enable tail calls to reuse existing stack frames.
PARTIAL Rewrite the interpreter in something other than Python:
PARTIAL JavaScript
- TODO Java, CLISP, CINT <http://root.cern.ch/drupal/content/cint>,
bash, Perl.
- Implement a metacircular evaluator like Paul Graham's jmc.lisp
in "The Roots of Lisp".
- Automatically translate programs (including the evaluator) into
data and code for other languages, such as Python and C.
If you don't mind using the host language's facilities such as garbage
collection, this might be just about as easy as it was to
built the interpreter. And it pretty much counts as compilation.
- Add efficient division and rational arithmetic using Hehner-Horspool
quote notation (as is covered in Wikipedia).
- Analyze the running time of the language interpreter's operations.
Can you do running-time analysis of Lisp programs from source code?
- Build profiling into the interpreter (or later, the compiler)
for any lambdas named in the environment, in order to identify
functions that have a need for speed.
- Use this Lisp language to implement a SECD machine. Then port the
interpreter to the SECD machine. Or look up the G-machine.
- Implement the "One Reference Only" scheme to obviate any need
for garbage collection. PicoLisp does this, I think. And ACL2
adopted one researcher's plan for this, called "Linear Logic",
for which the articles and metacircular evaluator in Lisp
are on the web.
- Learn about ACL2 and see what other ideas you can use from that effort.
- Move toward Scheme. Or Lisp in Small Pieces. Or not.
- Use this language to implement the Calculus of Constructions as in
the paper "Mathematical Libraries as Proof Assistant Environments".
Then model and prove the correctness of the interpreter.
- Once the correctness of the interpreter has some guarantees such
as formal proofs, automated tests, or both, make aggressive
optimizations that preserve the correctness.
- Implement accurate trig functions, perhaps via CORDIC and/or
"Gal's accurate tables" as are covered in Wikipedia.
- Implement IEEE 754 doubles as explained by David Goldberg in Appendix D of
the Sun Numerical Computation Guide.
- Implement an incremental compiler for statements. This technique is
used to speed up the REPL.
- Compile to gcc's GENERIC middle-end language. Then get the benefit
of its libffi foreign function interface. With that, interfacing to
POSIX and lots of other things will become tractable.
- Add bindings for wxWidgets.