Skip to content

A Racket-based implementation of PCF as described in Robert Harper's Practical Foundations for Programming Languages.

Notifications You must be signed in to change notification settings

hzafar/pcf-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PCF Interpreter

                                        /\
                                       /..\
                                      /....\
                                     /------\
                                    /\@@@@@@/\
                                   /..\@@@@/..\
                                  /....\@@/....\
                                 /--------------\
                                /\@@@@@@@@@@@@@@/\
                               /..\@@@@@@@@@@@@/..\
                              /....\@@@@@@@@@@/....\
                             /------\@@@@@@@@/------\
                            /\@@@@@@/\@@@@@@/\@@@@@@/\
                           /..\@@@@/..\@@@@/..\@@@@/..\
                          /....\@@/....\@@/....\@@/....\
                         /\~~~~/oo\~~~~/oo\~~~~/oo\~~~~/\
                        /..\~~/oooo\~~/oooo\~~/oooo\~~/..\
                       /....\/oooooo\/oooooo\/oooooo\/....\
                      /------\------/oooooooo\------/------\
                     /\@@@@@@/\~~~~/oooooooooo\~~~~/\@@@@@@/\
                    /..\@@@@/..\~~/oooooooooooo\~~/..\@@@@/..\
                   /....\@@/....\/oooooooooooooo\/....\@@/....\
                  /--------------\--------------/--------------\
                 /\@@@@@@@@@@@@@@/\~~~~/oo\~~~~/\@@@@@@@@@@@@@@/\
                /..\@@@@@@@@@@@@/..\~~/oooo\~~/..\@@@@@@@@@@@@/..\
               /....\@@@@@@@@@@/....\/oooooo\/....\@@@@@@@@@@/....\
              /------\@@@@@@@@/------\------/------\@@@@@@@@/------\
             /\@@@@@@/\@@@@@@/\@@@@@@/\~~~~/\@@@@@@/\@@@@@@/\@@@@@@/\
            /..\@@@@/..\@@@@/..\@@@@/..\~~/..\@@@@/..\@@@@/..\@@@@/..\
           /....\@@/....\@@/....\@@/....\/....\@@/....\@@/....\@@/....\
          --------------------------------------------------------------

This repository contains two implementations of PCF as described in Robert Harper's Practical Foundations for Programming Languages. The first one parses approximately the grammar given in the book to a quoted list representation which is then converted to higher-order abstract syntax. The second generates a HOAS representation directly using macros. Both versions can be evaluated using the dynamics defined in pcf-dynamics.rkt.

See the tests for usage examples.

About

A Racket-based implementation of PCF as described in Robert Harper's Practical Foundations for Programming Languages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages