From: Jonathan S. Shapiro <shap@er...> - 2008-01-21 22:46:04
While I was working on TinyScheme, I came to the conclusion that the
TinyScheme machine is larger than it needs to be. The issue is not so
much that I feel any need to shrink the machine. The issue is that (1)
there are some fairly complex mechanisms embedded in the current
interpreter, (2) they are not well documented there and are difficult to
debug, and (3) there are a range of extensions one might desire (e.g.
bignums) that really don't want to go in that core.
Because of this, I think that TinyScheme should perhaps consider
adopting the idea of a "preamble" from other languages. By doing so, it
would be possible to have a "core" scheme subset that is directly
implemented by the interpreter, and to augment that subset with Scheme
code before "user" code is run.
As a weakly motivated but illustrative example, we could then move CADR
and friends to the preamble.
As a more serious motivation, consider an implementation in which there
is a new environment *BUILTIN* containing all of the operations known to
the primitive interpreter. For example, "+" is bound in this environment
to the built-in PLUS implementation.
Now imagine further that we introduce a new, non-standard primitive
object type BIGNUM, which is simply a vector with a different tag, and
in the *BUILTIN* environment we implement the associated type checking
operator (which would not be bound in the R5RS environment).
Given this, it becomes possible to write a bignum arithmetic in the
I don't know if this idea is worth exploring further. I simply thought
that I might throw it out there to see if it resonated.
The other major thought I had was to rearrange the type tags to allow
the character representation to encompass UNICODE code points. It
requires rearrangement of the current tagging system, but it wouldn't be
that hard to do.
Not pushing for anything here -- just dumping my thoughts.
Get latest updates about Open Source Projects, Conferences and News.