[racket] Fundamentals

From: Noel Welsh (noelwelsh at gmail.com)
Date: Thu Oct 14 05:44:00 EDT 2010

On Thu, Oct 14, 2010 at 4:15 AM, Mathew Kurian <bluejamesbond at gmail.com> wrote:
> As long as the processor can only read only numbers (binary), Racket cannot be interpreted by the machine before being translated into another language such as Assembly. Assembly is then translated to numbers or binary/machine code If that is the case, Racket has to be an interpreted language since it is layered on Assembly. Or I may just be completely wrong in my perception of that part.

Machine code is the binary representation of commands that the machine
understands. Assembly is a textual representation of the same
commands, usually with a one-to-one mapping to machine code. Often
people use the term assembly to mean either the binary or textual
representation depending on context. The distinction is a bit
arbitrary, as with a one-to-one mapping you can convert from one to
the other with no loss of information.

In a sense all languages are interpreted, as the CPU interprets the
machine code. (Though as John pointed out often the machine code is
compiled into some inaccessible internal representation.) In the sense
you're asking, Racket compiles into machine code at run-time.

If you want to play around with creating and running your own machine
code from Racket, my assembler project at Github shows how it can be
done:

  http://github.com/noelwelsh/assembler

HTH,
N.


Posted on the users mailing list.