- Esoteric Language
- Making via "Rubyで作る奇妙なプログラム言語"
- But...Create of Ruby...
- Typhoon came to Okinawa in Japan after so long.
- "@" seems like Typoon clouds.
- Typhon is based on WhiteSpace (such as stack model language)
aaa@aa@aaa
@ aaaaa@@a@aa@
@ aa
Hi
ruby bin/typhon examples/hi.ty
※ _is Space
Typhon | Middle language | explain |
---|---|---|
aa#{NUM} | pushNUM | add to stack |
a_a | dup | dup top of stack value |
a@a#{NUM} | copyNUM | copy stack value |
a_@ | swap | swap stack value |
a__ | discard | drop top of stack value |
a@_#{NUM} | slide | drop stack value top to NUM |
@aaa | add | calcurate add |
@aa@ | sub | calcurate sub |
@aa_ | mulcalucurate multi | |
@a@a | div | calucurate div |
@a@@ | mod | calucurate mod |
@@__ | heap_write | write to heap |
@@@_ | heap_read | read from heap |
aa#{LABEL} | labelLABEL | set to label |
a@#{LABEL} | callLABEL | call Subroutine |
a_#{LABEL} | jumpLABEL | jump to label |
@a#{LABEL} | jump_zeroLABEL | jump to label when top of stacks value is zero |
@@#{LABEL} | jump_negativeLABEL | jump to label when top of stacks value is negative |
@_ | return | return to Subroutine |
___ | exit | exit program |
@_aa | char_out | output char to standard I/O |
@_a@ | num_out | output number to standard I/O |
@_@_ | char_in | input char from standard I/O |
@_@@ | num_in | input number from standard I/O |
e.g aa@a@ -> +0101 -> 5
@@a@a -> -1010 -> -10