Home

Awesome

#yasa

yasa is Yet Another Scripting Attrocity. Its main feature is that it takes the stangeness of assembly language, and combines it with the slowness of an interpreted language. Its the worst of both worlds, but I like it all the same.

This package contains:

More information about each of these submodules can be found in their respective directories.

###Language Guide yasa was designed for simplicity of parsing. As such, it consists of only a few different grammars:

In general, the language looks something like:

# Comment
cmd $a 43 $  # More Comment
end

All variables and literals are integers, which may be converted to/from ASCII characters for IO purposes.

In addition to the 27 $var's, the runtime also has access to an array of integers, initailized to 0, that may be accesed at random, or with stack operations.

####Commands: All commands are broken down into these 4 categories. The included yasa.cson file provides syntax highlighting as documented.

As a general rule, the modified variable in a given command will be the last in the argument list.

#####State Change (purple):

CommandNameArgumentsDescription
Copycpy$a $bassigns $b the value of $a
Pushpus$apushes $a onto global array
Poppop$aassigns $a value popped from global array
Putput$a $iassigns $a to global array index $i
Getget$a $iassigns value at global array index $i to $a
Addadd$a $b $rassigns $r the value $a + $b

#####Math (blue):

CommandNameArgumentsDescription
Incrementinc$aassigns value $a + 1 to $a
Decrementdec$aassigns vlaue $a -1 to $a
Addadd$a $b $rassigns $r the value $a + $b
Subtractsub$a $b $rassigns $r the value $a - $b
Multiplymul$a $b $rassigns $r the value $a * $b
Dividediv$a $b $rassigns $r the value $a / $b
Modulomod$a $b $rassigns $r the value $a % $b
Randomran$n $aassigns $a random value between 0 and $n
Equaleql$a $b $rgives $r 1 if $a = $b, else $0
Greatergrt$a $b $rgives $r 1 if $a > $b, else $0

#####Control Flow (teal):

CommandNameArgumentsDescription
Labellbl$acreates a mark for future/past mov's. must be positive
Movemov$a [$b]go to label $a, searching from beginning onward, noop if $b is 0
Ififf$acontinue if $a is not 0, else jump to next elif or end
Else Ifeif$acontinue if $a is not 0, else jump to next elif or end
Elseelsnonecontinue so long as previous iff's evaluated false
Endendnoneend iff block or program

#####Input/Output (green):

CommandNameArgumentsDescription
Integer Iniin$aassigns $a integer read from stdin
Charachter Incin$aassigns $a char read from stdin
Showsho$aoutputs $a as an integer
Displaydis$aoutputs $a as an ASCII char