top | item 34693734

(no title)

aconbere | 3 years ago

I’ve spent the last week playing around with running WASM apps executing WebGL.

I’m exhausted by the modern web. There are so many layers and layers and layers, and none of it works very well!

But WebGL rendering on the web offers a unique and compelling alternative. I can write my frontend and backend in Rust. I can use gui libraries like egui directly if I want or write my own UIs if I prefer.

It’s almost like going back to the bad flash days, but with open web standards.

There are a bunch of downsides (some the article mentions. Accessibility isn’t there yet, the platform is immature so a lot of basic stuff you have to write yourself (form handling, etc), and a big one for me is: text rendering! There appears to be few if any mature text rendering libraries that you can drop into a webgl project and get good crisp text, shaping, and kerning.

discuss

order

martin_drapeau|3 years ago

15 years ago I was at the same place you are. Believe it or not, I built an entire web-like UI using Tcl/Tk!

But then I hit limits and started re-implementing the wheel. So I bit the bullet and learned all those layers of web development. Never looked back.

When you get to that point, may I suggest you master HTML and submitting forms. You can do a lot without Javascript. Look at Laravel for an easy to comprehend framework (PHP). It is just perfect.

aconbere|3 years ago

I think you might be confused about where I'm coming from and starting at. I've been writing rich web applications professionally since 2004.

jimmySixDOF|3 years ago

Have you looked at TrokiaJS ?

whitehexagon|3 years ago

I have also been developing a Wasm UI framework first with canvas2D and Go, but the wasm was too big, and now using Zig and WebGL. But yes, fonts/text is a pain with GPU, all that power and you'd think by now you could upload a font to the GPU and call drawText(x,y). I thought about a shader for that, or custom svg renderer, but probably months of work, and now thinking to layer a Canvas2D over the WebGL and keep the font rendering on the browser side and let it do its z compositing, but probably lose a lot of the performance benefits of a pure WebGL UI... And I already found a bottleneck trying to render animated SVG onto a texture map that results in a copy back each frame, and yet 'video' can be rendered to texture directly by blit... frustrating. Almost thinking bare metal PI fb development would be more fun :)

traverseda|3 years ago

My ideal stack is plain html, enhanced with HTMX for things like form validation.

Then for more complicated stuff I use self contained web components. That web component might be a terminal, or it might be a text editor, or it might be some kind of video calling widget.

One example, you don't need javascript for a chat interface (aside from htmx). You can use htmx to subscribe to a server-sent-event stream for receiving messages, and for posting them you just use a normal form element. It lets you write a lot more app-like functionality as standard html, and for when you can't do that a custom element is often the answer.

Don't know why web components haven't caught on more.