14,081 karma · joined Mar 7, 2014 (12y ago) · 1,887 submissions
comment 6y ago · link · parent
We don't have the one frame latency, as it's not imgui under the hood. (There's a bug in the Crochet prototype on this, but it's known and will be fixed).
Hope this helps clear things up a bit.
comment 6y ago · link · parent
Since then, I've both regretted the fact that we're duplicating work, and been happy that we've been able to move more nimbly than we would if we were dragging the rest of the winit userbase along. A recent example of that is keyboard handling, and I'm expecting a similar situation soon with IME, as we'll want to handle that very differently than winit's current implementation.
Take a look at our CI for the testing story. We have some tests, but they're mostly for platform-independent logic; we don't run a lot of platform specific code in CI. That said, Rust's type system is strong enough to catch a lot of potential breakage at compile time. Other than that, people tend to notice broken things pretty quickly. So overall testing is one of the many things we want to improve, but works reasonably well.
comment 6y ago · link · parent
Compile times have been getting better. For reference, on my machine an incremental build of Runebender is 2.3s. Part of this reflects some choices we've made to use platform capabilities rather than build the entire stack ourselves.
comment 6y ago · link · parent
At the lower level, for some things you really have to integrate deeply with the platform, and for others (text layout is one), there are advantages, including faster builds and smaller binaries. (Ultimately I'd like to have a highly GPU accelerated 2D graphics library that does everything, including text, but that's some ways off and doesn't block current work)
comment 6y ago · link · parent
comment 6y ago · link · parent
In any case, I haven't done detailed design work on accessibility, but enough poking around to get some sense of what might be involved.
You are right that stable com-rs will help a lot with this kind of integration; there are soundness and other issues with the custom com implementations we've had to do. Fortunately there are good people working on it.
comment 6y ago · link · parent
This is one reason I'm really enjoying Rust. When it comes time to do some platform integration, you just haul out the unsafe keyword and write it, nothing in your way. By contrast, when I was working on Android and had to do a lot of JNI, it was painful.
comment 6y ago · link · parent
Ultimately, I believe our approach will yield higher quality results, but there's a lot to learn from Iced as well.
comment 6y ago · link · parent
Oh, this is my post. Never mind, carry on.
More seriously, this was my contribution to the Rust 2021 blogging effort. I didn't really intend for it to be posted to HN, more as in internal discussion within the Rust community. Even so, I'm happy to discuss and answer questions.
Read some more thoughts about Rust 2021 here: https://readrust.net/rust-2021
comment 6y ago · link · parent
What you've done is a pretty small change to the DOM and generally compatible with it. What I've done in Crochet is a more radical rework, but certainly with some of the same general principles (my `Mutation` datatype is also a transaction). I should also point out that my tree mutation is a bit more limited, as it can't do general movement of subtrees, only sibling movement within the same parent (and, in the current prototype, no swapping, only order-preserving, which includes insert, delete, and update).
If some compatibility with browser DOM is a goal, then your approach is appealing. I'm not pursuing it in my prototype because I'm also holding overall system simplicity as a whole. But in any case, I agree that people should be aware of what Sciter does; it's an impressive system.
comment 6y ago · link · parent
I don't have very strong feelings either way about stream-based computation. I am skeptical that using them as a primary primitive for building UI is going to work out well. Things are nice in the static case, but it seems to break down a bit when there's dynamic reconfiguration. Evan Czaplicki has given good talks on his evolution away from purist FRP. It's also interesting to compare the original Elm thesis[1] with the farewell[2].
That said, I think it's a super-interesting experiment to try to integrate these ideas with the Crochet architecture and see how it turns out.
[1]: https://people.seas.harvard.edu/~chong/pubs/pldi13-elm.pdf
comment 6y ago · link · parent
comment 6y ago · link · parent
Regarding DOM, yes. I think it's held up pretty well considering how long the ideas have been around. It's slow, it's clunky, but it gets the job done. But I also think now is a good time to consider better ways to implement its core functionality, which is tree mutation.
comment 6y ago · link · parent
Certainly I've spent a lot of time thinking about collaborative and distributed systems, and there is no doubt scope for cross-fertilization of ideas. A huge inspiration (cited in the post) is Martin Kleppmann's automerge, which uses a proxy object to capture an explicit diff from a computation which is expressed using ordinary mutable logic.
Regarding the build system work, I will say this: the build task is inherently graph-like, and a lot of the interesting problems involve choices of sort order to utilize parallelism best; I'm fortunate to have a 16 core machine, and it makes me sad to wait on a single-threaded link step. I think by comparison the reactive UI task is mostly dealing with tree structure, and that's a simplification that could be useful to exploit. It's easier to describe mutation of a tree than general mutation of a graph.
But certainly there are common themes in all these incremental systems, and I continue to be drawn to figuring out the fundamental principles rather than trying to build systems ad-hoc.
1070.
Towards Principled Reactive UI(raphlinus.github.io ↗)
234 points · by raphlinus · 6y ago · 97 comments
comment 6y ago · link · parent
Apple's branding of SwiftUI and Swift is a bit of a double-edged sword, I think. The former is a highly proprietary, undocumented (but beautifully engineered) walled garden that only works on Apple hardware, and only recent OS versions at that. The latter is open source and purports to be a general-purpose, cross platform language, comparable in scope to C++, C#, Go, Rust, Kotlin, and other comparable contenders. They have only themselves to blame if some of the perception of the former rubs off when people think about the latter.
comment 6y ago · link · parent
Given that the original article is blurring glyphs, one thing that might be worth exploring is decomposing the glyph into primitive shapes. For example "b" can be a rect for the stem, an ellipsoid for the main bowl, and another ellipsoid (with negative sign) for the inner countour of the bowl. It doesn't have to be perfect because you're only rendering the blurred shapes. And no doubt you could have some kind of automated process that refines the decomposition when it can use more primitive shapes.
Though our techniques are different, it's interesting (and not terribly surprising) that they both use some of the same techniques under the hood, specifically distance fields, and that we cite some of the same people.
I should mention that of course shadows and blurs are not the same thing, but sometimes you can use one for the other in a pinch :)
[1] https://raphlinus.github.io/graphics/2020/04/21/blurred-roun...
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
comment 6y ago · link · parent
I'll give an example of the latter which I find compelling. OpenType shaping (one of the subproblems of text layout) is a notoriously difficult problem, and almost nothing can compete with HarfBuzz, which is written in C++. Yet there is already one pure Rust alternative being used in production, Allsorts (used in Prince XML), and another promising one in development (rustybuzz, being developed by RazrFalcon, who has a track record of shipping ambitious 2D software).
comment 6y ago · link · parent
comment 6y ago · link · parent
If you had a large dataset of keystroke-by-keystroke edit streams, you'd be able to match up erroneous code with the eventual fix. Google or Facebook could absolutely capture these datasets for their internal work if they wanted, and I suspect the results could be scary-good. They wouldn't be able to release the models, though, even for their open source work (Chromium and Android), because it would have such a high chance of revealing internal secrets.
comment 6y ago · link · parent
I think these projects show that GLR is viable (there's a good set of grammars written for Tree-sitter), but I am also very willing to believe that the parser in rust-analyzer is more finely tuned for the specific needs of a Rust IDE.