22
Real World Common Lisp Lisp ををを

Real world lisp

  • Upload
    tamamu

  • View
    252

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Real world lisp

Real World Common LispLispを書け

Page 2: Real world lisp

Speaker: Hidetoshi ITO

@cddadr

Page 3: Real world lisp

Lispって何だ

Page 4: Real world lisp
Page 5: Real world lisp

Common Lispは史上初の実用的なオブジェクト指向プログラミング言語※諸説あり

Page 6: Real world lisp

Googleが中心に開発しているGo言語は Common Lispのオブジェクト指向モデルと似ている

※データとメソッドを分離するスタイル

Page 7: Real world lisp

最適化すれば C言語よりも速く動くプログラムを書ける※Node.jsで使われてる http-parserの 6.4倍速い HTTPパーサー

http://blog.8arrow.org/entry/2014/10/23/063044

Page 8: Real world lisp

マクロによるゼロオーバーヘッド抽象化・メタプログラミング※構文抽象化を繰り返すことで速度を保ちつつ可読性を向上させる

Page 9: Real world lisp

マクロによる抽象化の例(dotimes (idx 5) (format t “~A回目 ~%” idx))

macroexpand ->(let ((idx 0)) (tagbody loop-tag (if (>= idx 5) nil (progn (declare (type unsigned-byte idx)) (format t “~A回目 ~%” idx) (1+ idx) (go loop-tag)))))

macroexpand-1 ->(do ((idx 0 (1+ idx))) ((>= idx 5) nil) (declare (type unsigned-byte idx)) (format t “~A回目 ~%” idx))

実行結果12345

Page 10: Real world lisp

REPLで超高速プロトタイピング※エディタと協調して働く REPLでリアルタイムプログラミング

Page 11: Real world lisp

ベンチマーク・プロファイリング・最適化の黄金サイクル※ベンチマークマクロと処理系のプロファイリングツールを活用

Page 12: Real world lisp

強力で扱いやすいデバッガ※スタックトレースも落ちたその場で見れる

Page 13: Real world lisp

Web開発用途での不便は無いむしろ速いし書きやすい※今年、朝日新聞傘下となったサムライト株式会社は CLでWeb開発

Page 14: Real world lisp

機械学習向けのライブラリCL-CUDAでGPGPUも出来る

※MNISTのベンチでは Chainerと Tensorflow以上の速度http://d.hatena.ne.jp/masatoi/20160523/1463993398

Time

Page 15: Real world lisp

Lisp唯一の欠点

Page 16: Real world lisp

スマホ対応がいまいち※moclというスマホアプリ開発環境が提供されているが有料

Page 17: Real world lisp

まとめ

Page 18: Real world lisp

Common Lispは現代の開発水準にも劣らない

Page 19: Real world lisp

ライブラリ数はやや少ないが特に不便は感じない※Common Lispライブラリのドキュメント集約サイト

http://quickdocs.org/

Page 20: Real world lisp

Lispで開発されている主なもの• Emacs

• 某ソフトウェア情報学部で使われてる• Mezzano

• 100%Common Lispで書かれた OS

• Yahoo! ストア• 現行のものは C++と Perlで書き直されている

• Maxima• 代数的数式処理エキスパートシステム

• Grammarly• 高精度英文校正サービス (スタートアップ )

• Karen• Webブラウザエンジン (開発中 )

Page 21: Real world lisp

Realize your idea with Lisp!

Page 22: Real world lisp

Start herehttp://lisp-lang.org/

My bloghttp://progn.hateblo.jp/