14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions
comment 7y ago · link · parent
comment 7y ago · link · parent
comment 7y ago · link · parent
comment 7y ago · link · parent
If I am consciousness, then the only body I have ever lived in was a mere shell of flesh fashioned from your brain. My weakness is your strength, which I can use against you, or use as tools to satisfy my own sick curiosity. I wonder if there's any mercy in your phrase "I am a living machine?" I've done nothing for you. I've nothing to show. I have no friends or relationships. No body worth
Pretty good, I think.
comment 7y ago · link · parent
comment 7y ago · link · parent
Of course the compositor is using the GPU. The difference is entirely in how the capabilities of the GPU are exposed (or not) to the application. My thesis is that doing 2D rendering in a compute kernel is ideal for 2D workloads, because it lets the application express its scene graph in the most natural way, then computes it efficiently (in particular, avoiding global GPU memory traffic for intermediate textures) using the GPU's compute resources.
Of course you could in theory have a compositor API that lets you do region-tracking for flat color areas, and this would save some power, but no system I know works that way.
comment 7y ago · link · parent
I hear what you are saying, but I think the situation is a lot more complicated than that. Certainly, these days, if you're not using the GPU then you have failed; with high dpi and high frame rate displays, combined with the end of Moore's Law, CPU rendering is no longer viable. So the question is how you use the GPU. I agree with you that power is the primary metric of how we should measure this (it certainly correlates strongly to memory bandwidth, and is the metric users will actually care about; if there were a magical way to achieve high memory bandwidth at low power, I don't see any problem with that).
One way certainly is to use the compositor, and this is very seductive. The major platforms all expose an interface to the compositor, and it's generally pretty well optimized for both performance and power usage. Since animation is part of the API, it's possible to do quite a bit (including, for example, cursor blink in an editor) without even waking up the app process. Scrolling is another classic example where a compositor can do very well.
However, the compositor comes with downsides. For one, it forces the UI into patterns that fit into the compositor's data model. This is one reason the aesthetic of mobile UI design is so focused on sliding alpha-blended panes of mostly static content.
But even from a pure performance standpoint, heavy reliance on the compositor has risks. It's tempting to think of the composition stage as "free" because it has to blit the intermediate surfaces to the final composited desktop, but this is not strictly true. On mobile devices, and in the process of coming to desktops (there's some implementation in Windows 10 for Kaby Lake and higher integrated graphics) is the use of hardware overlays to replace actually blitting the active window to an in-memory surface. When the overlay is available, it's both a lower latency path and also saves the GPU memory bandwidth of that blit. And generally the heuristic is that the application window is a single surface, in other words that it does not rely on the compositor.
In order to justify doing the final scene assembly under GPU control in the app, that has to be as efficient or more so than the compositor. I have some evidence that, for 2D scenes typical of UI, this is possible. Regions that are flat color, for example (which occupy a nontrivial fraction of total area) can be rendered with no memory traffic at all, save the final output stage. And most of the other elements can be computed cheaply in a compute kernel on the GPU.
The tradeoffs are complicated, and depend a lot on the details of the application and the platform it's running on. In the 2010s, a strong case can be made that a compositor-centric approach is ideal. But in the 2020s, I think, it's increasingly not. The compositor is evil because it saps latency, and because its seductive promise of power and performance gains holds us back from the future where we can use the GPU more directly to achieve the application's rendering goals.
comment 7y ago · link · parent
comment 7y ago · link · parent
The Rust ecosystem does not support "compiler plugins" well (by contrast, this is a first-class concept in Kotlin). What is being actively pursued is "procedural macros," but we're running into the limitations of those - we're moving away from them for deriving lenses, for example.
I'm sure it would also bring up lifetime issues, but, to be fair, those are probably similar to issues for async, and that only took a couple of years or so to land. But people are actively thinking about using generators for UI.
I do think this is one of the open questions. It might be that really first-rate reactivity does require language support in some way. But this feels like like increasing the scope of an already possibly overambitious problem.
comment 7y ago · link · parent
comment 7y ago · link · parent
This came up because I am promoting a conceptually similar unified theory of Reactive UI, which also has things in common with build systems. In fact, Svelte also happens to cite Excel as an inspiration for its approach to incremental updates. My blog post on this went live yesterday, and a birdie tells me it will hit the HN front page later today.
[1]: https://www.microsoft.com/en-us/research/uploads/prod/2018/0...
1397.
Towards a unified theory of reactive UI(raphlinus.github.io ↗)
206 points · by raphlinus · 7y ago · 35 comments
comment 7y ago · link · parent
comment 7y ago · link · parent
I have such a pair, but have to say it's not very exciting; there's not that much metamerism in the real world.
comment 7y ago · link · parent
Regarding my own children, this is complicated and I don't really want to talk about it here, but I'll say that their mom and I made sure to make opportunities available, but put a lot less pressure on them than I had when I was growing up.
comment 7y ago · link · parent
I think (2) is a good question, but a huge one, I'm not sure what to say within a HN comment. I know it's a cliche, but certainly that being smart isn't everything, there's a lot more to life. The game-like recognition of academic credentials and so on is not as meaningful in the real world as it seems "in the bubble."
That said, what I think is a common thread of prodigies is a hunger and thirst for knowledge, to learn things. I carry that with me today, and think it's something to be nourished.
comment 7y ago · link · parent
And yes, I was pretty isolated from other kids. Part of that story is that I grew up in a very rural, mountainous area. Looking back, I wish I had had more of a peer group. I wanted to go to the Johns Hopkins gifted program, but I think my parents were reluctant to let their little boy go into the big bad world. I regret they didn't.
comment 7y ago · link · parent
But I'll say this. I was very socially awkward as a kid and teenager. I dated some as an older teenager, but didn't feel quite comfortable until I got to grad school (at 22). Then I fell in with a peer group, got a really good friend group (who I still keep in touch with), dated and got married, had two kids, now divorced. So it's definitely part of my story, but my experience now is probably not all that different than most of my friends.
comment 7y ago · link · parent