3 ms·
Not just does the computer not do functional. UI is also very much not functional, and in fact the lack of progress in UI the last 30-40 years can largely be t
by mpweiher 2mo ago
Not just does the computer not do functional.
UI is also very much not functional, and in fact the lack of progress in UI the last 30-40 years can largely be traced to trying to create UI with procedural/functional programming languages, an instance of linguistic-architectural mismatch.
Further reading:
Programs = Data + Algorithms + Architecture: Consequences for Interactive Software Engineering -- Stéphane Chatty.
https://link.springer.com/chapter/10.1007/978-3-540-92698-6_22 https://link.springer.com/chapter/10.1007/978-3-540-92698-6_...
Can Programmers Escape the Gentle Tyranny of call/return?
https://2020.programming-conference.org/details/salon-2020-papers/5/Can-Programmers-Escape-the-Gentle-Tyranny-of-call-return- https://2020.programming-conference.org/details/salon-2020-p...
UIs Are Not Pure Functions of the Model - React.js and Cocoa Side by Side
https://blog.metaobject.com/2018/12/uis-are-not-pure-functions-of-model.html https://blog.metaobject.com/2018/12/uis-are-not-pure-functio...
Beyond Procedure Calls as Component Glue: Connectors Deserve Metaclass Status
https://2024.splashcon.org/details/splash-2024-Onward-papers/9/Beyond-Procedure-Calls-as-Component-Glue-Connectors-Deserve-Metaclass-Status https://2024.splashcon.org/details/splash-2024-Onward-papers...
- cloogshicer 2mo agoThanks for those links! Some of it was great reading. What is your thesis then? What is UI?
- Exoristos 2mo agoDeclarative–reactive. Like SwiftUI.
- mpweiher 2mo ago"A view is a (visual) representation of its model. It would ordinarily highlight certain attributes of the model and suppress others. It is thus acting as a presentation filter." https://web.archive.org/web/20090424042645/http://heim.ifi.uio.no/~trygver/1979/mvc-2/1979-12-MVC.pdf https://web.archive.org/web/20090424042645/http://heim.ifi.u... View and model are related, but neither is procedurally dominated by the other. The view is not a subroutine of the model, or vice versa. They are related entities that communicate in order for the view to function as a representation of its model to the user, and for the model to be manipulated by the user. To get the details I really recommend the Chatty paper. It is a bit hard to read, but delivers the goods.
- jay_kyburz 2mo agoIsn't that the Controller part in MVC
- mpweiher 2mo agoCommon misconception, but nope. The quote is from the original definition by Trygve Reenskaug, the inventor of MVC (see link above). https://en.wikipedia.org/wiki/Trygve_Reenskaug https://en.wikipedia.org/wiki/Trygve_Reenskaug Here some more on that misconception: https://blog.metaobject.com/2015/04/model-widget-controller-mwc-aka-apple.html https://blog.metaobject.com/2015/04/model-widget-controller-...
- cloogshicer 2mo agoInteresting, will check that out! My working thesis is that UIs are basically video games. Just a gut feeling I can't really 100% put in words. But essentially they're the same thing: Read input, update model, render view.
- mpweiher 2mo agoThat's pretty much where immediate mode GUIs and to a less extent React came from. (Though for React the provenance is probably closer to the HTML web-app: send request - update model - return HTML with complete and completely new UI.) The difference is that for most games, throwing away the complete rendered graphics and re-rendering from the world model is often the right approach. For most UIs, it isn't, unless they really are very close to video games, for example mostly passive feed readers, video players etc.
- cloogshicer 2mo ago> For most UIs, it isn't Why? Genuinely asking, this topic is very interesting to me.
- mpweiher 2mo ago
- bsder 2mo ago> UI is also very much not functional, I disagree, and I believe that the complete stagnation of GUIs is due to ignoring this. There is no good reason why a GUI system isn't: Description->Pack->Apply events->Generate assets->Render assets. At each point you reify the result into an artifact that is everything the next stage needs. This has a couple of nice properties. One property is that everything is deterministic and testable. Another property is that after the pack and apply, everything is now embarrassingly parallel. Another good property is that you have an artifact that the accessibility people can latch onto before you bury it under pixels. That would be a very functional way to deal with GUIs. However, we continue inheriting properties and single main threading everything like we're still on 33MHz machines with 8MB of RAM.
- ardit33 2mo agoYou are applying a one way arrow to events where in real life events do change state and can completely change UI (and functions) itself. Which makes imperative always the superior mode. What you described works only in super simple scenarios. Whink Web 1.0, when Javascript was used for basic form validation at best, and didn't change DOM that much.
- mpweiher 2mo ago>> UI is also very much not functional, > I disagree, and I believe that the complete stagnation of GUIs is due to ignoring this. I disagree with your assessment. >Description->Pack->Apply events->Generate assets->Render assets. 1. What does that even mean? I don't see a UI in there at all, at best some graphics (Render). 2. That's not "functional". If anything, it looks like a pipeline, so dataflow. But then again, see (1) 3. Not sure why reification, that is turning things into objects, is functional to you. Reification, that is turning things into objects, is object-oriented. 4. MVC was actually created on 5.8 MHz machines with 128KB of RAM (including the display buffer). And still works beautifully today. https://en.wikipedia.org/wiki/Xerox_Alto https://en.wikipedia.org/wiki/Xerox_Alto
- bsder 2mo agoFunctional is all about reification. You take a set of things in, you apply/map/collect/fold/whatever, you eject a set of things out. That is 100% functional--every time you supply the same inputs you get exactly the same outputs. The point of functional programming is that you avoid mutation and hidden state. And, um, side note: dataflow programming is almost always considered functional programming. Object oriented, by contrast, is all about hidden state and mutation. I send a message or call a function on that object over there and fingers wiggle and magic happens. But I don't know what or when or even if it actually happened. And increasing evidence suggests that MVC doesn't work beautifully today because it doesn't parallelize, and it scatters state between uncooperative things. Just ask every single GUI that exists--every single one hangs because somebody made an oops and put too much work on the single, blessed primary thread. Or they have janky scroll. Or resizes leave gunk on the screen. Or your system flashes and jiggles because it's too busy reflowing everything in the universe. Or ...