Comment by rossant
6 months ago
I really like the immediate mode GUI (IMGUI) paradigm. The other day, I looked into whether any web-based IMGUI libraries existed. It seems that HTML and the DOM are designed so differently from IMGUI that such an approach doesn't really make sense, unfortunately, unless everything is rendered manually in a canvas, WebGL, or WebGPU, which brings its own set of challenges.
I really like Mithril.js (https://mithril.js.org/), which is, IMO, as close as it gets to web IMGUI. It looks a lot like React, but rendering happens manually, either on each event or with a manual m.redraw() call.
I think, similar to Preact, Mithril skips the VDOM, which makes it "more immediate" than React.
However, updating the DOM and then turning the DOM to an image (i.e., rendering it) still has an indirection that using canvas/webgl/etc. don't have.
> I think, similar to Preact, Mithril skips the VDOM, which makes it "more immediate" than React.
Both Mithril and Preact use virtual DOMs:
https://mithril.js.org/vnodes.html
https://preactjs.com/tutorial/01-vdom
Isn't that basically what VDOM is?
A virtual DOM is another indirection, so the opposite of what immediate mode tries to accomplish.
Immediate mode only describes the interface.
2 replies →