Another difference is that your unit of code is th...
# present-company
k
Another difference is that your unit of code is the cell, whereas the unit of code in PLs is the function (plus a few others). Combinations of cells can be represented by nodes and wires. Combinations of functions are a lot more diverse, e.g. using higher-order functions.
m
Are there any examples of programming interfaces or apps that use a pub/sub-first paradigm?
t
spreadsheets, reactive programming.
the event listener pattern is pub sub, its not like you can't do it in PL, but if you chain a ton of event listeners together synchronously you get weird cyclical bugs so its kinda harder than it looks to be a good pub-sub system.
j
Dataflow is definitely more natural for many situations 💯
1
v
And dataflow was originally represented in text, not visually!
k
One aspect of functions I haven't seen mentioned yet here is the lack of a locus. You can call a pure function from any number of places, and they'll never conflict. Each call occurs in a private universe thanks to stack frames. Whereas replacing them with nodes and wires gives them a place and so introduces the possibility of lots of new failure modes. Can multiple wires start from the same port, end in the same port? What happens if 2 inputs come in at the same time on this wire? Did input A mix with input B that had accidentally been sitting around for a long time? Personally I consider pure functions to be dataflow constructs. I also think of them as pull constructs, though I understand how they're more push than FRP and so on.
❤️ 1
Does Excel seem like pull? It's often storing a function call in a cell. The data flow nature comes from binding the output of a call to a cell/place, and the function call doesn't itself inherently seem to interfere with doing so?
t
Yes excel is pull because once a cell has a value. Any other cell can depend on it. It's all in an easily accessible global scope. When a normal function returns, that result it private to the caller. You have to call that function again in many places and it's not the same calculation each time.
k
In Excel too it's not the same calculation each time, depending on the args you hardcode into the call. Excel does provide a structured space for global variables, it's true 😄 In a conventional programming language you have to deliberately assign the result to a global.
t
It's is, every value is essentially memoization in excel. The cells remember their result. If you are talking about a function call inside an excel formula, then yes, that's a traditional function call, I am not talking about that. Even variable assignment to a global scope in trad PL, you still need to decide when to pull for the latest state. It's not enough to make a variable global for a push system. To make PL push you have to register a callback.
k
Yeah, I was talking about the function call inside a formula. So I think we understand each other.
g
And dataflow was originally represented in text, not visually!
Please expand on this point. Thanks. @vitorio
v
I don't think we had graphical representations of programs before Sutherland '66 and GRAIL '69? But, dataflow programming existed before that. Sutherland built his thesis atop CORAL, from '64, which calls out "flow diagram" as a thing it might be good for. Morrison claims "late 60s" for flow-based programming, and wrote its first implementation (AMPS) in S/360 assembly language, decidedly not graphically. Bell Labs had BLODI in '61. Wikipedia lists a bunch of more recent ones, but also, as a development paradigm, can't you do a dataflow architecture in basically any programming language (but especially functional ones, so, LISP was '50s)?