the infamous hello world program
TRANSCRIPT
![Page 1: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/1.jpg)
The Infamous Hello World Program.
@okashoi
![Page 2: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/2.jpg)
美しいコードを書くこと
プログラマにとっての夢
![Page 3: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/3.jpg)
そんな皆さんに
今日ご紹介するのは
![Page 4: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/4.jpg)
The Shakespeare
Programming Language (SPL)
![Page 5: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/5.jpg)
例えば Hello World
![Page 6: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/6.jpg)
※公式サイト より一部抜粋
![Page 7: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/7.jpg)
美しい。
![Page 8: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/8.jpg)
今宵、
美しき Shakespeare の世界
に あなたをご招待します。
![Page 9: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/9.jpg)
SPL の綴り方 I. Title
![Page 10: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/10.jpg)
最初に出現するピリオドまでが
Title になる
![Page 11: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/11.jpg)
これ。
![Page 12: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/12.jpg)
Title は美学的な役割のみを果たす。
(パーサから見たらコメントに過ぎない)
The title serves only aesthetic purposes. From the
parser's point of view, it's a comment.
(公式サイトより抜粋)
![Page 13: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/13.jpg)
改行・空白の挿入は自由。
ただしインデントは趣き深く行うことが
公式で推奨されている。
You're generally free to insert space and newlines
wherever you want in the code, but we urge you to
please indent tastefully.(公式サイトより抜粋)
![Page 14: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/14.jpg)
SPL の綴り方 II. Dramatis Personae
![Page 15: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/15.jpg)
ここ。
![Page 16: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/16.jpg)
「登場人物名 , 特徴」の形で記述してゆく。
(特徴はパーサによって無視される)
登場人物とはつまり変数であり、
すべて signed int 型として扱われる。
![Page 17: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/17.jpg)
登場人物名は実際の Shakespeare 作品に
登場する人物名でなければならない。
![Page 18: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/18.jpg)
SPL の綴り方 III. Constants
![Page 19: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/19.jpg)
あらゆる名詞が 1 又は -1 の値を持つ。
どちらを取るかは、その名詞が
良いものかどうかによって決まる。
例) “flower” は良いものだから 1
“pig” は汚いから -1
(※中性のもの “tree” などは 1)
![Page 20: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/20.jpg)
名詞に形容詞が付くと 2 が掛けられる。
複数付けばその分だけ掛けられる。
“sum of X and Y” などの基本的な計算を使って
任意の整数を容易に作り出せる。
![Page 21: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/21.jpg)
例)“the difference between the square of the
difference between my little pony and your big
hairy hound and the cube of your sorry little
codpiece”
![Page 22: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/22.jpg)
my little pony = 2
your big hairy hound = 4
your sorry little codpiece = -4
![Page 23: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/23.jpg)
“the difference between the square of the difference
between 2 and 4 and the cube of -4”
つまり
(2 - 4)2 - (-4)3 = 4 - (-64) = 60
![Page 24: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/24.jpg)
“the difference between the square of the difference
between my little pony and your big hairy hound and
the cube of your sorry little codpiece” は 60 と等し
い。
![Page 25: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/25.jpg)
このようにして、他のプログラミング言語にない
詩的な自由を与えてくれる言語、それが SPL 。
As you see, this way of writing constants gives you
much more poetic freedom than in other
programming languages.(公式サイトより抜粋)
![Page 26: The Infamous Hello World Program](https://reader033.vdocuments.mx/reader033/viewer/2022042722/589bc77e1a28ab082b8b6577/html5/thumbnails/26.jpg)
公式サイト
http://shakespearelang.sourceforge.net/
和訳参考
http://kara.ifdef.jp/program/spl/spl01.html
是非、あなたも SPL の世界へ。