Japalisp is a Lisp like language for numeric computation with natural Japanese language.
It is designed to sound as natural as a spoken Japanese language while providing basic recursive computation, so that non-Japanese programmer and non-programmer Japanese will be able to learn something new.
3. "thinking about computing is one of the most
exciting things the human mind can do
(Little Schemer)“
For non-programmer Japanese (my friends)
For non-Japanese programmer (you)
“Japanese Language 101 for programmers”
4. 1 階乗っていうのは、
2 数字を使って、
3 もしその数字が1だったら1を返して、
4 それ以外だったら
5 その数字と、その数字から1を引いた数で
階乗をした結果をかけたものを返すんだよ。
Recursive Factorial function(5 lines of code)
“Japanese Language 101 for programmers”
5. 1 階乗っていうのは、
2 数字を使って、
3 もしその数字が1だったら1を返して、
4 それ以外だったら
5 その数字と、その数字から1を引いた数で
階乗をした結果をかけたものを返すんだよ。
Recursive Factorial function(5 lines of code)
Define 階乗
Using 数字 (as arguments)
If 数字 == 1 then return 1
Elseほ
Multiply 数字 by the result of i
階乗 with 数字 - 1
“Japanese Language 101 for programmers”
6. 1. Confusing Structure
1 階乗っていうのは、
2 数字を使って、
3 もしその数字が1だったら1を返して、
4 それ以外だったら
5 その数字と、その数字から1を引いた数で
階乗をした結果をかけたものを返すんだよ。
Define 階乗
Using 数字 (as argument
If 数字 == 1 then return 1
Elseほ
Multiply 数字 by the resul
階乗 with 数字 - 1
Often, latter word conveys the meaning of that sentence.
“Japanese Language 101 for programmers”
7. 2. Complicated Delimiter
5 Multiply 数字 by the result of invoking
階乗 with 数字 - 1
We heavily depend on Particle(suffixes) to separate words
as well as to indicate the meaning of the sentence.
5 その数字と、その数字から1を引いた数で
階乗をした結果をかけたものを返すんだよ。
“Japanese Language 101 for programmers”
8. AがB
AとB
AでCをする
AとBでCをする
(AをCとする)
3. yet Surprisingly simple tokenizer
A == Bは
A and Bは
Invoke C with Aは
Invoke C with A and Bは
(Let C be A)
“Japanese Language 101 for programmers”
So far, my tokenizer is about 100 lines of code!