雅典娜(計算機程式語言)

基本介紹

  • 中文名:小雅典娜程式語言
  • 外文名:Junior Athena Programming
  • 性質:腳本語言
  • 用途:滿足計算方面動態編程需要
  • 主要特點:邏輯清晰、簡單易學,無需編譯,解釋器小
小雅典娜程式語言(Junior Athena Programming)是浙大學生王晨男創造的一種圖靈完備語言(Turing-Complete Programming Language),同時她也是一種腳本語言,現在可在專門的解釋器下運行,其C語言接口正在研製中。
這門程式語言主要是為了滿足計算方面動態編程的需要,主要特點是邏輯清晰、簡單易學,無需編譯,解釋器小(最新版本64KB),代碼寫在記事本中即可直接運行,比如用她寫的Hello World程式:
so 'Hello World';
(so 功能關鍵字string output)
從1加到100並輸出等式的程式:
[0] = 0 + 99;[1] = 0 + 1;[2] = 0 + 1;no [1];d;o '+';[1] = [1] + 1;no [1];[2] = [2] + [1];[0] = [0] - 1;< [0];o '=';no [2];
部分語法體系:
//Operands:
//
//value : value
//'char' : char
//[pos] : unit[pos]
//[[pos]] : unit[unit[pos]]
//
//Instructions:
//
//a = b op c; : a = b op c
//
//i mem; : input a char
//o mem/char; : output a char
//ni mem; : input a number
//no mem/value; : output a number
//si mem; : input a string
//so mem/string; : output a string
//
//> a; : if a > 0 go to the next dest
//< a; : if a > 0 go to the previous dest
//
//d;
//

相關詞條

熱門詞條

聯絡我們