新しい並行計算ライブラリ js-csp のご紹介
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

新しい並行計算ライブラリ js-csp のご紹介

  • 276 views
Uploaded on

on 東京node学園祭 2014

on 東京node学園祭 2014

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this

Views

Total Views
276
On Slideshare
175
From Embeds
101
Number of Embeds
2

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 101

https://twitter.com 99
http://nodejs.connpass.com 2

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. 新しい並行計算ライブラリ js-cspのご紹介 niryuu<niryuu@gmail.com> Georepublic Japan LLC. 自己紹介:最近は専らクライアントサイドで 地理空間から3Dの実世界まで 素材:いらすとや
  • 2. 非同期プログラミングを つないでいく問題 • 悪名高いコールバック地獄 • Promise, Generatorベースのものもそこ そこ育ってきた • が,次は:検証の問題 • 並行計算を追う困難
  • 3. コールバック関数 yield Promise EventEmitter 世
  • 4. 非同期処理の検証の問題 • 新しい書き方は出てきたが,ちゃんと 動いているかの検証はどんどん難しく なっている • console.log, throw • コールバック地獄はある意味わかりや すい!山を登れば山頂がある
  • 5. 山は厳しい
  • 6. 非同期処理の検証の問題 • 新しい書き方は出てきたが,検証はどんどん難しくなっている • console.log, throw • コールバック地獄はある意味わかりやすい!山を登れば山頂が ある • 通常の手続き型の枠内で記述している • Promise もある意味システム化している • co などもできるだけ手続きっぽく書ける • →本来非同期に向いた計算モデルが必要
  • 7. そこでCSP • Communicating Sequential Processes • Wikipedia:「プロセス代数またはプロセス計算と呼ばれる並 行性に関する数学的理論の一種である」 • 要はλ計算の並行計算版 • よりわかりにくいわ! • 並行計算=データの流れのデザイン • golang, clojure で一気に大流行した • ubolonton氏によるjs-csp
  • 8. js-csp • golang の人が解説すれば一瞬でわかる ので,いいブログ記事のサンプルソース をガンガン見せます • chan を見ればわかる明快さ • Reactive Programming との親和性
  • 9. 参考文献 • js-csp • https://github.com/ubolonton/js-csp • Taming the Asynchronous Beast with CSP Channels in JavaScript • http://jlongster.com/Taming-the- Asynchronous-Beast-with-CSP-in-JavaScript