Show HN: JavaScript web apps with WASM layout and GPU rendering in 280 KB github...
Show HN @show
Show HN: JavaScript web apps with WASM layout and GPU rendering in 280 KB github.com · 5 points · 0 comments · HN thread
TL;DR Uniform is a new cross-platform UI framework by a single developer, with a C layout and rendering core compiled to WASM on the web and native code elsewhere, plus a JavaScript API and a sub-2 MB runtime. The article presents it as a replacement for native and HTML/CSS-based UI tools, with hot reload on all platforms and a complete web app under 280 KB compressed. It is in Preview, supporting macOS, iOS and the web (WebGPU), with Windows, Linux and Android planned.
- Layout and rendering core is written in C, with shaders in Slang; the same core compiles to WASM for the web and native code for other platforms.
- The JavaScript API calls directly into the C core and needs no build step; the C API is offered for higher performance.
- Rendering uses Metal on Apple platforms and WebGPU on the web; Vulkan support for Windows, Linux and Android is planned.
- Layout combines constraints and stacks, with fixed-point arithmetic and pixel-snapped edges; shapes use signed distance fields for effects like glass refraction and shadows.
- Hot reload works on macOS, iOS and the web, including editing JS on an iPad with no computer or internet connection.
- The runtime can package apps for app stores, with packaging steps also written in JS or C.
Links in the post
- Live demo: Linked live demo of Uniform in the browser; it requires WebGPU. The page could not be read, so its contents are unknown.
Discussion No comments have been posted yet, so there is no discussion to summarize. The submission has 5 points and has not yet drawn any responses.