japalisp -lisp like language for numeric computation with natural japanese language-

10
Japalisp Lisp like language for numeric computation with natural Japanese Language

Upload: yuta-okazaki

Post on 28-Jul-2015

197 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

JapalispLisp like language for numeric computation with natural Japanese Language

Page 2: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

Japanese Programmer

I’m here

You’re here

A lot of people I know are here

Page 3: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

"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”

Page 4: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

1 階乗っていうのは、 2 数字を使って、 3 もしその数字が1だったら1を返して、 4 それ以外だったら 5 その数字と、その数字から1を引いた数で\ 階乗をした結果をかけたものを返すんだよ。

Recursive Factorial function(5 lines of code)

“Japanese Language 101 for programmers”

Page 5: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

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 invoking\ 階乗 with 数字 - 1

“Japanese Language 101 for programmers”

Page 6: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

1. Confusing Structure

1 階乗っていうのは、 2 数字を使って、 3 もしその数字が1だったら1を返して、 4 それ以外だったら 5 その数字と、その数字から1を引いた数で\ 階乗をした結果をかけたものを返すんだよ。

Define 階乗 Using 数字 (as arguments) If 数字 == 1 then return 1 Elseほ Multiply 数字 by the result of invoking\ 階乗 with 数字 - 1

Often, latter word conveys the meaning of that sentence.

“Japanese Language 101 for programmers”

Page 7: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

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”

Page 8: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

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!

Page 9: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

Demo

Page 10: Japalisp -Lisp like language for Numeric computation with natural Japanese language-

kenzan100.github.io/japalispPlease visit for playground