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

 

<< PreviousWord BrowserNext >>
carol ii of romania
greenhouse gas
ion antonescu
jrn utzon
hohenzollern sigmaringen
ferdinand i of romania
cephalic index
wall street (manhattan)
denise richards
rubidium strontium dating
galago
peg solitaire
klondike (solitaire)
edna ferber
brain tumor
batch processing
scooby doo
saint casimir
spectrum of a ring
list of unitarian universalists
universal life church
criminal procedure
media (disambiguation)
malayalam language
stevie case (killcreek)
martin heidegger
political prisoner
federal standard 1037c
bruce lee
cypherpunk
computer aided design
scientific journal
sand
african development bank
the martian chronicles
aeneid
suetonius
marcus junius brutus
calpurnia
59 bc
circus maximus
aldehyde
willard gibbs
drought