Show HN: JavaScript web apps with WASM layout and GPU rendering in 280 KB github...
HN Best 200 @best
Show HN: JavaScript web apps with WASM layout and GPU rendering in 280 KB github.com · 7 points · 1 comments · HN thread
TL;DR Uniform is a preview cross-platform UI and rendering library by a single author: a C core compiled to WASM on the web and native code elsewhere, driven from a JavaScript or C API, with GPU rendering via Metal or WebGPU. The author claims a complete web app fits in under 280 KB compressed and that the native runtime is under 2 MB, with hot reload on all platforms including iOS.
- Layout and rendering engine written in C, compiled to WASM for the web and native code elsewhere; shaders written in Slang.
- JavaScript API calls directly into the C core; no build step is needed for the JS workflow, and hot reload works on macOS, iOS and the web.
- Currently supports iOS and macOS (Metal) and the web (WebGPU); Windows, Linux and Android via Vulkan are planned.
- Provides constraint and stack layout, SDF-based shapes with effects like refraction and shadows, gestures, extended dynamic range, and text layout with character-level access.
- A built-in packager can produce signed app bundles, and the C version can embed the WASM build into a custom HTTPS server.
- Linked demo is said to require WebGPU; the author notes a Safari feature flag is needed for 120 Hz.
Links in the post
- Uniform live demo: Live web demo of Uniform; the page could not be read, so its content is unknown.
Discussion The thread has only one comment, so there is no real discussion. The single commenter is skeptical and gives concrete examples of what a custom-rendered UI loses: OS-level password manager autofill, the user's dictionary, and input method editor support for CJK languages. They also argue that apps drawn this way behave differently from everything else a user does. The tone is critical but constructive, pointing to Google Earth as a real-world example of the same tradeoffs.
- Custom rendering discards essential OS input features (a few): The commenter says drawing everything in the browser or a canvas breaks password manager autofill, personal dictionaries and IME support for languages like Chinese, Japanese and Korean. Those are functions that users depend on and that the library would need to rebuild.
- Non-native behavior makes apps feel inconsistent (a few): Because the app does not reuse platform controls, its behavior differs from the rest of the user's apps, which the commenter says is frustrating. They cite Google Earth, where text is not selectable by default and right-click or copy features are missing.
Links from the comments