-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
為了有所憑依地說明編譯流程,貧道擬在本章定義一門法咒(咒、程式語言)——音界咒,在餘下章節,將實際操演如何將其轉換成真言。 | ||
|
||
此刻吾等修為尚淺,不宜一步登天,本章定義之法咒,乃音界咒的零.一版,該咒僅有簡單的變數定義能力,以及基本的數學運算。如此法咒顯非圖靈完備,沒法自舉,但不急,待零.二版、零.三版,會加入越發多的功能,終至能夠自舉。 | ||
|
||
## 音界咒設計 | ||
|
||
不同於塵界的咒語,多將組成字符限制在 ASCII,音界咒以全形標點符號以及漢字組成。過往也有[周蟒](https://zh.wikipedia.org/zh-tw/%E5%91%A8%E8%9F%92)、丙正正等透過重定義現有英語關鍵字來製成的漢語法咒,此類漢語法咒有個極大的問題:以 空白 分開 漢語詞 實在 太過 彆扭,讀 之 如 鯁 在 喉。 | ||
|
||
新興[文言](https://wy-lang.org/)咒運用長關鍵字與句號,完美地避免了空白,並與文言文的語義結合極佳,實為漢語法咒發展至今矗立的一座高峰。但文言咒為了完全符合文言文語義,不採用+-=等記號,亦不使用阿拉伯數字,加上長關鍵字,使得法咒冗長,阻擋了它被大規模應用。 | ||
|
||
除了長關鍵字,還有其他方法可以符合漢語慣例(不用空白),又能輕易分詞的嗎?以音界號分隔詞語早就行之有年,如《莊子.內篇.逍遙遊》、《文選.李密.陳情表》,又如本作《離塵指引.卷之一.試結丹》。在翻譯界,亦將原用空白隔開的外文人名以音界號隔開,如<ins>加布列.賈西亞.馬奎斯</ins>。 | ||
|
||
## 音界咒零.一版定義 | ||
|
||
### 變數宣告 | ||
|
||
當下所有變數皆為64位有號整數,之後會再擴展語法以支援更多型別。 | ||
|
||
```音界 | ||
元.甲=1024 #宣告甲為變數,其值為1024 | ||
元.乙=512 #宣告乙為變數,其值為512 | ||
``` | ||
|
||
註:漢語的「元」可代表未知數。如:「二元一次方程式」。今將其引申為變數使用。 | ||
|
||
### 數學運算 | ||
|
||
```音界 | ||
(1+3)*4/15-3 | ||
``` | ||
簡易四則運算,括號內先計算,先乘除後加減。 | ||
|
||
這些就是音界咒零.一版的所有功能了!但變數宣告與數學運算可以混合使用,如: | ||
|
||
```音界 | ||
元.甲=(1+3)*4/15 | ||
元.乙=甲-1 | ||
``` |