[Cuis] [SOLVED] Re: Copy vs Clone
Ken.Dickey
Ken.Dickey at whidbey.com
Sun May 17 09:22:58 CDT 2015
On Sat, 16 May 2015 18:01:23 -0300
Juan Vuletich <juan at jvuletich.org> wrote:
> > Closures and Objects are in a sense duals. One can implement Scheme in Smalltalk or Smalltalk in Scheme. I did an implementation of R5RS Scheme in Squeak which passed the test suite. So call me linguistically promiscuous.
> Thanks. This made me read a bit about this duality. It was enlightening.
>
> Wow! is that Scheme available somewhere? Please port it to Cuis!
Juan, you may be the only person in the world interested in this -- especially after I explain the details.
I had intended to compile to bytecodes, but the Squeak compiler was in its perennial state of flux, so I did a translator.
I wrote a very small kernel for Scheme runtime support in Smalltalk, wrote a file based translator from Scheme->SqueakSmalltalk in Scheme. This included a full R5RS Scheme reader in Scheme.
Using a Scheme system, I ran the Scheme translator code to translated the translator into Smalltalk. The resulting translator, running in Smalltalk, then could translate itself.
I used the translated translator to translate the R5RS test suite into Smalltalk. The entire test suite passed except for two small edge cases. Note that the passing tests included Call/CC.
If you are seriously interested in the above, it is a good time ad I am moving to a smaller house and giving or throwing away most of my old computing texts, papers, proceedings, computers, and back-up disks. I will need to grovel through a pile of backups to find the code.
The Scheme->Smalltalk translator generated Squeak .st code files, which probably need some tweaks for Cuis, but I could probably get things working again with a small bit of work.
Not being integrated into the tool chain makes the translator a bit of an academic exercise. If someone were to look at Pharo's RIng model and newer compiler -- the compiler is always in a state of flux -- it might be a starting point for bytecode generaton and toolset integration. But I fear that Scheme is another dying language these days. Not sure there would be enough interest to be worthwhile.
Anyway, let me know if I should hunt for the code.
--
-KenD
More information about the Cuis
mailing list