Re: Making SRFI go faster
Adam Nelson 25 Apr 2021 21:34 UTC
On 4/25/21 5:07 PM, Marc Feeley wrote:
>> On Apr 25, 2021, at 7:34 AM, Amirouche Boubekki <xxxxxx@gmail.com> wrote:
>>
>> As far as I know there is no Scheme implementation that can run on a
>> trivial subset of Scheme (that is maximally portable across Scheme
>> implementations and Operating Systems), and that is easy to debug
>> (breakpoints, step debugger, variable inspection, one step macro
>> expansion).
> You mean a Scheme implementation that is hosted on top of Scheme? This could be added to Gambit’s universal backend that currently targets multiple dynamic languages (JavaScript, Python, PHP, Ruby, …). Adding Scheme as a backend should be easy! It wouldn’t even require the host Scheme system to support proper tail calls and first class continuations… Imagine running Scheme threads on any Scheme system!
>
> Anyone interested in doing this is welcome to contact me...
>
> Marc
This was also part of my goal with Tangled Scheme. After the
interpreter, the first compile target I had in mind was portable R5RS
(multiple R7RS libraries go in, a single R5RS file comes out). And
Gambit was the first Scheme I had in mind to compile this with. :)
The "trivial subset of Scheme" described here doesn't really exist for
R7RS, though. Scheme implementations are so varied, and so buggy, that
almost nothing can be taken for granted. Although I think it gets better
once you get down to the level of older specs like R5RS.
It would be an interesting project to split R7RS-small into "stages" and
describe them via implementing each stage in the last one. For example:
assume R7RS doesn't have `read`, `eval`, `string->number`, or anything
else that knows anything about Scheme syntax or evaluation semantics.
How do you then implement these in terms of the other operations? This
would be a true reference implementation of R7RS, and a useful tool for
testing and specifications.