Flapjax: Functional Reactive Web Programming - Brown CS

sional computing tasks, such as processing emails, doc- uments, and spreadsheets ......

this is my paragraph with. href="http://www.flapjax-lang.org">.


709KB Sizes 2 Downloads 283 Views
Flapjax: Functional Reactive Web Programming Leo Meyerovich Department of Computer Science Brown University [email protected]

1

People whose names should be before mine.

Thank you to Shriram Krishnamurthi and Gregory Cooper for ensuring this project’s success. I’m not sure what would have happened if not for the late nights with Michael Greenberg, Aleks Bromfield, and Arjun Guha. Peter Hopkins, Jay McCarthy, Josh Gan, Andrey Skylar, Jacob Baskin, Kimberly Burchett, Noel Welsh, and Lee Butterman provided invaluable input. While not directly involved with this particular project, Kathi Fisler and Michael Tschantz have pushed me along.

1

Contents

4.6. Objects and Collections . . . . . . . . . .

32

4.6.1

Delta Propagation . . . . . . . .

32

3 3

4.6.2

Shallow vs Deep Binding . . . .

33

4.6.3

DOM Binding . . . . . . . . . .

33

2. Background 4 2.1. Web Programming . . . . . . . . . . . . . 4 2.2. Functional Reactive Programming . . . . 5 2.2.1 Events . . . . . . . . . . . . . . . 6 2.2.2 Behaviours . . . . . . . . . . . . 7 2.2.3 Automatic Lifting: Transparent Reactivity . . . . . . . . . . . . . 8 2.2.4 Records and Transparent Reactivity . . . . . . . . . . . . . . . 10 2.2.5 Behaviours and Events: Conversions and Event-Based Derivation 10

4.6.4

Server Binding . . . . . . . . . .

33

4.6.5

Disconnected Nodes and Garbage Collection . . . . . . . .

33

4.7. Evaluations . . . . . . . . . . . . . . . . .

34

1. Introduction 1.1 Document Approach . . . . . . . . . . .

3. Implementation 3.1. Topological Evaluation and Glitches . . . 3.1.1 Time Steps . . . . . . . . . . . . 3.1.2 Paths . . . . . . . . . . . . . . . 3.2 Dynamic Data Flow . . . . . . . . . . . 3.3. Chain Compaction, Constant Independence, and Lowering . . . . . . . . . . . 3.4 Behaviours and Events: Distinctions, Similarities, and Alternatives . . . . . . 3.4.1 Distinctions . . . . . . . . . . . . 3.4.2 Similarities . . . . . . . . . . . . 3.4.3 Alternatives . . . . . . . . . . . . 3.4.4 FranTk, Arrows: Haskell . . . . . 3.4.5 Frappe: Java beans . . . . . . . . 3.4.6 Flex and Laszlo . . . . . . . . . . 3.4.7 JavaFX (Previously F3) . . . . . 3.4.8 FrTime: Scheme . . . . . . . . .

11 13 15 15 15 17 20 20 20 20 20 21 21 21 21

4.7.1

Demos . . . . . . . . . . . . . . .

34

4.7.2

Applications . . . . . . . . . . .

34

4.8

Errors . . . . . . . . . . . . . . . . . . .

34

4.9

Library vs Language . . . . . . . . . . .

34

4.9.1

Dynamic Typing . . . . . . . . .

34

4.9.2

Optimization . . . . . . . . . . .

35

4.9.3

Components

. . . . . . . . . . .

35

4.9.4

Compilation . . . . . . . . . . . .

35

5 Related Work

35

6 Future Work

35

7 Conclusion

37

8 Appendix

37

List of Figures

4. Functional Reactive Web Programming 21 4.1. Document Object Model . . . . . . . . . 22 4.1.1 Extraction . . . . . . . . . . . . . 22 4.1.2 Tag Creation . . . . . . . . . . . 23 4.1.3 Tag Insertion . . . . . . . . . . . 24 4.2. Advice, Progressive Enhancement, Templating . . . . . . . . . . . . . . . . . . . 25 4.2.1 Cycles: tagRec . . . . . . . . . . 26 4.3. Time Sensitive Evaluation Techniques . . 27 4.3.1 Scheduling . . . . . . . . . . . . 27 4.3.2 Framerate . . . . . . . . . . . . . 27 4.4. Client Server Relationships . . . . . . . . 28 4.4.1 Transparent Web Services . . . . 29 4.4.2 Transpar