On this page:
Make your own meta-circular evaluator!
7.2

Make your own meta-circular evaluator!

Jonas Winje (@JonasWinje)
and Heidi Mork (@heidicmork)

    1 Meta-circular what?

      1.1 Programming languages and evaluators

      1.2 amb and logic programming

      1.3 Outline

      1.4 Goals for the workshop

    2 Some Racket

      2.1 Maybe use DrRacket

      2.2 (function argument ...)

      2.3 (something-else other-stuff ...)

      2.4 A very subsetty subset of Racket btw

    3 Fixing the calculator

      3.1 Working with a file in DrRacket

      3.2 The calculator-code

        3.2.1 define

      3.3 Pairs, lists

        3.3.1 Quoting

        3.3.2 evaluate, repl and Racket’s read function

        3.3.3 match

        3.3.4 apply

      3.4 Making the test pass

      3.5 Done?

    4 Lookup in the environment

      4.1 Some tests

      4.2 An environment

      4.3 primitives

      4.4 lookup

      4.5 Environment as input to eval-exp

        4.5.1 Looking up

        4.5.2 eval-application

      4.6 Done?

    5 Definitions

      5.1 Some tests

      5.2 define in Racket

      5.3 extend-environment

      5.4 eval-sequence and define

      5.5 begin

      5.6 Done?

    6 Functions

      6.1 Some tests

      6.2 Make a function

      6.3 New match clauses in eval-exp

      6.4 Done?

    7 Continuation-passing style

      7.1 Not CPS

      7.2 CPS

    8 Refactoring to CPS

      8.1 Some stuff will have a continue-parameter

        8.1.1 (eval-exp env continue exp)

        8.1.2 (eval-sequence env continue exps)

        8.1.3 (eval-application env continue fun args)

        8.1.4 Our “primitives”

        8.1.5 (make-function env parameters body)

        8.1.6 (evaluate input)

      8.2 So that did nothing

      8.3 Couple of tips, maybe

      8.4 Done?

    9 Booleans

      9.1 Some tests

      9.2 Literals

      9.3 if

      9.4 Some functions

      9.5 Maybe: and, or, ...

      9.6 Done?

    10 Ambiguousness

      10.1 Some tests

      10.2 Some stuff will have a fail-parameter

      10.3 require

      10.4 amb

      10.5 Btw let’s add a list-function to our primitives

      10.6 evaluate*

      10.7 Done?

    11 It’s puzzle time

      11.1 Find the missing number

      11.2 Find the digits

      11.3 Sudoku

      11.4 Done?

    12 Towards zebras

      12.1 What, if anything, is a zebra?

      12.2 Adding stuff to our language

        12.2.1 More list/pair functions

        12.2.2 Quotes

        12.2.3 Strings

        12.2.4 equal?

        12.2.5 Recursive functions

      12.3 Writing a zebra-program

        12.3.1 Some lists

        12.3.2 Some helper functions

        12.3.3 The requirements

        12.3.4 Return a list with all the lists

      12.4 Running the zebra-program

      12.5 Done?