Re:Show HN: We launched a new web browser
by gwbas1c on Thursday April 28, 2022 @09:05AM
(#31191973)
Thanks, I'll follow up. (And fix the email link)
FYI: You can do GC in WASM. I'm actively working in Blazor right now, which is C# compiled to WASM. Even though it's GC, it still relies on the Dispose pattern. (IE, if an object has a resource or needs explicit cleanup, it can't rely on the garbage collector to know when to release its resource or otherwise do its cleanup.)
But I'd be careful about being too opinionated about forcing a language onto the consumers of an API. I believe WinForms (the first C# UI API) was a thin wrapper around the Windows UI API, but I never did a Windows UI in Win32 directly to fully validate my assumption.
Re: canvas+HTML5. Yeah, you can definitely go that way but there are some issues. My own analysis took me down a slightly different route. The issue with using WASM/Canvas is:
1. You need a UI toolkit that can draw into the canvas. Those are hard work. Making a simple one that gets abandoned after a year is easy, making one that's got a competitive feature set and which is maintained over the long term; much harder. Some do exist and it'd make sense to leverage them.
2. Of the toolkits that do exist, none are particularly well suited to wasm (maybe Qt could work?). In particular you normally want to write GUIs in high level GCd languages, but wasm doesn't support GC nor language-specific JITCs.
3. If you look at things developers are expressing a need for today when they go outside the limits of HTML5, it's often a combination of things like performance, OS integration, hardware integration, a wish or need to use other programming languages etc. HTML5 is a poor UI toolkit or really barely a UI toolkit at all, but that's not what's driving people currently. So the question is what would your offer be in the short term if you're restricted to wasm and canvas?
4. Finally, if you look at where HTML5 is weak and not innovating, or not even in the game at all, in my view there's lots of areas but they mostly require you to be outside the browser to fix them.
So I think the way to go is to make being outside the browser a much more hospitable place and in that way encourage people to build competing neo-browsers. Let 1000 flowers bloom, if you see what I mean.