Squeak: tools for generating machine code

Paul Fernhout pdfernhout at kurtz-fernhout.com
Sat Jan 2 19:32:46 UTC 1999


=== FORWARDED MESSAGE from Norman Ramsey <nr at cs.virginia.edu> ====

 > Perhaps Squeak
 > might be able to leverage this work for native code generation (and
to
 > make Squeak independent of C).
 > 
 > http://www.cs.virginia.edu/~nr/toolkit/
 > "The New Jersey Machine-Code Toolkit...
 > This work is in ML, but why not Squeak?

I would be happy to work with some Smalltalk programmers to arrange
for the Toolkit to be able to emit Smalltalk.  A complete
re-implementation of the Toolkit in Smalltalk or Squeak is not really
necessary, and it may not represent the best possible use of
programmers' time...

 > I'm not sure what the licensing terms are for these works.

Free for any purpose.

Norman Ramsey

===================== END FORWARDED MESSAGE ==================

Squeakers -

Norman Ramsey <nr at cs.virginia.edu> asked me to forward the above
message to the list for him (since he's not on it). 

Some more background:
The The New Jersey Machine-Code Toolkit he and Mary Fernández developed
is a very large effort and consists of code, data, and several hundred
of pages of documentation. It includes specifications for MIPS, SPARC,
Alpha, PPC, and Pentium processors. There are extensive tools with
source to take those specifications to generate code (right now in C and
Modula-3) for machine language interpreters, disassemblers, and more.
The toolkit is written in a combination of Icon and Standard ML. 

I've spent the morning looking through this work and there is a lot
there. Rather than rewrite the tool that takes the specifications and
generates code from them in Squeak, Norman proposes adding support to
the toolkit to generate Smalltalk, which could then be used directly in
various Squeak tools.

They write in their manual (Page 2):
> The toolkit currently has rudimentary support for multiple languages. > For decoding applications, this support actually works; 
> we use it both for C and for Modula-3. The support for encoding
> applications is only partly in place; there are lots of little C-isms
> lurking around the declarations of encoding procedures and the 
> results of typed constructors, and there is only one version of
> the toolkit's library, which is written in C. 
> We would be pleased to try to support users interested in other
> languages. We would probably ask such users to develop the library 
> support, since that is a fairly straightforward and separable task. 
> We would tackle the details of making the generator 
> truly support multiple languages.

I probably won't have much time in the near future to help with this
(being tied up right now with Embedded Squeak), but perhaps someone else
on the list does? 

To start small, it could be a great learning experience (maybe for one
of Mark Guzdial's CS students?) to help Norman modify the toolkit to
create a CPU simulator in Smalltalk like the one described here:
http://www.cs.virginia.edu/~nr/toolkit/examples/xs/xs.html
as well as Squeak GUI tools for assembly / dissassembly for it.

Another fun application of the toolkit once that worked would be giving
Squeak a disassembler as a "telescope" for looking at the computing
world around it (as well as a "microscope" for examining its own VM
code). From there it might be a short(?) step to having Squeak assemble
(and run) its own machine code for those platforms. 

-Paul Fernhout
Kurtz-Fernhout Software 
=========================================================
Developers of custom software and educational simulations
Creators of the GPL Garden with Insight(TM) garden simulator
http://www.kurtz-fernhout.com/squeak





More information about the Squeak-dev mailing list