Live data from Hacker News

Making WebAssembly a first-class language on the Web

hacks.mozilla.org

251–260 of 287 posts

Re: Making WebAssembly a first-class language on the Web

#251
post #214

Earlier quoted context omitted.

I for one am thankful to them for it. I think we need a return to the real native. The JS/Web-slop has gone too far.

I personally hate that I need to download app from every company for every service they offer. On the other hand I love tje simplicity of opening webpage, do what I want to do there and forget it. Probably 80% of app in my phone are used very rarely, often just once yet they still sit there, getting updates, requesting permissions and sometimes eating battery... good web app can do everything native app can.

> good web app can do everything native app can.

I could not disagree more

Re: Making WebAssembly a first-class language on the Web

#252
post #227

Earlier quoted context omitted.

My god yes. I'm building a new Wasm GC-based language and I'm trying to make as small as binaries as possible to target use cases like a module-per-UI-component, and strings are the biggest hinderance to that. Both for the code size and the slow JS interop.

Can you use WTF-16 for strings in your language?

I have a compiler flag to switch from wtf-8 and wtf-16 so if you compiler for your host you don't have to reencode strings. That means that strings in my language hide their byte representation, don't allow indexed access, and only have code point iterators.

Re: Making WebAssembly a first-class language on the Web

#253

Earlier quoted context omitted.

But the app-slop is totally fine right? Apple controlling every piece of software on my phone hasn't gone too far? Empowering the web to compete with Apple and Google's native locked down options is the only viable alternative I see.

Problem, as I see it, is that these "native locked down options" are very often just webpages in disguise, which is also webslop imo

The native locked down options are the natives apps you're advocating for, I don't understand. They're the Swift/uikit or Koltin/jetpack apps. It sounds like you don't like web technology in general and would rather everyone do it the centralized Apple/Google way?

Re: Making WebAssembly a first-class language on the Web

#254

Earlier quoted context omitted.

It's worth it if it gets rid of JavaScript

"out of the frying pan into the fire"... I'd like to avoid wasm too...

To each their own. Anything that frees people from the misery of JavaScript and front end frameworks is a good thing in my book.

Re: Making WebAssembly a first-class language on the Web

#255

Earlier quoted context omitted.

> I'm not sure about C# (the only other language I saw with interior pointers). I think C# semi-recently switched over to a moving collector. In which case, I'm curious to know how they solved the interior pointer problem. Objects references are just pointers in .NET. See the JIT disassembly below. It's been using a moving GC for a long time, too. https://sharplab.io/#v2:C4LghgzgtgNAJiA1AHwAICYCMBYAUKgZgAIM...

Interesting. I wonder how C# handles the moving. I'm guessing it has to go in and fix up the pointers in the stack after a gc run? Or is this some OS level virtual pointer weirdness going on? How does C# guard against someone doing something silly like turning a pointer into a long and then back into a pointer again later?

The runtime knows exactly where GC pointers are so I would assume that is what it does. It even knows precisely when locals are no longer needed so it can stop treating objects they refer to as reachable. It's instruction level, not based on scopes, so an object can be freed while it is still in scope if the code doesn't access it!

> How does C# guard against someone doing something silly like turning a pointer into a long and then back into a pointer again later?

I don't think it does. You can't do most of these things without using unsafe code, which needs a compiler flag enabled and code regions marked as `unsafe`.

Re: Making WebAssembly a first-class language on the Web

#256
post #214

Earlier quoted context omitted.

I personally hate that I need to download app from every company for every service they offer. On the other hand I love tje simplicity of opening webpage, do what I want to do there and forget it. Probably 80% of app in my phone are used very rarely, often just once yet they still sit there, getting updates, requesting permissions and sometimes eating battery... good web app can do everything native app can.

> good web app can do everything native app can. I could not disagree more

Your disagreement only remains valid because of Apple using their blocking power to quash web APIs from becoming standards. You can shill all you want for Apple, but they are being sued by the DOJ for abusive business tactics, which include leveraging their vote in the W3C to prevent web browsers on their platform from being as capable as native apps.

https://www.justice.gov/archives/opa/media/1344546/dl?inline

Re: Making WebAssembly a first-class language on the Web

#257
post #17

Earlier quoted context omitted.

I agree that a lot of the tooling is still early days. There has also been a lot of churn as the wasm component spec has changed. We personally have a goal that in most cases web developers won't need to write WIT and can just use Web API's as if they were a library. But it's early days.

I am excited by the prospect of booting Wasm binaries without any JS glue, but when I've looked at the documentation for the component model and WIT it says that resources are references passed using a borrow checking model. That would be a serious downgrade compared to the GC-managed reference passing I can do today with Wasm GC. Do you know if there are any plans to resolve this mismatch?

Relevant: https://github.com/WebAssembly/component-model/issues/525

In my experience people are often disappointed by the shared-nothing architecture of the component model. I guess that shared-nothing architecture makes it impossible to properly share GC objects across component boundaries. But they can still be shared across core module boundaries.

Re: Making WebAssembly a first-class language on the Web

#258

This was supposed to happen already in the 2000s. JVM in everywhere, especially in the browser. There was Java rings you could wear, Java Card VM (JCVM), Squawk VM, Java ME. "Java the language is almost irrelevant. It's the design of the Java Virtual Machine. And I've seen compilers for ML, compilers for Scheme, compilers for Ada, and they all work. Not many people use them, but it doesn't matter: they all work." --J…

The early 2000s were too early for that for Java.

Before Java 6 in 2006 JVM wasn't a good target for dynamically typed languages. In Java 6 they added some support but it wasn't very efficient. In 2008 they started serious work on fixing this, and that work went into Java 7 in 2011.

The .NET CLR on the other hand was designed from the start to be a good target for all types of language and was superior to JVM at this from the start through at least Java 7.

Re: Making WebAssembly a first-class language on the Web

#259

Earlier quoted context omitted.

> good web app can do everything native app can. I could not disagree more

Your disagreement only remains valid because of Apple using their blocking power to quash web APIs from becoming standards. You can shill all you want for Apple, but they are being sued by the DOJ for abusive business tactics, which include leveraging their vote in the W3C to prevent web browsers on their platform from being as capable as native apps. https://www.justice.gov/archives/opa/media/1344546/dl?inline

Sorry, but you are the one obsessed with Apple for some reason and are projecting the opposite of that (shilling) on me. I don't have any particular reason to favor Apple.

I do, however, notice that I have never used a program that was built with either a web stack or a gc language stack, that wasn't getting slower over time, wouldn't cause strange issues, and wouldn't have crippled UI to match whatever the stack's limitations have been at the time. IMO the right direction is developing (or adopting) modern native languages. If the "price" for that is some web standard being stuck, I personally am totally okay with that.

I am sick of this idea that the web browser is almost an OS. It was supposed to serve web pages.

Re: Making WebAssembly a first-class language on the Web

#260

Earlier quoted context omitted.

Problem, as I see it, is that these "native locked down options" are very often just webpages in disguise, which is also webslop imo

The native locked down options are the natives apps you're advocating for, I don't understand. They're the Swift/uikit or Koltin/jetpack apps. It sounds like you don't like web technology in general and would rather everyone do it the centralized Apple/Google way?

Kotlin is not native. And yes, I don't like web technology. That doesn't imply doing it in Company A / B / C way, it implies preference for compiled programs that run natively in their respective environments with full utilization of resources those environments provide, e.g. hardware access, software standards etc.
Post reply on HN