Var'aq

From Academic Kids

Template:Title

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

Personal tools
Navigation

    Information

    • Home Page (http://academickids.com/encyclopedia/index.php)
    • New Articles (http://www.academickids.com/encyclopedia/index.php/Special:Newpages)
    • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)


    Academic Kids Menu

    • Art and Cultures (http://www.academickids.com/encyclopedia/index.php/Art_and_Cultures)
      • Art (http://www.academickids.com/encyclopedia/index.php/Art)
      • Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
      • Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
      • Music (http://www.academickids.com/encyclopedia/index.php/Music)
      • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
    • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
    • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
    • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
      • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
      • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
      • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
      • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
    • History (http://www.academickids.com/encyclopedia/index.php/History)
      • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
      • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
      • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
      • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
      • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
      • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
      • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
      • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
      • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
    • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
    • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
    • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
    • Science (http://www.academickids.com/encyclopedia/index.php/Science)
      • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
      • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
      • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
      • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
      • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
      • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
      • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
      • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
    • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
      • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
      • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
      • Government (http://www.academickids.com/encyclopedia/index.php/Government)
      • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
      • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
    • Space and Astronomy (http://www.academickids.com/encyclopedia/index.php/Space_and_Astronomy)
      • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
      • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
    • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
    • US States (http://www.academickids.com/encyclopedia/index.php/US_States)
          Advertisement