Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
factor #RC
Search
Livesense Inc.
PRO
August 08, 2012
Technology
77
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
factor #RC
Livesense Inc.
PRO
August 08, 2012
More Decks by Livesense Inc.
See All by Livesense Inc.
味覇で作るパスタが美味い - 20261001_yabaubuki.dev
livesense
PRO
0
130
Rubyはただの⾔語に⾮ず
livesense
PRO
0
580
28新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
130
27新卒_総合職採用_会社説明資料
livesense
PRO
0
7.5k
27新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
13k
株式会社リブセンス・転職会議 採用候補者様向け資料
livesense
PRO
0
600
株式会社リブセンス 会社説明資料(報道関係者様向け)
livesense
PRO
1
1.8k
データ基盤の負債解消のためのリプレイス
livesense
PRO
0
730
26新卒_総合職採用_会社説明資料
livesense
PRO
0
13k
Other Decks in Technology
See All in Technology
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
100
会社説明資料
persolserverworks
0
9.8k
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
940
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
1
150
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
4
1.1k
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
AI駆動開発の時代になったのでトヨタ生産方式から見直す
terurou
7
6k
その Valkey 使いこなしていますか?
onk
PRO
5
1.5k
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
6
4.6k
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
340
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
570
Featured
See All Featured
Between Models and Reality
mayunak
4
500
How to Ace a Technical Interview
jacobian
280
24k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
30 Presentation Tips
portentint
PRO
1
430
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Transcript
Takuya Shiotari
Factorとは • Slava Pestovが設計と実装 • 連鎖性言語 • 強い動的型付けのスタック指向 • Joy、Forth、LISP、Selfに影響を受けた
• 優れたパフォーマンス • 充実したライブラリ
連鎖性言語と適用型言語 • 引数を関数に適用することに よって評価が行われる • C、Ruby、PHP、Javascript、 Haskell、Java • 1つのデータのかたまりを操作 する関数を複数作成し、この
データのかたまりが関数から関 数へと渡されることで評価が行 われる • 関数の合成は、複数のプログラ ムを連鎖させることによって記 述する • Forth、Joy、PostScript、Cat、 Factor 適用型 連鎖性
• スタック型言語と連鎖性言語は厳密には同じで はないが、ほとんど同じ(おそらく、連鎖性言語 の実装がスタック型言語) • 再帰関数用のコールスタックの他に関数間で値 をやり取りするためのデータスタックを持ってい る • スタック型言語のプログラマが指す「スタック」は
データスタックのこと スタック型言語
Factorのパーサー • ホワイトスペースでトークンに分解される • 大文字・小文字は区別される 2X+ 2 X + 2
x +
基本構文 プログラムはワードとリテラルから構成される ワード 名前付き関数 クォーテーション 無名関数 コンビネータ 高階関数 ボキャブラリー モジュール
10 sq 5 - ! 10 5 はリテラル、sq -はワー ド
ワード定義 : sq ( x -- ) dup * ;
① ② ③ ④ ⑤ ① 必ず「:」から始まる ② 新しいワードの名前 ③ スタック効果宣言(これが引数みたいなもん) ④ ワードの定義 ⑤ 「;」で終了
制御フロー クォーテーションとは評価可能なコードを含むオブジェクトのこと 2 2 + ! 4がスタックに積まれる [ 2 2
+ ] ! クォーテーションがスタックに積まれる : sign-test ( n -- ) dup 0 < [ drop "negative" ] [ zero? [ "zero" ] [ "positive" ] if ] if print ; 制御フローにクォーテーションが使われる
Factorの特徴 var customer = ...; var price = customer.orders[0].price; orders>>
first price>>
Factorの特徴 var customer = ...; var orders = (customer ==
null ? null : customer.orders); var order = (orders == null ? null : orders[0]); var price = (order == null ? null : price); dup [ orders>> ] when dup [ first ] when dup [ price>> ] when
Factorの特徴 MACRO: maybe ( quots -- ) [ '[ dup
_ when ] ] map [ ] join ; { [ orders>> ] [ first ] [ price>> ] } maybe
次回のテーマ