Scheme Based?
Posted: Mon May 04, 2009 1:51 pm
It's definitely been asked before, but I've read over SICP's "Designing Register Machines" and I went around and did some research. So far as I've found, there are three big projects I've found. I'm sure it's not all projects but I've found these to be the most relevant and understandable.
I learned Scheme by a friend who is a developer that works on Chicken Scheme. Chicken boasts many features, three of which are very important to this idea: One, it is capable of converting Scheme into C code of which the binaries have almost (no exact figure) native performance; two, it's also got a very nice FFI interface and is capable of being compiled along with other regular C code; and three, it represents the quintessential implementation of "continuation-passing style" for functional programming.
My idea here is simple: rework the Chicken Scheme compiler to make relatively free standing C code, using machine-dependent assembly for the core primitives for things like the processor-machine HAL, memory allocation, string and integral/floating-point operations, as Armpit does for the ARM Microprocessor. This way, I get the benefit of Scheme's functional programming paradigm compiled into native code for a given processor, without the problems associated with interpretation and loading of code from a medium.
What are your opinions on the idea?
- DreamOS is based on Dream Scheme, a scheme interpreter built in x86 assember. It's implementation I have to disagree with as it's not very efficient processor-wise, but then again, it's based on a CISC so I can't expect perfection.
- Armpit Scheme Interpreter is another Scheme interpreter but for ARM Microprocessors. It's extremely small and as far as I can tell, fairly fast as well. I have not tested it as they provide no binaries and I don't have an ARM processor to test on nor feel like setting up a crosscompiler when I can read the assembly just fine.
- Movitz is an on-the-metal Lisp (not Scheme, exactly) interpreter for the x86. It provides some ability to manipulate the x86, but it's not perfect either.
I learned Scheme by a friend who is a developer that works on Chicken Scheme. Chicken boasts many features, three of which are very important to this idea: One, it is capable of converting Scheme into C code of which the binaries have almost (no exact figure) native performance; two, it's also got a very nice FFI interface and is capable of being compiled along with other regular C code; and three, it represents the quintessential implementation of "continuation-passing style" for functional programming.
My idea here is simple: rework the Chicken Scheme compiler to make relatively free standing C code, using machine-dependent assembly for the core primitives for things like the processor-machine HAL, memory allocation, string and integral/floating-point operations, as Armpit does for the ARM Microprocessor. This way, I get the benefit of Scheme's functional programming paradigm compiled into native code for a given processor, without the problems associated with interpretation and loading of code from a medium.
What are your opinions on the idea?