Var'aq
|
var'aq is a programming language based loosely upon the grammatical structure of the Klingon language. It was created as part of a speculative exercise in imagining what the computer culture of the fictional Klingon race might be like, and was created by Brian Connors and Chris Pressey c. 2000.
The language is a stack-based language based loosely on PostScript, with aspects of the Lisp language added for handling data structures.
The following keywords are currently supported:
Control Structures
- ifyes/HIja'chugh
- ifno/ghobe'chugh
- choose/wIv
- ~ (quote/lI'moH)
- name/pong
- set/cher
- repeat/vangqa'
- eval/chov
Stack Operations
- pop/woD
- dup/latlh
- exch/tam
- clear/chImmoH
- remember/qaw
- forget/qawHa'
Arithmetic Operators
- add/boq
- sub/boqHa'
- mul/boq'egh
- div/boqHa'egh
- mod/chuv
- pow/law'qa'moH
- rand/mIS
- add1/wa'boq
- sub1/wa'boqHa'
- pi/HeHmI'
- e/ghurmi'
- clip/poD
- smooth/Hab
- howmuch/'ar
Trig/Log operators
- sin/joq
- cos/joqHa'
- tan/qojmI'
- atan/qojHa'
- ln/ghurtaH
Relational Operators
- All relational operators have been implemented. Thanks to j proctor for null?/pagh'a', negative?/taH'a', int?/HabmIa', and number/mIa'.
I/O Operators
- The var'aq I/O model remains to be defined, but the basic console I/O functions are now present.
List Operators
- All list operators are now available
String Operators
- strtie/tlheghrar
- streq?/tlheghrap'a'
- strcut/tlhleghpe'
- strmeasure/tlheghjuv
- compose/naQmoH
tlhIngan Hol has names for the numbers and there are also pIqaD (the Klingon writing system) versions of those numbers:
||pagh|| wa'|| cha'|| wej|| loS|| vagh|| jav|| Soch|| chogh|| Hut|| wa'maH|| ||0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 ||
Sample Program
Name: hello, world Dialect: English Version: 5 June 2000 Comments: Not the canonical var'aq "hello, world"; actually prints "What do you want, universe?" in Klingon ~ nuqneH { ~ 'u' ~ nuqneH disp disp } name nuqneH
External links
- Documentation and a var'aq interpreter (http://www.geocities.com/connorbd/varaq/)
- Writing Klingon Characters (http://www.kli.org/tlh/pIqaD.html)