Lisp



Lisp

0 14


building-lisp

This project has moved:

On Github bodil / building-lisp

Building Your Own

Lisp

For Great Justice

@bodil

Make your own Lisp

A rite of passage.

But Why?

Because you can

BODOL

pure

immutable

homoiconic

typed

makes HN caremad

BODOL

(ƒ fac
  0 → 1
  n → (* n (fac (- n 1))))

BODOL

(ƒ map
  f () → ()
  f (head . tail) →
    (cons (f head)
          (map f tail)))

How do I made lisp?

Pick your language

as long as it's Clojure.

Parsers gonna parse

Instaparse

by Mark Engelberg

parsers for the people

just EBNF

or parser combinators

Primitive Types

strings, numbers, booleans

symbols

cons cells

Elementary Functions

cons, car, cdr

cond, eq, atom

lambda, label, quote

Evaluation

primitive types evaluate to...

themselves

symbols evaluate to...

their bound values

functions evaluate to...

their results

eval()

program, environment in

result, environment out

State Monads

gonna moan

Lexical Scoping

A function's outer scope is the code around it, not where it's invoked from.

Pattern Matching

run* that shit

This is your lisp on pattern matching

cons, car, cdr

cond, eq, atom

lambda, label, quote

Type System

shout if you like Robin Milner

The hardest problem in computer science:

Naming

Naming

steal some person's name

not somebody still alive

use a CS concept

take popular lang, add "Script"

take letter, increment

pick your favourite pony

Whatever you do, just don't name it after yourself.

GO FORTH

the world needs moar toy lisps

Thank you!

@bodil

github.com/bodil/building-lisp

github.com/bodil/BODOL