Live data from Hacker News

Compiling to WebAssembly: It’s Happening

hacks.mozilla.org

181–190 of 225 posts

Re: Compiling to WebAssembly: It’s Happening

#181

Web browsers are turning into giant, poorly designed operating systems. My current operating system can already run binaries, this is reinventing the wheel in a massively over engineered way.

Your current (desktop) operating system allows these binaries to run with your full user privileges. Any software you download and run has complete access to all of the data from your user account, no matter which software created it. Software can interfere with other software (spyware), can affect anything on the account (malware), and can even harm the system itself (e.g., by consuming resources). Worst of all, bec…

> Your current (desktop) operating system allows these binaries to run with your full user privileges.

Actually it can sandbox them already.

Re: Compiling to WebAssembly: It’s Happening

#182
post #95

Earlier quoted context omitted.

If type safety is what you miss, why not to use some transpiler like TypeScript? http://www.typescriptlang.org/Tutorial

Then you're not writing JavaScript, which was OP's concern. TypeScript is fine (although Elm, Swift, and Haskell are more interesting, IMO).

TypeScript is very close to normal JavaScript. It's basically just JavaScript + type annotations which a compiler can check.

Compilation phase removes the annotations, after that point it is pure JavaScript.

How are Swift and Haskell relevant for client side web development?

Edit: Removed Elm

Re: Compiling to WebAssembly: It’s Happening

#183

Earlier quoted context omitted.

We will eventually come to terms with the fact that Flash was 15 years ahead of everything else on multiple fronts and we ought to have been just chastised the terrible developers doing awful and horrendous things with pretty technically sound software.

How would that have fixed Flash’s horrible CPU cost, chronic security vulnerabilities, awful touch support, or constant prone to crashing, even in the hands of competent developers?

Like HTML5 is better at any of those? I'm pretty sure Flash crashed an order of magnitude less often than WebGL does.

Re: Compiling to WebAssembly: It’s Happening

#184

Earlier quoted context omitted.

And I don't understand why. Take the two most popular mobile platforms, iOS and Android: people there routinely download and install new applications and typically never interact with Facebook, Twitter, Gmail or Instagram via their browsers. Why should the situation be different on the desktop? I feel that the efforts should not be going into making the browser into an OS that can run general-purpose software, but ra…

> Why should the situation be different on the desktop? I feel that the efforts should not be going into making the browser into an OS that can run general-purpose software, but rather getting a packaging system that is cross-platform and easy for users to use. Cross platform is a red herring. The iOS and Android app stores are not cross platform. Ease of use is also increasingly a red herring. The Windows and Mac ap…

It's like the old "How do you get an untested drug on the market? Pretend it's a dietary supplement". How do you get corporates and users to install a remote application runtime that lets them run programs from the internet? Pretend it's a document viewer.

Re: Compiling to WebAssembly: It’s Happening

#185
post #105

Earlier quoted context omitted.

It's not a bad language, but it's not good either. But who is it powerfull? It's a very poor man's scheme, and scheme is not powerfull either. If javascript has anything to over it's IMO simplity and not power. But I'll never understand who thought this asynchronous API was a good idea. I just wanted to draw pictures in a canvas _in order_, because they should overlap. A common task you could mean. I ended up buildin…

> scheme is not powerfull either In what sense is Scheme not powerful? It has TCO, syntax-rules, call/cc, etc. Of course, all of those are things scheme has that JavaScript doesn't.

No types, a very minimal syntax, a standard library so slim that everything interesting is a implementation-detail. And, as I a said, javascript has less. Javascript even lacks integer variables, while scheme has the numeric tower. (Although that is not required by rsr4/rsr5 and that what most implementations care about)

Re: Compiling to WebAssembly: It’s Happening

#186
post #153

Earlier quoted context omitted.

For all the problems Flash had, one problem it didn't have was a lack of mature tooling (compared to its alternatives at any given point in time). A lack of tooling makes making HTML 5 games very difficult, the abstraction layers that existed for Flash don't for HTML 5, at least not to the same level. Even if HTML 5 were capable of precisely the same level of performance, or better, as Flash today it would still be s…

I'm glad you pointed this out. My roommate's career was a flash developer and his primary skills were animation and graphic design. He spent hours doing that and got me to help out with the few numerical/mathematical tasks he needed to fill-in. I was a dork and overacted to his use of 100% global variables, etc. He gracefully tried to use Flash's OO to appease me and improve himself, but really he got quite far in li…

I place very strong bets that Adobe will create a dominant tool here. It will be nearly identical to flash but emit all the new fangled html5 asm.js stuff instead - in some nice tight drop-in way ... like

  

Where ad.be is a "cloud" service you pay $xx/month to "host" your "app" for you. Essentially you make the thing, it saves to the cloud, generates your uniqid, and you put it in a container. They keep the source file and can continually regenerate the js as their "engine" improves and browser tech moves forward. It's a future-proof plugin-less flash with a large existing user and customer base.

If that's the flow, Adobe might as well just start minting money.

Re: Compiling to WebAssembly: It’s Happening

#187

Web browsers are turning into giant, poorly designed operating systems. My current operating system can already run binaries, this is reinventing the wheel in a massively over engineered way.

Your current (desktop) operating system allows these binaries to run with your full user privileges. Any software you download and run has complete access to all of the data from your user account, no matter which software created it. Software can interfere with other software (spyware), can affect anything on the account (malware), and can even harm the system itself (e.g., by consuming resources). Worst of all, bec…

The process model is a sandbox. Every process runs as if alone, with seemingly continuous processor time and memory addresses starting at zero. The ailments you described are all system calls, special access granted by the kernel.

So the process model is not fundamentally different than the browser model, but WebAssembly enjoys two advantages:

1. The browser security model sagely segmented privileges by origin rather than user.

2. Like bytecode, WebAssembly AST does not target a specific processor.

Re: Compiling to WebAssembly: It’s Happening

#188

Earlier quoted context omitted.

HTML5 _still_ isn't able to deliver the quality interactive experiences (Games) without applying a lot more effort. Even "simple" things like cross-browser low-latency sound effects are still difficult. Flash presents a single platform with a single vendor that can innovate as quickly as they like. The web platform is inevitably cumbersome and slow in comparison -- over a decade later they're still playing catch-up.…

As a strong supporter of open source, doing a comparative analysis of HTML5 and Flash, I have to admit that private enterprise was able to kick the ball forward so much faster here ... I remember watching a vector animation version of a "tell-tale heart" in flash in 1998. On a 28.8 connection it played smoothly full-screen on a 120mhz pentium with 16mb of ram. I remember clicking the play button and having it just mi…

If you want to go fast, you go alone. If you want to go far, you go together.

Re: Compiling to WebAssembly: It’s Happening

#189

Earlier quoted context omitted.

Then you're not writing JavaScript, which was OP's concern. TypeScript is fine (although Elm, Swift, and Haskell are more interesting, IMO).

TypeScript is very close to normal JavaScript. It's basically just JavaScript + type annotations which a compiler can check. Compilation phase removes the annotations, after that point it is pure JavaScript. How are Swift and Haskell relevant for client side web development? Edit: Removed Elm

Elm's only target is the browser/JS.

Re: Compiling to WebAssembly: It’s Happening

#190
post #154

Web browsers are turning into giant, poorly designed operating systems. My current operating system can already run binaries, this is reinventing the wheel in a massively over engineered way.

We should have had a standard like WebAssembly from the beginning. The lack of it is the reason for the outrageous explosion of features in web browsers. At first html made sense: it was ideal for quick transfer and rendering of documents. But today that's not enough. So we keep tacking on layers atop already fat abstractions. And all this fat is trying to support a moving target. At first it was about rendering text…

There was. It's Java. I remember when it was first released and it promised the ability to "write once, run anywhere" but delivered via the Web to run as web applets.

And before that in the 80s, there was UCSD Pascal. I know it was available for the Apple ][ (used it in high school) and the IBM PC (one of three operating systems available when IBM launched the IBM PC in August of 1981) and probably a few other platforms I'm blanking on. A defined VM and "executables" could run on any platform running UCSD Pascal.

And even before that, IBM pioneered VMs for their own hardware, which is probably what inspired UCSD Pascal in the first place.

Post reply on HN