[REBOL] Re: On mutability and sameness
From: holger:rebol at: 20-Jun-2001 13:41
On Wed, Jun 20, 2001 at 02:59:13PM -0400, [Robbo1Mark--aol--com] wrote:
> You cannot yet completely implement ALL of REBOL in REBOL but with a C Compiler ( just
guessing! ) you CAN write a REBOL interpreter, and you can do it in JAVA, see FREEBELL,
so you CAN safely drop down to that level if need be. YOU did so to prove a point about
equality and sameness!
You are confusing some computer science concepts ("meta language", "bootstrapping" etc.).
A Turing Machine can implement any computer language in existance. Similarly, almost
every computer language in existance can implement a Turing Machine. It follows that
almost
every language can implement almost every other language. REBOL is powerful enough
to implement a Turing Machine (very easy, actually, with REBOL's powerful series operations),
so REBOL can be used to implement any language, including itself. Java is not inherently
more powerful than REBOL, as far as expressiveness of the language (and thus the ability
to
implement other languages) is concerned.
In order to be able to actually execute any code you, of course, need a method to get
down
to the assembly layer, but ideally this is only needed once, when you create your runtime
environment, for bootstrapping. It is not necessary afterwards. For instance, gcc is
written
completely in C. No assembly language needed, but in order to compile gcc you DO need
another
C compiler, in assembly language, that first compiles gcc, but only once, and it can
even
run on a different machine, even a different type of CPU, with cross-compilation.
Afterwards gcc can compile itself. That's what is meant by "bootstrapping".
Large portions of REBOL are actually written in REBOL, and REBOL is used extensively
in the
build process to create makefiles, manage components, products, licenses, run tests etc.
It would
theoretically be possible to implement REBOL completely in REBOL. (Of course, since REBOL
is
an interpreted language, at runtime you would still need another REBOL interpreter in
another
language which interprets the REBOL interpreter that is written in REBOL and interprets
your
scripts :-), but that is a different issue).
The point is that only with complete *behavioral* specs (which, admittedly, have not
been
published or even defined yet), without any information about the implementation, it
would
be possible to implement REBOL in whatever language you choose. It could even be REBOL.
The language you choose is irrelevant as long as it is powerful enough to implement a
Turing
Machine (or a GOTO-machine or any other abstraction that is computationally equivalent
to a
Turing Machine).
As for REBOL being its own meta language. That is mostly an issue of how syntax and semantics
are related by the language definition. REBOL being its own meta language basically means
that
you can make formal statements *about* REBOL *in* REBOL.
The concept of a language being its own meta language is very powerful, because you can
apply it recursively to get an infinite hierarchy of meta languages, all using the same
syntax (and thus effectively being a single language, but with different semantic
interpretations at different levels). REBOL allows you to express multiple semantic levels
in the same syntax, using the same language concepts, interpreted dynamically. The key
to this is the way words and blocks provide a unified method of expressing code and data.
--
Holger Kruse
[holger--rebol--com]