nand-lang
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples initial import Apr 18, 2018
.gitignore
LICENSE Create LICENSE Apr 18, 2018
README.md Update README.md Apr 18, 2018
info.rkt
main.rkt initial import Apr 18, 2018
nand lang.png
nand-parser.rkt initial import Apr 18, 2018
nand-runtime.rkt
nand-transform.rkt initial import Apr 18, 2018

README.md

README

What is this

This is a quick and rough implementation of Jellonator's Nandlang as a racket #lang using the racket-peg library!

It's done in 3 parts:

  • The parser processes the nand language input files, producing a lispy abstract syntax tree.
  • The transformer translates the abstract syntax tree into regular racket code, implementing the semantics of the language by embedding it in another language.
  • The runtime provides functions for the translated output to make use of during execution.

The same approach could be used to implement any other language.

Installation

Make sure you have the latest version of racket-peg installed.

raco pkg remove nand-lang
raco pkg install -u -t dir nand-lang

Example

alt text