Skip to content

Commit 63eb8b5

Browse files
author
Steve Krouse
committed
frp essay feedback, meeting with JE
1 parent fe1192b commit 63eb8b5

File tree

2 files changed

+242
-0
lines changed

2 files changed

+242
-0
lines changed

notes/jonathan-edwards/09-26-18.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Jonathan Edwards 9/26/18
3+
---
4+
5+
# Jonathan Edwards 9/26/18
6+
7+
## FRP Feedback
8+
9+
- Final version is on Sunday, no changes past this point
10+
- [Full feedback here](/papers/comprehensible-frp/feedback#takeaways)
11+
12+
## Random things (for next meeting on Oct 8)
13+
14+
- Sponsorship
15+
- Scholarship
16+
- Comp reading group
17+
- Goal of Onward! eventually
18+
- London friends...?
19+
- Alan blackwell and people (person he knows)
20+
- Ask for ppig people after he goes
21+
- Roly
22+
- Schedule podcast!
23+
24+
25+
<script>
26+
27+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
28+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
29+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
30+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
31+
32+
ga('create', 'UA-103157758-1', 'auto');
33+
ga('send', 'pageview');
34+
35+
</script>
36+
<script repoPath="stevekrouse/futureofcoding.org" type="text/javascript" src="/unbreakable-links/index.js"></script>

papers/comprehensible-frp/feedback.md

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
---
2+
title: Feedback on Explicitly Comprehensible Functional Reactive Programming
3+
---
4+
5+
# Feedback on Explicitly Comprehensible Functional Reactive Programming
6+
7+
* TOC
8+
{: toc }
9+
10+
## Review A
11+
12+
Overall merit: 3. Weak accept
13+
14+
Reviewer expertise: 2. Some familiarity
15+
16+
### Paper summary
17+
18+
This short paper contrasts two FRP architectures: Elm's single reducer that applies to the whole global model, and Reflex's multiple local reducers that apply to more explicit sub-states.
19+
The main section of the paper compares the implementation of a *TODO-MVC* application focusing on the behavior of the list of *TODO* items.
20+
In Elm, the implementation is scattered across the whole file and requires `CTRL-F` queries to understand the behavior as a whole.
21+
If Reflex, the behavior is self-contained in a single portion of code.
22+
The paper then discusses the tradeoffs between the architectures with respect to dependencies, familiarity, easy of reading and writing, and serialization.
23+
24+
### Comments for author
25+
26+
The paper raises an interesting discussion about what would be the best architecture for FRP applications.
27+
I'm not an expert in FRP but could understand the central discussion and main arguments in the paper.
28+
However, I believe the text could introduce what is described as the fundamental difference between the languages, namely high-order and cyclic streams (also the concept of Dynamics).
29+
Furthermore, the text does not discuss *why* these features are necessary to maintain explicitness in FRP.
30+
31+
In general, the examples and explanations are too short and demand more familiarity with Haskell (specially for the examples in Reflex).
32+
For instance, from the example, I could not fully acknowledge the phrase "In Reflex we use stream combinators to define the model and view as streams of each other. The single global I/O cycle of Elm becomes a number of cyclic definitions between model and view streams in Reflex."
33+
34+
The TODO-MVC example focus on understanding what are the pieces of code that affect the "entries".
35+
What if we wanted to know what a specific message may affect in the program?
36+
In this case, the implementation in Elm would be the one to provide the answer without a "CTRL-F".
37+
Why is this question less important (or irrelevant) than the one raised in the paper?
38+
39+
One aspect that the Reflex's architecture seems to be superior is on lexical scope: "There’s also a subtler way the Elm Architecture undermines explicitness: each piece of state can be modified in terms of any other piece of state. There’s no explicit isolation between independent states."
40+
This aspect is not further investigated in the paper.
41+
I wonder how a short-lived object such as editing an entry in the list would be implemented.
42+
I suspect that Elm would require some form of explicit state machine in the global state that Reflex could somehow avoid.
43+
44+
The section on related work seems to be quite incomplete.
45+
The paper only provides 4 references (one is a Wikipedia entry which is not peer reviewed).
46+
47+
If the paper needs more space, I believe Section 7 on future work could be removed.
48+
49+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
50+
51+
## Review #7B
52+
53+
Overall merit: 3. Weak accept
54+
55+
Reviewer expertise: 2. Some familiarity
56+
57+
### Paper summary
58+
59+
This paper discusses shortcomings of Elm as an instance of a state-of-the-art model for FRP when it comes to scalability, modularity, and thus, comprehensibility. It constrasts the by now standard Todo and counter applications written in Elm with the Reflex library for Haskell.
60+
61+
### Comments for author
62+
63+
This is a nicely written position paper. However, it offers little in terms of vision - the authors themselves note what I felt while reading the paper: that reading Reflex code right now might be more annoying than scanning through a larger swath of Elm code.
64+
65+
That being said, the points the authors make are valid: while readability (and, to some extend, modularity) issues with Elm could be fixed with static analysis and better tooling, the reality is that other FRP libraries are inspired by Elms way of writing code, but not its statically analyzable nature and something needs to be done to help those systems. I would have liked more discussion towards what a "best of" of a JS FRP library and the Reflex library could look like, beyond mentioning a few visualizations and tools that the author deemed interesting.
66+
67+
This leads me to another problem of the paper: references to related work. The paper reads a lot more like a blog post than a paper, with fairly ad-hoc references to other systems and tools, with no reason given why these were mentioned in preference to others. It feels very much like the author simply tried both languages and wanted to write down some thoughts before they forget them. I'm not saying such comparisons cannot be useful - but the paper just doesn't offer much supporting evidence that the problems the author identifies are major problems in practice (I think they are - I just think that this isn't as unconditionally accepted in the community as to not need further evidence).
68+
69+
Minor typo: Section 7.2 first word: it -> in
70+
71+
Figure 7 is too pixelated to read.
72+
73+
74+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
75+
76+
77+
## Review #7C
78+
79+
Overall merit: 3. Weak accept
80+
81+
Reviewer expertise: 4. Expert
82+
83+
### Paper summary
84+
85+
This paper offers a qualitative comparison of the software engineering
86+
properties of GUI applications implemented in Elm using the Elm
87+
architecture with those implemented using Functional Reactive Programming in
88+
Reflex, a Haskell-based implementation of FRP. The paper presents a detailed
89+
tutorial walk-through of implementations of the classic "TodoMVC" example
90+
implemented in both systems, and then explores how well each implementation
91+
supports programmer understanding of the resulting program by reading the
92+
source code of each.
93+
94+
### Comments for author
95+
96+
The tutorial walk-through of the simple counter example for both systems
97+
is well written, and the authors
98+
raise a number of excellent questions about modularity and scalability
99+
properties of programs written using the Elm architecture. However,
100+
the core ideas in the paper just weren't explored in enough depth for me
101+
to recommend acceptance.
102+
103+
The core argument here seems to focus on "explicitness", arguing that Elm
104+
allows any view component to emit any message, requiring that the programmer
105+
read the entire application program to gain a complete understanding of
106+
how different parts of the program interact. In contrast, FRP requires a
107+
single expression to define every signal (Behavior or Event stream), enabling
108+
a more localized analysis to understand the inter-dependencies between signals.
109+
110+
The main thing I would have liked to see explored in more depth is some
111+
concept of *components* formed from primitive GUI elements, and then
112+
explore how those components are *composed* into a larger application in
113+
both Elm and Reflex. A pattern for component composition in Elm is given
114+
in the Elm documentation at
115+
https://www.elm-tutorial.org/en-v01/02-elm-arch/06-composing.html
116+
This could be demonstrated by (for example) taking the basic Counter
117+
app used as an example in this paper, treating this as a component,
118+
and then constructing a larger application that allows the user to
119+
edit a collection of counters, perhaps by providing buttons to add, remove or
120+
re-order components.
121+
How would such composition work out in Reflex, and how does Reflex compare
122+
to Elm in terms of modularity and abstraction of internal state for each
123+
component instance?
124+
(A follow-on question that might be interesting: What if we wanted to
125+
abstract this notion of a general-purpose collection editor for any
126+
underlying GUI component (i.e. not just counters). Is that kind of
127+
abstraction possible in Elm and Reflex?)
128+
129+
The paper seems to be taking a step in the direction of exploring components
130+
and component composition with the diagrams
131+
shown at the end of the paper. But frankly, while it was straightforward
132+
to map the Elm diagram to the implementation, I had a difficult time
133+
understanding the Reflex diagram, and how this mapped to the Reflex
134+
implementation. It looks as if the box labeled "taskEntry" is
135+
a kind of component with its own internal state. But this diagram is
136+
never adequately explained in the paper, so it is difficult to be
137+
sure.
138+
139+
More detailed comments:
140+
141+
- Sec. 1, Para 1: "which lines of read" ==> "which lines to read"
142+
143+
- Sec. 2, last para: "simulating a global bag of mutable variables that change
144+
over time": I'm not sure this charge is really justified; arguably the
145+
reducer provides a more controlled single entry point for calculating
146+
model updates. To justify this claim, we'd need to see a larger example
147+
with multiple models and reducers and make the case that messages can
148+
really flow from anywhere in the application.
149+
150+
- Sec. 3, para 3: "...not in the order they are 'evaluated'. There is no
151+
explicit evaluation order here." I think it might be better to just
152+
directly mention that these are recursive monad bindings, and cite
153+
Levent Erkok's paper on the topic.
154+
155+
- Sec. 3, bullet list, `<$` operator: mention that this is the `bind`
156+
operator from Yampa or `-=>` operator from Fran.
157+
158+
- Sec. 3, para 4: "However this architecture does not properly scale": It is
159+
not clear there is a scale issue here. The following text seems to explain
160+
a straightforward generalization to make the code more flexible by supporting
161+
an additional feature; this doesn't really suggest a scalability problem.
162+
163+
- Sec. 4.1, last para: "only to comprehend only" --> "to comprehend only"
164+
(duplicated "only")
165+
166+
- Sec. 4.1, lasta para: "Explicitness is lost ...". Is this about explicitness
167+
or modularity?
168+
169+
- Listing 3: label: "Elm TodoMVC" --> "Reflex TodoMVC"
170+
171+
- Sec. 5, para 4: "The Elm architecture reduces coupling". Worth defining
172+
"coupling" here.
173+
174+
- Sec. 6: This related work section seems thin, and doesn't include any of
175+
past efforts on FRP-based GUIs, such as reactive-bannana-wx or threepenny-gui.
176+
177+
- Sec. 7.1: I am dubious about the relevance of this section. While
178+
visualizations can be helpful debugging tools, I'm not sure it's central
179+
to the argument being put forward in this paper.
180+
181+
182+
## Takeaways
183+
184+
(Created with [Jonathan Edwards](/notes/jonathan-edwards/09-26-18))
185+
186+
1. Make it clear why higher-order and cyclic streams are neccesary to maintain explictness
187+
2. Discuss how Redux can be converted to Elm, but not the reverse. Elm is more "powerful" but less structured. Less information is encoded in the semantics.
188+
3. Beef up discsussion about lexical scope in Reflex and how it beat Elm's notion of components because it doesn't have modularity.
189+
4. Beef up related work section and references: Fran, Yampa, Experience Report FRP in DOM, maybe reactive-bannana and threepenny-gui, remove Wikipedia
190+
5. Make fig 7 less pixelated and explain it more, or remove it
191+
6. Define "coupling" (or use "interdepencies"), "explictness" (and why it's important), "modularity", "composibility"
192+
7. Relatedly (to 6), define "comprehensibility", possibly in terms of interdepencies between data/state, possibly with "static" and "explicit"
193+
194+
195+
<script>
196+
197+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
198+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
199+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
200+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
201+
202+
ga('create', 'UA-103157758-1', 'auto');
203+
ga('send', 'pageview');
204+
205+
</script>
206+
<script repoPath="stevekrouse/futureofcoding.org" type="text/javascript" src="/unbreakable-links/index.js"></script>

0 commit comments

Comments
 (0)