A Toy Programming Language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Thorn Avery b051358207 Add 'LICENSE' преди 4 години
LICENSE Add 'LICENSE' преди 4 години
README.md unfuarked readme formatting преди 4 години
expander.rkt first commit преди 4 години
main.rkt first commit преди 4 години
parser.rkt first commit преди 4 години
reader.rkt first commit преди 4 години
tmUtils.rkt first commit преди 4 години

README.md

turingAutomaton

a toy programming language for creating turing machines

description

turingAutomaton is a programming language created to test the Racket ecosystem. it features custom syntax and is able to run single tape turing machines.

installation

git clone https://git.lain.church/tA/turingAutomaton
cd turingAutomaton
raco pkg install

syntax

all files must begin with a

#lang turingAutomaton

followed by a definition of;

@ beginningState
% blankSymbol
! acceptingState

(currently the accepting state is unimplemented)

states are defined using the following syntax;

: stateName
currentSymbol ~ newSymbol > newState
currentSymbol ~ newSymbol < newState

where < and > denote moving the tape left and right, respectively

comments are allowed:

; either on their own line
@ first ; or at the end of a line

sample program

this machine will double a number passed to it

#lang turingAutomaton

; this is a comment!

@ first
% e
! F

: first
a ~ b > second
c ~ c > fourth

: second
a ~ a > second
c ~ c > second
e ~ c < third

: third
a ~ a < third
b ~ b > first
c ~ c < third

: fourth
c ~ c > fourth
e ~ e < fifth

: fifth
b ~ a < fifth
c ~ a < fifth
e ~ e > F

caveats

currently very unfinished.

all input is a single tape defined with aaaaa for now.

there is no error checking until I learn how to do that.

might get slow for very large tapes as the tape uses linked lists to operate.

thanks

mutce ckire to:

  • the racket team for creating an awesome language
  • Matthew Butterick for his book Beautiful Racket and the libraries within

author

fi'e la ti'ei