A simple SSA-based compiler written in Dylan 
Author Message
 A simple SSA-based compiler written in Dylan

During the winter 2000 quarter, I took an advanced compiler
construction class taught by my graduate advisor Michael Franz.  The
term project required us to write a compiler for a simple
Pascal-subset called p2k.  The compiler had to parse the source
language and generate an SSA (Static Single Assigment) intermediate
form on which it would perform common subexpression elimination and
register allocation.

Everyone has probably turned in their assignment by now, so I'm making
mine, written in XML-based literate Dylan code, available on my
"Projects" web page, http://www.*-*-*.com/ (near
the bottom of the page).

Note that I had to censor part of the program, at least until after
February 18, 2003, because it infringes on US patent number
4,571,678 assigned to the IBM corporation.  I hate patents.

It's been compiled with both d2c and Functional Developer (at some
point).

Literate programs need literary critics, and any input would be
appreciated.




Tue, 04 Mar 2003 03:00:00 GMT  
 A simple SSA-based compiler written in Dylan
Dear Peter,

I read your project and liked it very much.  A couple of things:  you
have FIXMEs in some places ... did you?  Did you implement p2k
procedures?

It would be helpful for me to see the problem statement as well as the
p2k bnf or language definition.  Would you post that information?

Sincerely,
Douglas M. Auclair

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 11 Mar 2003 03:00:00 GMT  
 A simple SSA-based compiler written in Dylan

Quote:
> Dear Peter,

(Don't know if this was intended to go to the list; I'll reply to the list
anyway.)

Quote:
> I read your project and liked it very much.  A couple of things:  you
> have FIXMEs in some places ... did you?  Did you implement p2k
> procedures?

Procedures weren't a required part of the project.  At the beginning of the
quarter I had ambitions to implement them anyway but I had two other classes
(and a full-time job), plus the register allocator took awhile to debug.

The other FIXMEs involved the use of limited types (not fully supported by
d2c), minor deviations from the specified grammar (where I made the same
simplifications as the provided sample parser), and the drawing of "nifty
diagrams" in MetaPost (which I never got around to learning until the
following quarter).

Quote:
> It would be helpful for me to see the problem statement as well as the
> p2k bnf or language definition.  Would you post that information?

The BNF is actually included in the XML markup, but I haven't written the
XSLT to transform it into XSL-FO for printing.

The problem statement (and BNF) can be found at
http://www.ics.uci.edu/~franz/211/ProjectPhase1.pdf (for the language
definition) and http://www.ics.uci.edu/~franz/211/ProjectPhase2%263.pdf (for
the specifics of the CSE and register assignment portions of the
assignment).

Cheers,



Tue, 11 Mar 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PC-Based Software Specification Tool (SSA) - Available Free

2. PC-Based Software Specification Tool - SSA

3. PC-Based Software Specification Tool - SSA

4. SSA A New Software Specification Tool - PC-Based

5. writing a simple language compiler

6. A modest proposal (Dyllo: a Scheme-based subset of Dylan)

7. A modest proposal (Dyllo: a Scheme-based subset of Dylan)

8. Pathetic newbie cant grasp simple concept like dylan-user

9. Simple Reader Macros for Dylan

10. Simple Reader Macros for Dylan

11. Dylan vs. C results for simple benchmark

12. Copy-on-write in Dylan?

 

 
Powered by phpBB® Forum Software