A working example of a #lang language you can use as a starting point for creating your own #lang language.
- Set your PATH environment variable
so you can use
racoand other Racket command line functions. - either look for
from-templatein the DrRacket menu File|Package Manager, or run theracocommand:
raco pkg install from-templateraco new lang <destination-dir>If you omit <destination-dir>, the command will add copy the template to a folder called lang in the current folder.
You can also click Use this template to copy the repository.
This is working example that you can change to suit your needs.
See https://github.com/racket/racket/wiki/Creating-Languages for resources on creating languages.
This template is derived from https://github.com/samth/xlang :
A language of combinators and numeric constants, implemented in Racket.
Examples:
#lang xlang
(S K I X)
#lang xlang
(K 1 2)
To Install: `raco pkg install xlang`
To learn about combinators: http://en.wikipedia.org/wiki/Combinatory_logic