begin  quoting [EMAIL PROTECTED] as of Tue, Jan 22, 2008 at 12:48:15PM -0800:
> As I learn Scheme I can't help thinking that it is more "fundamental"
> than other languages....that Scheme is what other languages would
> look like if we stripped out all the fluff and syntactic sugar.

When you compile a language, the first thing you do is build a parse
tree.  Lispy languages basically skip that step and go straight to the
parse tree directly.

What often happens next is that stack-based intermediate code is then
generated. (It's been a long time since I've immersed myself to this
level, so I'll wave my hands a bit here.) This corresponds to Forthy
languages.

> This idea would be verified if someone could tell me that many other people
> have *implemented* other languages in Scheme/Lisp.

Probably. Can't see why not.

I've implemented an RPN language in Smalltalk. 

> Yet, I'm afraid that most (all?) languages are implemented in C or assembly.

Not all.

And even when you start out in C/asm/Fortran, on of the early goals is
to make your language self-hosting; that is, your compiler is written in
the language. HOW you bootstrap to that point is pretty much irrelevent.

> Hence, C/assembly/register based machines will always be seen as the most
> "fundamental" or lower level.

Well, yes. Hello Von Neumann, right?

You can have non-register-based (or non-load-and-store) machines, but
given the disparity in performance between on-chip memory (registers
and cache) and off-chip memory (RAM), those approaches are mostly dead.

> I don't know much about the "Lisp machines" of way back.  I assume they were
> just trying to optimize a typical register based CPU for Lisp.  See? so even
> *Lisp machines* are implemented on top of register based machines/assembly.

The Forth chips apparantly use a stack, rather than dedicated registers.

But it really all comes down to telling the computer "Hey, you, do this.
Then this. Then this." until you're satisfied or something goes wrong.

> What would really interest me is if someone invented a CPU whose hardware
> wasn't based on registers and C compilers but somehow built from the ground up
> to be a Lisp/functional processor.

Remember, you have to be able to build such a thing out of gates and
wires, in the Real World.  If you don't want to have to do that, then
you get to emulate the Ideal Computer in software that runs on hardware
that is built out of gates and wires.

Of course, you could solve mathematical equations directly with an analog
computer. . . look, ma, no registers!

-- 
Stored programs get a bit tricky
Especially when the wires get sticky.
Stewart Stremler

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to