370
Perl 6 Today Pugs - An implementation of Perl 6 Perl 6 - Reconciling the Irreconcilable Au!ey Tang 1

Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

  • Upload
    others

  • View
    2

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl 6 TodayPugs - An implementation of Perl 6

Perl 6 - Reconciling the Irreconcilable

Au!ey Tang1

Page 2: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

PugsAn implementation of

Perl6鳳たん

2

Page 3: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugs自分を信じ、好きを貫け

Perl6の実装

訳: 竹迫良範 / 小飼弾

(Perl5の粗探ししてる暇があったら自分で何かやれ)

3

Page 4: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

≝4

Page 5: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugsとは...(定義)

5

Page 6: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugsとは...(定義)

≝ Perl6コンパイラ

5

Page 7: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugsとは...(定義)

≝ Perl6コンパイラ

≝ Perl6ランタイム

5

Page 8: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugsとは...(定義)

≝ Perl6コンパイラ

≝ Perl6ランタイム

≝ Perl6テストスイート

5

Page 9: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6

Page 10: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

7

Page 11: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

8

Page 12: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

9

Page 13: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

✓10

Page 14: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl6のコード

11

Page 15: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl6のコード

✓ 130以上のモジュール

11

Page 16: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl6のコード

✓ 130以上のモジュール

✓ 160以上の実例

11

Page 17: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl6のコード

✓ 130以上のモジュール

✓ 160以上の実例

✓ 20,000を超えるテスト

11

Page 18: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“公式な”Perl6

12

Page 19: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“公式な”Perl6

✓ 過去のしがらみを捨てて、セマンティックで再定義

12

Page 20: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“公式な”Perl6

✓ 過去のしがらみを捨てて、セマンティックで再定義

✓ テストスイートとの互換性(JavaTest/TCK参照)

12

Page 21: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

仕様⇔テスト

✓http://spec.pugscode.org/

13

Page 22: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

仕様⇔テスト

✓http://spec.pugscode.org/

13

Page 23: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

仕様⇔テスト

✓http://spec.pugscode.org/

13

Page 24: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

テスト⇔仕様

✓http://smoke.pugscode.org/

14

Page 25: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

⇚15

Page 26: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

1995年代のPerl

16

Page 27: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use5.000;

1995年代のPerl

16

Page 28: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use5.000;• require'fastcwd.pl';

1995年代のPerl

16

Page 29: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use5.000;• require'fastcwd.pl';• require'newgetopt.pl';

1995年代のPerl

16

Page 30: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use5.000;• require'fastcwd.pl';• require'newgetopt.pl';• require'exceptions.pl';

1995年代のPerl

16

Page 31: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2005年代のPerl

17

Page 32: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use v6-alpha;

2005年代のPerl

17

Page 33: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use v6-alpha;• use perl5:DBI;

2005年代のPerl

17

Page 34: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use v6-alpha;• use perl5:DBI;• use perl5:Encode <encode decode>;

2005年代のPerl

17

Page 35: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use v6-alpha;• use perl5:DBI;• use perl5:Encode <encode decode>;• use perl5:Template;

2005年代のPerl

17

Page 36: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use v6-alpha;• use perl5:DBI;• use perl5:Encode <encode decode>;• use perl5:Template;•

# Implementation of "crypt"sub crypt ($text, $salt) {

2005年代のPerl

17

Page 37: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• use v6-alpha;• use perl5:DBI;• use perl5:Encode <encode decode>;• use perl5:Template;•

# Implementation of "crypt"sub crypt ($text, $salt) {

• eval 'crypt($text, $salt)' :lang<perl5>;}

2005年代のPerl

17

Page 38: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハイブリッド式実行エンジン

Pugs

Pugs::RuntimePugs::CompilerPugs::Grammar

Pugs.EvalPugs.Prim

Pugs.Types

Perl 5

Runtime

GHC

Runtime

18

Page 39: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハイブリッド式実行エンジン

⇚ Perl5Pugs

Pugs::RuntimePugs::CompilerPugs::Grammar

Pugs.EvalPugs.Prim

Pugs.Types

Perl 5

Runtime

GHC

Runtime

18

Page 40: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハイブリッド式実行エンジン

⇚ Perl5

⇚ Haskell

Pugs

Pugs::RuntimePugs::CompilerPugs::Grammar

Pugs.EvalPugs.Prim

Pugs.Types

Perl 5

Runtime

GHC

Runtime

18

Page 41: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハイブリッド式実行エンジン

⇚ Perl5

⇚ Haskell

⇚ C(.so/.dll)

Pugs

Pugs::RuntimePugs::CompilerPugs::Grammar

Pugs.EvalPugs.Prim

Pugs.Types

Perl 5

Runtime

GHC

Runtime

18

Page 42: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

⇛19

Page 43: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

PILPugs中間言語

20

Page 44: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

コンパイルの流れ

21

Page 45: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

コンパイルの流れpugs/src/perl6/Perl‐6.0.0‐STD.pm

21

Page 46: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugs

JavaScript

Haskell Perl 5

バックエンド

22

Page 47: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugs

JavaScript

Haskell Perl 5

YARV?JVM?

CLR? PyPy?

バックエンド

23

Page 48: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl5バックエンド

Augmentation (XS)PadWalker, Devel::Caller

autobox, re::override ...

SemanticsData::Bind, Class::MOP

Pugs::Runtime, Pugs::Compiler::Rule ...

Perl 5 SugarMoose, Moose::Autobox ...

Syntaxv6.pm

Pugs::Compiler::Perl6 ...

Core

perl

Tool SupportCPAN, PAUSE

Perldoc, Perl::Tidy ...

!"#$%&

'()&*+,&-"#%

.&*%!/01!2.34!1"#56

InfrastructureParse::Yapp

Module::Compile ...

24

Page 49: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl5バックエンド

⇛ P5VMの増強

Augmentation (XS)PadWalker, Devel::Caller

autobox, re::override ...

SemanticsData::Bind, Class::MOP

Pugs::Runtime, Pugs::Compiler::Rule ...

Perl 5 SugarMoose, Moose::Autobox ...

Syntaxv6.pm

Pugs::Compiler::Perl6 ...

Core

perl

Tool SupportCPAN, PAUSE

Perldoc, Perl::Tidy ...

!"#$%&

'()&*+,&-"#%

.&*%!/01!2.34!1"#56

InfrastructureParse::Yapp

Module::Compile ...

24

Page 50: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl5バックエンド

⇛ P5VMの増強

⇛ Perl6をPerl5に配置Augmentation (XS)PadWalker, Devel::Caller

autobox, re::override ...

SemanticsData::Bind, Class::MOP

Pugs::Runtime, Pugs::Compiler::Rule ...

Perl 5 SugarMoose, Moose::Autobox ...

Syntaxv6.pm

Pugs::Compiler::Perl6 ...

Core

perl

Tool SupportCPAN, PAUSE

Perldoc, Perl::Tidy ...

!"#$%&

'()&*+,&-"#%

.&*%!/01!2.34!1"#56

InfrastructureParse::Yapp

Module::Compile ...

24

Page 51: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl5バックエンド

⇛ P5VMの増強

⇛ Perl6をPerl5に配置

⇛ Moose.pmはCPANにAugmentation (XS)PadWalker, Devel::Caller

autobox, re::override ...

SemanticsData::Bind, Class::MOP

Pugs::Runtime, Pugs::Compiler::Rule ...

Perl 5 SugarMoose, Moose::Autobox ...

Syntaxv6.pm

Pugs::Compiler::Perl6 ...

Core

perl

Tool SupportCPAN, PAUSE

Perldoc, Perl::Tidy ...

!"#$%&

'()&*+,&-"#%

.&*%!/01!2.34!1"#56

InfrastructureParse::Yapp

Module::Compile ...

24

Page 52: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl5バックエンド

⇛ P5VMの増強

⇛ Perl6をPerl5に配置

⇛ Moose.pmはCPANにAugmentation (XS)PadWalker, Devel::Caller

autobox, re::override ...

SemanticsData::Bind, Class::MOP

Pugs::Runtime, Pugs::Compiler::Rule ...

Perl 5 SugarMoose, Moose::Autobox ...

Syntaxv6.pm

Pugs::Compiler::Perl6 ...

Core

perl

Tool SupportCPAN, PAUSE

Perldoc, Perl::Tidy ...

!"#$%&

'()&*+,&-"#%

.&*%!/01!2.34!1"#56

InfrastructureParse::Yapp

Module::Compile ...

24

Page 53: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

JavaScriptバックエンド

25

Page 54: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

JavaScriptバックエンド

⇛ GWT,Hop,Linksとか...

25

Page 55: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

JavaScriptバックエンド

⇛ GWT,Hop,Linksとか...

⇛ 90%のテストを通過

25

Page 56: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

JavaScriptバックエンド

⇛ GWT,Hop,Linksとか...

⇛ 90%のテストを通過

⇛遅い‐JS2/Tamarin狙い

25

Page 57: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

䷗26

Page 58: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6.0最初のリリース

27

Page 59: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6.2関数

28

Page 60: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6.28オブジェクト

29

Page 61: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6.283文法

30

Page 62: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6.2831型

31

Page 63: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6.28318マクロ

32

Page 64: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

6.283185自分自身を実装

33

Page 65: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl 6!☯

34

Page 66: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

≠35

Page 67: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“ふざけたおもちゃのインタプリタ”(スラドの住人曰く)

36

Page 68: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“ふざけたおもちゃのインタプリタ”

37

Page 69: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“ふざけたおもちゃのインタプリタ”

38

Page 70: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“おもちゃのインタプリタ”

39

Page 71: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“おもちゃのインタプリタ”

40

Page 72: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“おもちゃ”

41

Page 73: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

-Ofun42

Page 74: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☺43

Page 75: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

矢印の長さ

時間

15800以上のコミット

300以上のコミッター

44

Page 76: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

テスト駆動

45

Page 77: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

テスト駆動

☺バグ報告➟テスト

45

Page 78: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

テスト駆動

☺バグ報告➟テスト

☺スモークサーバ(smokeserv.pl)

45

Page 79: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

テスト駆動

☺バグ報告➟テスト

☺スモークサーバ(smokeserv.pl)

☺:todo<unspecced>

45

Page 80: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ウィキ的な開発スタイル

46

Page 81: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ウィキ的な開発スタイル

☺10以上の言語

46

Page 82: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ウィキ的な開発スタイル

☺10以上の言語

☺30超のサブプロジェクト

46

Page 83: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ウィキ的な開発スタイル

☺10以上の言語

☺30超のサブプロジェクト

☺積極的な求人活動

46

Page 84: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

パッチ大歓迎!

47

Page 85: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

パッチ大歓迎!

47

Page 86: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

コミット大歓迎!

48

Page 87: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

✆49

Page 88: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

irc.freenode.net#perl6

50

Page 89: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

λ駱駝(ラムラクダ)達

51

Page 90: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

λ駱駝(ラムラクダ)達

✆ 200人以上の仲間たち

51

Page 91: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

λ駱駝(ラムラクダ)達

✆ 200人以上の仲間たち✆ IRC中毒/常駐者20人超

51

Page 92: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

λ駱駝(ラムラクダ)達

✆ 200人以上の仲間たち✆ IRC中毒/常駐者20人超✆ TimToady++(ラリー)

51

Page 93: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

svnbot6(ボット)

52

Page 94: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

specbot6(ボット)

53

Page 95: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

evalbot6(ボット)

54

Page 96: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

devbot6(ボット)

55

Page 97: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

lambdabot(λボット)

56

Page 98: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

IRC.pugscode.org

57

Page 99: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Run.pugscode.org

58

Page 100: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Dev.pugscode.org

59

Page 101: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Invite.pugscode.org

60

Page 102: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Smoke.pugscode.org

61

Page 103: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Spec.pugscode.org

62

Page 104: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Blog.pugscode.org

63

Page 105: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

メーリングリスト

64

Page 106: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

メーリングリスト

✆ perl6‐users

64

Page 107: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

メーリングリスト

✆ perl6‐users

✆ perl6‐language

64

Page 108: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

メーリングリスト

✆ perl6‐users

✆ perl6‐language

✆ perl6‐compiler

64

Page 109: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ソースコードリポジトリ

65

Page 110: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

http://svn.pugscode.org/pugs/

ソースコードリポジトリ

65

Page 111: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

http://svn.pugscode.org/pugs/

http://darcs.pugscode.org/pugs/

ソースコードリポジトリ

65

Page 112: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

http://svn.pugscode.org/pugs/

http://darcs.pugscode.org/pugs/

SVK

ソースコードリポジトリ

65

Page 113: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♨66

Page 114: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

私は放浪の数学者エルデシュのように

67

Page 115: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

私は放浪の数学者エルデシュのように

♨ 2006..*

67

Page 116: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン

68

Page 117: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

68

Page 118: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

68

Page 119: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

68

Page 120: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

68

Page 121: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

68

Page 122: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

68

Page 123: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

68

Page 124: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

68

Page 125: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

68

Page 126: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

68

Page 127: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

♨ シカゴ

68

Page 128: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

♨ シカゴ

♨ ボストン

68

Page 129: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

♨ シカゴ

♨ ボストン

♨ ポートランド

68

Page 130: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

♨ シカゴ

♨ ボストン

♨ ポートランド

♨ サンパウロ

68

Page 131: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

♨ シカゴ

♨ ボストン

♨ ポートランド

♨ サンパウロ

♨ 東京再び

68

Page 132: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

♨ シカゴ

♨ ボストン

♨ ポートランド

♨ サンパウロ

♨ 東京再び

♨ マウンテンビュー!

68

Page 133: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ハッカソン♨ 台北

♨ ウィーン

♨ トロント

♨ アムステルダム

♨ エクト

♨ リスモア

♨ Mt.アベル

♨ ウィーン再び

♨ 東京

♨ レドモンドTM

♨ シカゴ

♨ ボストン

♨ ポートランド

♨ サンパウロ

♨ 東京再び

♨ マウンテンビュー!

68

Page 134: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl6 Reconciling theIrreconcilable

鳳たん69

Page 135: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl6 または、私はいかにして

耐え難きを耐え

結び難きを結んだか

訳: 竹迫良範 / 小飼弾

70

Page 136: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ℙ71

Page 137: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Practical実践編

72

Page 138: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Unixの世界 (1987)

ShellC

73

Page 139: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

新しい次元が誕生

C

Shell

74

Page 140: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Manipulexity (複殺)

C がまだ良かった頃...

C

Shell

75

Page 141: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Manipulexity (複殺)

Shell がまだ良かった頃...

C

Shell

Whipuptitude (殺速)

76

Page 142: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

!"#$

Manipulexity (複殺)

Perl が誕生!

C

Shell

Whipuptitude (殺速)

77

Page 143: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

!"#$%!

Manipulexity (複殺)

進化のためのデザイン...

C

Shell

Whipuptitude (殺速)

78

Page 144: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

!"#$%!

Manipulexity (複殺)

そして進化の道を歩む...

C

Shell

Whipuptitude (殺速)

79

Page 145: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

!"#$%!

Manipulexity (複殺)

さらに進化、どんどん進化...

C

Shell

Whipuptitude (殺速)

80

Page 146: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

!"#$%!

Manipulexity (複殺)

キミタチのプログラムはすべて我々がいただいた...

C

Shell

Whipuptitude (殺速)

81

Page 147: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

!"#$%!

Manipulexity (複殺)

キミタチのプログラムはすべて我々がいただいた...

C

Shell

Whipuptitude (殺速)

681

Page 148: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

∀82

Page 149: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

抽象化は

➥セクシー

83

Page 150: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

クロージャsubmake_counter{my$start=shift;returnsub{++$start};}my$from_three=make_counter(3);print$from_three‐>();#4print$from_three‐>();#5

my$from_ten=make_counter(10);print$from_ten‐>();#11print$from_ten‐>();#12

84

Page 151: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

多段評価

BEGIN{print"Compile‐time";eval$generated_code;print'Stillincompiletime";}print"Normalruntime";eval$more_generated_code;

85

Page 152: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

実行時の型変換

my$piece=Pawn‐>new;bless$piece=>Queen;

86

Page 153: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

S87

Page 154: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

省略表現は

➥自然に

88

Page 155: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

コンテキスト

#Scalarvs.Listcontext

my$one=<STDIN>;#Readonelinemy@all=<STDIN>;#Readalllines

#Stringvs.Numericcontext

print"Lines:@all"if@all<10;

89

Page 156: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

鯛じゃなくてTie変数

tiemy%search=>'Tie::Google';print$search{'PerlPugs'}[0]{URL};#http://www.pugscode.org/

90

Page 157: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

正規表現

#DeCSS.pls''$/=\2048;while(<>){G=29;R=142;if((@a=unqT="C*",_)[20]&48){D=89;_=unqb24,qT,@b=map{ordqB8,unqb8,qT,_^$a[‐‐D]}@INC;s/...$/1$&/;Q=unqV,qb25,_;H=73;O=$b[4]<<9|256|$b[3];Q=Q>>8^(P=(E=255)&(Q>>12^Q>>4^Q/8^Q))<<17,O=O>>8^(E&(F=(S=O>>14&7^O)^S*8^S<<6))<<9,_=(map{U=_%16orE^=R^=110&(S=(unqT,"\xb\ntd\xbz\x14d")[_/16%8]);E^=(72,@z=(64,72,G^=12*(U‐2?0:S&17)),H^=_%64?12:0,@z)[_%8]}(16..271))[_]^((D>>=8)+=P+(~F&E))for@a[128..$#a]}print+qT,@a}';s/[D‐HO‐U_]/\$$&/g;s/q/pack+/g;eval

91

Page 158: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡92

Page 159: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

最高のコーディング

➥無コーディング

93

Page 160: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

94

Page 161: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

CPAN

95

Page 162: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡ 11年の蓄積

CPAN

95

Page 163: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡ 11年の蓄積

♡ 5791人を超える開発者

CPAN

95

Page 164: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡ 11年の蓄積

♡ 5791人を超える開発者

♡ 11400以上のモジュール

CPAN

95

Page 165: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

サービス群

96

Page 166: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡ パッケージ管理

サービス群

96

Page 167: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡ パッケージ管理

♡ 評判&掲示板(Ratings)

サービス群

96

Page 168: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡ パッケージ管理

♡ 評判&掲示板(Ratings)

♡ スモークテスト(CPANTS)

サービス群

96

Page 169: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

♡ パッケージ管理

♡ 評判&掲示板(Ratings)

♡ スモークテスト(CPANTS)

♡ バグ管理システム(RT)

サービス群

96

Page 170: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

語彙≩構文

97

Page 171: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

“Perlは今までで最高の道具でした”

98

Page 172: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

しかし...

99

Page 173: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl 5は CPANにとって最高の道具ではありませんでした

100

Page 174: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☣101

Page 175: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

構文大杉

☣102

Page 176: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

103

Page 177: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev5;

103

Page 178: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev5;• subrender{

103

Page 179: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev5;• subrender{• my$self=shift;

103

Page 180: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev5;• subrender{• my$self=shift;• my%opts=(x=>1,y=>1,z=>0,%{$_[0]});

103

Page 181: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev5;• subrender{• my$self=shift;• my%opts=(x=>1,y=>1,z=>0,%{$_[0]});• formy$item($self‐>filter(@{$self‐>{items}})){

103

Page 182: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev5;• subrender{• my$self=shift;• my%opts=(x=>1,y=>1,z=>0,%{$_[0]});• formy$item($self‐>filter(@{$self‐>{items}})){• print$item‐>draw({

x=>$opts{x},y=>$opts{y},z=>$opts{z},}),"\n";

103

Page 183: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev5;• subrender{• my$self=shift;• my%opts=(x=>1,y=>1,z=>0,%{$_[0]});• formy$item($self‐>filter(@{$self‐>{items}})){• print$item‐>draw({

x=>$opts{x},y=>$opts{y},z=>$opts{z},}),"\n";

• }}

103

Page 184: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

104

Page 185: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev6‐alpha;

104

Page 186: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev6‐alpha;• methodrender($x=1,$y=1,$z=0){

104

Page 187: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev6‐alpha;• methodrender($x=1,$y=1,$z=0){•[email protected](@.items){

104

Page 188: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• usev6‐alpha;• methodrender($x=1,$y=1,$z=0){•[email protected](@.items){•say.draw(:$x,:$y,:$z);

}}

104

Page 189: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

中身はジェンガ☣

105

Page 190: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

106

Page 191: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

やっかいなバグと後方互換性

。・゚・(ノД`)

107

Page 192: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ベストプラクティスには

規律が不可欠

108

Page 193: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Prescription(処方箋)

109

Page 194: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Prescription(処方箋)

109

Page 195: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ベストプラクティスは

自然体であるべき!

110

Page 196: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

⑥111

Page 197: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2000RFCs

112

Page 198: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2001Parrot

113

Page 199: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2002Apocalypses

(黙示録)

114

Page 200: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2003(故)Ponie

115

Page 201: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2004Synopses

(ようやく要約)

116

Page 202: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2005Pugs

117

Page 203: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2006v6‐alpha

118

Page 204: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

2007v6‐std

119

Page 205: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

120

Page 206: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

120

Page 207: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯121

Page 208: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

結び難きを結び

122

Page 209: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

静的型vs

動的型

123

Page 210: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

型☺

124

Page 211: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

タイピング

☹125

Page 212: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

静的型(C++,OCaml...)

126

Page 213: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯効率的Efficient

静的型(C++,OCaml...)

126

Page 214: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯効率的Efficient

☯頑丈Robust

静的型(C++,OCaml...)

126

Page 215: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯効率的Efficient

☯頑丈Robust

静的型(C++,OCaml...)

動的型(Python,Ruby,...)

126

Page 216: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯効率的Efficient

☯頑丈Robust

☯生産性Productive

静的型(C++,OCaml...)

動的型(Python,Ruby,...)

126

Page 217: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯効率的Efficient

☯頑丈Robust

☯生産性Productive

☯臨機応変Flexible

静的型(C++,OCaml...)

動的型(Python,Ruby,...)

126

Page 218: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

段々型め

アノテーションと型推論による

127

Page 219: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usev5;•subf{•sqrt($_[0]**2+$_[1]**2);•}•my$five=f(3,4);

128

Page 220: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usev6‐alpha;•subf{•sqrt(@_[0]**2+@_[1]**2);•}•my$five=f(3,4);

129

Page 221: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•subf(Num$x,Num$y){•sqrt($x**2+$y**2);•}•myNum$five=f(3,4);

130

Page 222: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

131

Page 223: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• subsetPositiveofNumwhere{$_>0}

131

Page 224: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• subsetPositiveofNumwhere{$_>0}

• subf(Positive$x,Positive$y‐‐>Positivewhere{$_>($x&$y)}){

131

Page 225: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• subsetPositiveofNumwhere{$_>0}

• subf(Positive$x,Positive$y‐‐>Positivewhere{$_>($x&$y)}){

• sqrt($x**2+$y**2);}

131

Page 226: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• subsetPositiveofNumwhere{$_>0}

• subf(Positive$x,Positive$y‐‐>Positivewhere{$_>($x&$y)}){

• sqrt($x**2+$y**2);}

•my$five:=f(3,4);#inferredasPositive

131

Page 227: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

専用: DSL

vs

汎用: GPL132

Page 228: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

DSL(SQL,Regex,...)

133

Page 229: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯簡潔な表現Concise

DSL(SQL,Regex,...)

133

Page 230: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯簡潔な表現Concise

☯表現力豊かExpressive

DSL(SQL,Regex,...)

133

Page 231: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯簡潔な表現Concise

☯表現力豊かExpressive

DSL(SQL,Regex,...)

GPL

(Lisp,C,...)

133

Page 232: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯簡潔な表現Concise

☯表現力豊かExpressive

☯多目的利用Versatile

DSL(SQL,Regex,...)

GPL

(Lisp,C,...)

133

Page 233: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯簡潔な表現Concise

☯表現力豊かExpressive

☯多目的利用Versatile

☯再利用性Reusable

DSL(SQL,Regex,...)

GPL

(Lisp,C,...)

133

Page 234: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

コンパイラの拡張性

134

Page 235: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

マクロ

135

Page 236: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

マクロ

☯コンパイル時に評価される

135

Page 237: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

マクロ

☯コンパイル時に評価される

☯全ての部分が交換可能

135

Page 238: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

マクロ

☯コンパイル時に評価される

☯全ての部分が交換可能

☯それLexerでできるよ!

135

Page 239: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

136

Page 240: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• macrocircumfix:</**/>($x)isparsed/.*?/{''}

136

Page 241: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• macrocircumfix:</**/>($x)isparsed/.*?/{''}

• /*ThisisaC‐stylecomment*/

136

Page 242: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• macrocircumfix:</**/>($x)isparsed/.*?/{''}

• /*ThisisaC‐stylecomment*/

136

Page 243: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

137

Page 244: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• subpostfix:<!>($x){[*]1..$x}

137

Page 245: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• subpostfix:<!>($x){[*]1..$x}

• say10!;#3628800

137

Page 246: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

138

Page 247: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• macroGREETING(){#Alate‐boundmacroq:code(:COMPILING){"Hello,$s"};}

138

Page 248: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• macroGREETING(){#Alate‐boundmacroq:code(:COMPILING){"Hello,$s"};}

•my$s="world";sayGREETING;#Hello,world

138

Page 249: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

遅延評価vs

先行評価

139

Page 250: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

遅延評価(Haskell,Unixパイプ)

140

Page 251: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯モジュール化Modular

遅延評価(Haskell,Unixパイプ)

140

Page 252: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯モジュール化Modular

☯道理可Reasonable

遅延評価(Haskell,Unixパイプ)

140

Page 253: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯モジュール化Modular

☯道理可Reasonable

遅延評価(Haskell,Unixパイプ)

先行評価(それ以外)

140

Page 254: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯モジュール化Modular

☯道理可Reasonable

☯ベタ書きDirect

遅延評価(Haskell,Unixパイプ)

先行評価(それ以外)

140

Page 255: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯モジュール化Modular

☯道理可Reasonable

☯ベタ書きDirect

☯予測可Predictable

遅延評価(Haskell,Unixパイプ)

先行評価(それ以外)

140

Page 256: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

遅延アノテーションによる戻り型ポリモーフィズム

141

Page 257: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

142

Page 258: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #"cat"for=<>{.say}

142

Page 259: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #"cat"for=<>{.say}

• #"cat",togetherwithlinenumbersforeach(1..*;=<>){say"Line$^num:$^text";}

142

Page 260: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

143

Page 261: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Listsarelazybydefault

143

Page 262: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Listsarelazybydefault• my@fib:=(

143

Page 263: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Listsarelazybydefault• my@fib:=(• 0,1,

143

Page 264: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Listsarelazybydefault• my@fib:=(• 0,1,• each(@fib;@fib[1..*]).map(&infix:<+>)

);

143

Page 265: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Listsarelazybydefault• my@fib:=(• 0,1,• each(@fib;@fib[1..*]).map(&infix:<+>)

);•

say"Thefirsttennumbersare:@fib[^10]";

143

Page 266: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

144

Page 267: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Itemsareeagervalues.However...

144

Page 268: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Itemsareeagervalues.However...• my$ignored=lazy{10**(10*10)};

144

Page 269: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Itemsareeagervalues.However...• my$ignored=lazy{10**(10*10)};• my$unused=lazy{say1..$ignored};

144

Page 270: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Itemsareeagervalues.However...• my$ignored=lazy{10**(10*10)};• my$unused=lazy{say1..$ignored};

• say"Hello,world!";

144

Page 271: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Itemsareeagervalues.However...• my$ignored=lazy{10**(10*10)};• my$unused=lazy{say1..$ignored};

• say"Hello,world!";

144

Page 272: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Itemsareeagervalues.However...• my$ignored=lazy{10**(10*10)};• my$unused=lazy{say1..$ignored};

• say"Hello,world!";

• #(ForPerl5too:Scalar::DeferonCPAN)

144

Page 273: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

クラスベースvs

プロトタイプベース

145

Page 274: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

クラス(Java,Smalltalk,...)

146

Page 275: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯型強化Typeful

クラス(Java,Smalltalk,...)

146

Page 276: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯型強化Typeful

☯規律Disciplined

クラス(Java,Smalltalk,...)

146

Page 277: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯型強化Typeful

☯規律Disciplined

クラス(Java,Smalltalk,...)

プロトタイプ(JavaScript,Lua,...)

146

Page 278: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯型強化Typeful

☯規律Disciplined

☯適応性Adaptive

クラス(Java,Smalltalk,...)

プロトタイプ(JavaScript,Lua,...)

146

Page 279: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯型強化Typeful

☯規律Disciplined

☯適応性Adaptive

☯便利Convenient

クラス(Java,Smalltalk,...)

プロトタイプ(JavaScript,Lua,...)

146

Page 280: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

メタオブジェクトプロトコル

147

Page 281: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

148

Page 282: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• classDogisMammaldoesCompanion{

148

Page 283: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• classDogisMammaldoesCompanion{•

my$.countwhere0..100;

148

Page 284: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• classDogisMammaldoesCompanion{•

my$.countwhere0..100;•

has$!brain;

148

Page 285: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• classDogisMammaldoesCompanion{•

my$.countwhere0..100;•

has$!brain;

• has&.vocalize=&say;has$.nameisrw="Fido";

148

Page 286: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• classDogisMammaldoesCompanion{•

my$.countwhere0..100;•

has$!brain;

• has&.vocalize=&say;has$.nameisrw="Fido";

• has$.furhandlesGroomable;has$.tailhandles<waghang>;

148

Page 287: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• classDogisMammaldoesCompanion{•

my$.countwhere0..100;•

has$!brain;

• has&.vocalize=&say;has$.nameisrw="Fido";

• has$.furhandlesGroomable;has$.tailhandles<waghang>;

•methodcompanionhandless/^owner_//{...}}

148

Page 288: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

149

Page 289: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• myDog$fido.=new;

149

Page 290: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• myDog$fido.=new;•

$fido.HOW;#themetaobjectforDog

149

Page 291: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• myDog$fido.=new;•

$fido.HOW;#themetaobjectforDog• $fido.WHAT;#theDogprototypeobject

149

Page 292: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• myDog$fido.=new;•

$fido.HOW;#themetaobjectforDog• $fido.WHAT;#theDogprototypeobject• $fido.WHICH;#$fido’sObjectID

149

Page 293: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• myDog$fido.=new;•

$fido.HOW;#themetaobjectforDog• $fido.WHAT;#theDogprototypeobject• $fido.WHICH;#$fido’sObjectID

• Dog.isa(Dog);$fido.isa(Dog);

149

Page 294: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

150

Page 295: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• $fido.HOW.add_method('bark',method(){$.vocalize('Woof!')});

150

Page 296: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• $fido.HOW.add_method('bark',method(){$.vocalize('Woof!')});

• Dog.can('bark');$fido.can('bark');

150

Page 297: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

スレッドvs

プロセス151

Page 298: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

スレッド(暗黙的)

152

Page 299: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯直感的Intuitive

スレッド(暗黙的)

152

Page 300: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯直感的Intuitive

☯並列処理可Parallelizable

スレッド(暗黙的)

152

Page 301: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯直感的Intuitive

☯並列処理可Parallelizable

スレッド(暗黙的)

プロセス

(明示的)

152

Page 302: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯直感的Intuitive

☯並列処理可Parallelizable

☯決定論的Deterministic

スレッド(暗黙的)

プロセス

(明示的)

152

Page 303: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯直感的Intuitive

☯並列処理可Parallelizable

☯決定論的Deterministic

☯管理が簡単Manageable

スレッド(暗黙的)

プロセス

(明示的)

152

Page 304: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

並列処理☺☺☺

153

Page 305: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ロック

☹ ☹ ☹154

Page 306: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

155

Page 307: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•async{$x.withdraw(3);

$y.deposit(3);}

155

Page 308: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•async{$x.withdraw(3);

$y.deposit(3);}

☣RaceCondition☣

155

Page 309: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

156

Page 310: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• async{$x.lock;$y.lock;

156

Page 311: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• async{$x.lock;$y.lock;

• $x.withdraw(3);$y.deposit(3);}

156

Page 312: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• async{$x.lock;$y.lock;

• $x.withdraw(3);$y.deposit(3);}

• async{$y.lock;$x.lock;}

156

Page 313: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• async{$x.lock;$y.lock;

• $x.withdraw(3);$y.deposit(3);}

• async{$y.lock;$x.lock;}

☣Deadlock☣

156

Page 314: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

STMトランザクション

157

Page 315: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

158

Page 316: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•async{

158

Page 317: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•async{•contend{#begintransaction

158

Page 318: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•async{•contend{#begintransaction•$x.withdraw(3);$y.deposit(3);

158

Page 319: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•async{•contend{#begintransaction•$x.withdraw(3);$y.deposit(3);

•}#commitorrollback}

158

Page 320: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

159

Page 321: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Retrywith"defer"methodwithdraw($n){deferif$.balance<$n;$.balance‐=$n;}

159

Page 322: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Retrywith"defer"methodwithdraw($n){deferif$.balance<$n;$.balance‐=$n;}

•#Choicewith"maybe"subtransfer($x1,$x2,$y){maybe{$x1.withdraw(3)}maybe{$x2.withdraw(3)}$y.deposit(3);}

159

Page 323: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Retrywith"defer"methodwithdraw($n){deferif$.balance<$n;$.balance‐=$n;}

•#Choicewith"maybe"subtransfer($x1,$x2,$y){maybe{$x1.withdraw(3)}maybe{$x2.withdraw(3)}$y.deposit(3);}

•#Composablewithnested"maybe"contend{maybe{transfer($x1,$x2,$y)}maybe{transfer($x3,$x4,$y)}}

159

Page 324: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

SIMDvs

MIMD160

Page 325: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

SIMD(APL,Fortran)

161

Page 326: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯シンプルSimple

SIMD(APL,Fortran)

161

Page 327: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯シンプルSimple

☯スケーラブルScalable

SIMD(APL,Fortran)

161

Page 328: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯シンプルSimple

☯スケーラブルScalable

SIMD(APL,Fortran)

MIMD

(それ以外)

161

Page 329: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯シンプルSimple

☯スケーラブルScalable

☯型が豊富Richertypes

SIMD(APL,Fortran)

MIMD

(それ以外)

161

Page 330: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯シンプルSimple

☯スケーラブルScalable

☯型が豊富Richertypes

☯なじみ深いFamiliarflow

SIMD(APL,Fortran)

MIMD

(それ以外)

161

Page 331: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

162

Page 332: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #HyperOperator(SSE/GPUfriendly)[1,1,2,3,5]»+«[1,2,3,5,8];

162

Page 333: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #HyperOperator(SSE/GPUfriendly)[1,1,2,3,5]»+«[1,2,3,5,8];

• #===[2,3,5,8,13]

162

Page 334: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

163

Page 335: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•#RecursiveVisits‐«[[1,2],3];

163

Page 336: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•#RecursiveVisits‐«[[1,2],3];

•#===[[‐1,‐2],‐3]

163

Page 337: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

164

Page 338: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•#HyperMethods[1,4,9,16]».sqrt;

164

Page 339: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•#HyperMethods[1,4,9,16]».sqrt;

•#===[1,2,3,4]

164

Page 340: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

165

Page 341: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• %timepugs‐e'(1..100000)>>.sqrt'real9.387suser9.219s

165

Page 342: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• %timepugs‐e'(1..100000)>>.sqrt'real9.387suser9.219s

•%timeenvGHCRTS=‐N2pugs‐e'(1..100000)>>.sqrt'real5.807suser6.959s

165

Page 343: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

166

Page 344: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Junctionssubis_prime(Int$n‐‐>Bool){$n%all(2..$n.sqrt+1);}

166

Page 345: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Junctionssubis_prime(Int$n‐‐>Bool){$n%all(2..$n.sqrt+1);}

•subhas_twin_prime(Int$n‐‐>Bool){is_prime($n&($n±2));}

166

Page 346: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Junctionssubis_prime(Int$n‐‐>Bool){$n%all(2..$n.sqrt+1);}

•subhas_twin_prime(Int$n‐‐>Bool){is_prime($n&($n±2));}

•subinfix:<±>($x,$y){($x+$y)|($x‐$y);}

166

Page 347: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

• #Junctionssubis_prime(Int$n‐‐>Bool){$n%all(2..$n.sqrt+1);}

•subhas_twin_prime(Int$n‐‐>Bool){is_prime($n&($n±2));}

•subinfix:<±>($x,$y){($x+$y)|($x‐$y);}

•166

Page 348: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

俺オレ言語

vsあなたの言語

167

Page 349: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl6

168

Page 350: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯褒めるBetter

Perl6

168

Page 351: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯褒めるBetter

☯褒めるBetter

Perl6

168

Page 352: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯褒めるBetter

☯褒めるBetter

Perl6 その他

168

Page 353: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯褒めるBetter

☯褒めるBetter

☯褒めるBetter

Perl6 その他

168

Page 354: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

☯褒めるBetter

☯褒めるBetter

☯褒めるBetter

☯褒めるBetter

Perl6 その他

168

Page 355: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

169

Page 356: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejsan:DOM;

169

Page 357: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejsan:DOM;•useperl5:DBI;

169

Page 358: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejsan:DOM;•useperl5:DBI;•usehaskell:Numeric;

169

Page 359: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejsan:DOM;•useperl5:DBI;•usehaskell:Numeric;•useyour_language:FavouriteModule;

169

Page 360: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejsan:DOM;•useperl5:DBI;•usehaskell:Numeric;•useyour_language:FavouriteModule;

169

Page 361: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

170

Page 362: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejava:java.lang.System;

170

Page 363: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejava:java.lang.System;

•say"GreetingsfromJava",•System.getProperty('java.version');

170

Page 364: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

•usejava:java.lang.System;

•say"GreetingsfromJava",•System.getProperty('java.version');

•#GreetingsfromJava1.5.0_07

170

Page 365: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Pugs

JavaScript

Haskell Perl 5

YARV?JVM?

CLR? PyPy?

171

Page 366: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

❆172

Page 367: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

で 結局 Perl 6 のリリースっていつ?

173

Page 368: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

クリスマスに!

174

Page 369: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

Perl 6 がキタら,

毎日がクリスマス(かもしれない)

175

Page 370: Perl 6 Today - Pugs · 2008-10-05 · Perl 6 Today Pugs-An implementation of Perl 6 Perl 6-Reconciling the Irreconcilable Au!ey Tang 1

ご清聴ありがとうございました

176