UIs are streaming DAGs [video]
hytradboi.com
hytradboi.com
from the talk:
> Photon is at least as reliable as today-era web applications, there are lots of well-understood ways to approach reconnecting local-first etc. We have not done this work yet
I think this really understates the truly immense amount of engineering work that goes into making modern web system software appear reliable to users. Maybe Photon has a good solution but if my years in engineering have taught me anything it's that every line of code written and design decision made before tackling the hardest part of a problem need to be redone, so you should start with the hardest part first.
I am hopeful that I'm proved wrong though :)
What we have not yet done is the implementation work, because our pilot use case driving our eng priorities – an internal support app for a Series B SAAS startup – does not actually have this theoretical problem you describe. Photon's protocol today is tolerant to arbitrary delays, IFF you can guarantee message delivery and ordering, which is the problem TCP solves. We do already have pending/loading states, which are trapped locally through reactive try/catch.
BTW, the Photon codebase is only 2k LOC (analyzer, compiler & interpreter for JVM and JS targets, standard library) and a substantial part of that is redoing parts of the Clojure/Script analyzer infrastructure.
"truly immense amount of engineering work that goes into making modern web system software appear reliable to users"
That's a bit much for me. The current industry state of commercial SAAS/crud apps is a dumpster fire, Photon's speed and responsiveness is already miles ahead of literally every laggy SAAS tool we all suffer where programmers have manually hand-coded the network in the form of REST calls, manually split HTTP routes, backends-for-frontends, client side ORM, GraphQL resolvers, etc. How often do you Cmd-R your gmail or notion because it stopped working? React.js-era software is rotting to death, "reliable" is not a word that remotely describes my daily experience with web software today.
While your passion for the project and excitement at its prospects are clear (and I've very much enjoyed following along), this comment makes it sound you've opened a yak barbershop inside this poor support department.
Perhaps something useful comes out of it. If I recall correctly, CMake (the de-facto standard build system for C++ applications) originated as a yak shaving subproject of a medical visualization application.
TCP solves that only within the context of a single TCP connection (which I’m sure you know).
That doesn’t seem to handle even common moving laptop use cases, let alone actual mobile users.
This is a fair criticism! I am biased because my work history has placed me in companies that really care about maintaining this illusion.
> React.js-era software is rotting to death, "reliable" is not a word that remotely describes my daily experience with web software today.
I will say, that some of this is the result of how hard the problem we're talking about is. While React could definitely improve the affordances for this logic, having worked with a few systems that try to maintain the illusion of a reliable network I've found inherent tensions balancing speed, performance, cost, and time the UI spends in an inconsistent state. It's a Hard Problem™.
Regardless, I'm wishing you the best of luck. I'm heartened to hear what you have is 2k lines, it will make a re-write much less painful if it's needed :)
My takeaway was that they successfully identified the small essence of the problem ("It's DAG, stupid!") and wrote a relatively few but intelligent lines of code to solve it. And they have gotten pretty far with the implementation.
God does not require rewrites of such.
The area you're covering is closely related to an active area of development within the JS frontend framework community. They consider it hydration perf work and the working terminology is partial hydration or resumption/resuming rendering (there's a couple approaches/tradeoffs). In particular, the Marko team has a system under development that works this way without explicitly defined client/server pieces. They're mostly solving it on the server and streaming the HTML down since they have a priority on page load perf but the models look very close to me. I don't have a definitive piece to link as an intro and the concepts haven't made their way into the broader JS community but I thought you might be interested.
I'm happy that hyperfiddle is still going, I recall the Clojure NYC presentation and this is looking a lot more polished.
I don't mean to be dismissive, but most of us still do classic SSR (like we did in 90s/00s except maybe with Rust/Go instead of PHP) and it's still awesome and resource-friendly (both for server and client).
I assume you meant there's problems with "hydrating" client-side scripts (Next.js in this case) and templates for use server-side. Which is fine if you need it! I'd just like to point out that 99% of web pages don't need any form of client-side rendering logic (apart from the browser's HTML/CSS rendering engine) and are much more user-friendly without any scripts running at all, even if you leave aside memory/privacy concerns. And if you really need some client-side interaction for some reason, i've found HTMX to be a very refreshing approach to this question.
EDIT: To be clear, i'm not saying this for you specifically, but for someone who would read through this topic and currently believes they need client-side scripting to build "modern" websites.
our Photon technology is for next-gen stateful applications like an IDE or low-code tool, not websites.
How can we scale cloud software applications to parity with desktop quality UIs and beyond?
(this was not covered in the talk, we will clarify it, thank you for the feedback)
This entire system seems very stateful.
Also, in the real world, requests to one web service end up cascading out to multiple web services, with differing permissions models. For example user comes in with a token, makes a request to a web service, which then has its own secret store that it fetches an API key from to make a request to another web service.
Very rarely in life has it been as simple as "fetch data from this API". It is "fetch data from this API given this auth token and that API takes that auth token and uses it to get another auth token, attaches some tracing info for diagnostics in case things go wrong, writes some metrics to a DB so the team can track API usage, then goes out to a couple more services, gets data from them, collates it, and eventually gives some data back to the user."
"Could", of course, is the operative word! But given that we have to manage state now anyway, this seems like an approach with a lot of potential.
The system we describe in the talk is indeed stateful, but it's worth pointing out that the Photon runtime is referentially transparent in the pure functional programming sense. People think functional programming is about avoiding state and effects; it's not. It's about gaining control over our effects so that we can orchestrate scaled up fabrics of millions of fine grained effects without loss of composition, reasoning or control. This is the promise of modern functional effect systems, and is the underpinning abstraction that powers Photon.
There's room for so many different solutions to so many different problems. Shooting something down because its "stateful" well, okay if you know your problem domain well and that's significant to you then so be it, but that smells to me like "I have nothing valuable to contribute so I'm going to throw out a meaningless non-sequitur". I'll happily prioritize developer productivity first when user experience is not meaningfully impacted. I suspect that ~95% of web developers are in that same position.
I’ve never heard of DAG, yet it’s used as if it’s commonplace.
Probably, the author didn't design the title for a general public on HN, but for Getz' fellow software UI researchers.
Someone that's not in the target audience will have to do some extra work to get up to speed. Just like an undergraduate will have a hard time understanding a graduate text without a primer.
Is DAG a commonplace acronym for people attending HYTRADBOI? Maybe (I see 2 other talks mentioning graphs/trees in their title).
DAG, as in direct acyclic graph, is indeed a basic concept of computer science.
But indeed the author could do a better job with the text. One of the very basic principles of technical writing is to always introduce the definition when an acronym is first presented, something like "blablabla a direct acyclic graph (DAG)".
Of course, it’s possible to speak about either of those things without assuming this knowledge, but this is then a very different talk, most of which will be useless to most of the people who do already have it (not all—it’s useful to occasionally read introductory stuff on topics you think you know!). This is essentially the same thing as power-user usability: it can and does evolve into gatekeeping if left unchecked, and a fresh perspective is a useful check, but assuming everyone is a novice is not the right approach either.
(Some mathematics books choose the worst of both worlds: you really do need to know X to read this book, but “to make this book self-contained” we just included a short two-chapter summary of X that instills horror in anyone who doesn’t know it and forces everyone who does to dig through every word searching for conventions or non-standard assumptions. I’ve been in both categories, sometimes simultaneously. On the other hand, other introductory sections of this kind are remarkably crisp summaries that I go around recommending to everyone.)
Directed acyclic graphs are a basic computer science topic. There is no way around it. DAGs are introduced in intro to algorithms and data structures courses, right on the first semester of any first year course.
Arrays, linked lists, trees, graphs. Far from obscure topics. Well, DAGs lie right between trees and graphs, and are typically the very first type of graph presented to freshmen.
Also, DAGs pop up all the time in practical applications.
> But indeed the author could do a better job with the text. One of the very basic principles of technical writing is to always introduce the definition when an acronym is first presented
and saying that no, not expanding the acronym is not always a mistake or sign of inferior writing.
Are there any other spots that need better explanation?
To use the general startup cliche of “execution over ideas”, show me the code/demo ;)
Would love to see this work (having toiled away for 20years writing FE/BE/DNS glue) and you can make a pretty penny too.
Sometimes explicit boundaries are a good thing. In fact, I would argue that they are more often than not.
This will suffer from the same issues once you move beyond toy examples.
certainly people can build bad things. there is however a very real likelihood that a programming model which includes distribution will turn out to be effective
Photon is designed to scale in complexity without loss of performance or ability to reason. The computational structure that achieves this is single directional dataflow with pure functions; the abstraction is “referentially transparent” which means it composes mathematically the way pure functions compose.
Strong composition as a basis for abstraction scalability (in the domain of UI) is the core innovation here.
You can freely mix the HTML with PHP code and even query the database directly using the user's input. (We know how well that turned out...)
Looks like an interesting project. One thing I worry about is debugging. I once had to help out with some weird bugs in a relatively simple RShiny application written using the reactive model, and it was a total nightmare.
Bonsai, a UI state machine composition library - https://opensource.janestreet.com/bonsai/
DatalogUI, Build UI declaratively with Datalog. - https://github.com/datalogui/datalog
What is DAG in this context? Directed Acyclic Graph? Please explain your acronyms.