Live data from Hacker News

Maybe you don't need Rust and WASM to speed up your JS

mrale.ph

11–20 of 186 posts

Re: Maybe you don't need Rust and WASM to speed up your JS

#11
I thought all the benchmarks indicated that WASM is still slower than JS. That being said the only performance improvements offered by WASM is if it doesn't for garbage collection for consistence execution.

WASM isn't about performance. It is about writing applications in any language and importing those applications into an island in a web page.

Re: Maybe you don't need Rust and WASM to speed up your JS

#12
post #7
post #6

Earlier quoted context omitted.

What about BuckleScript?

My impression with Scala.js is that it's nice (and maybe the best option going at the moment) but you're still kind of a second-class citizen, which I'm hoping WASM will change. I imagine the experience with BuckleScript would be similar. (Whereas Typescript feels a lot more first-class, but at the cost of having to still be semantically very close to Javascript).

I am looking into TypeScript right now and I think it's just a hard problem to integrate a typed language into a dynamic environment like JavaScript. The transitions between JavaScript and the typed language will always be tricky and error prone.

Re: Maybe you don't need Rust and WASM to speed up your JS

#13
post #9

I wonder if the performance gain is worth the effort. Surely you can always squeeze more performance from JS like from any other language but what's the point if you spend hours to match the performance you get for "free" from other languages? As far as WASM is concerned I'm more excited about the possibility to run any programming language on the web than the raw performance gains. So far it is still year(s) away fr…

[deleted]

Re: Maybe you don't need Rust and WASM to speed up your JS

#14
post #12
post #7

Earlier quoted context omitted.

My impression with Scala.js is that it's nice (and maybe the best option going at the moment) but you're still kind of a second-class citizen, which I'm hoping WASM will change. I imagine the experience with BuckleScript would be similar. (Whereas Typescript feels a lot more first-class, but at the cost of having to still be semantically very close to Javascript).

I am looking into TypeScript right now and I think it's just a hard problem to integrate a typed language into a dynamic environment like JavaScript. The transitions between JavaScript and the typed language will always be tricky and error prone.

Typescript does a better job than most that I've seen.

Re: Maybe you don't need Rust and WASM to speed up your JS

#15
post #9

I wonder if the performance gain is worth the effort. Surely you can always squeeze more performance from JS like from any other language but what's the point if you spend hours to match the performance you get for "free" from other languages? As far as WASM is concerned I'm more excited about the possibility to run any programming language on the web than the raw performance gains. So far it is still year(s) away fr…

It seems to that WASM is more suitable for non-browser work like Node.

Re: Maybe you don't need Rust and WASM to speed up your JS

#16
post #14
post #12

Earlier quoted context omitted.

I am looking into TypeScript right now and I think it's just a hard problem to integrate a typed language into a dynamic environment like JavaScript. The transitions between JavaScript and the typed language will always be tricky and error prone.

Typescript does a better job than most that I've seen.

Agreed. Anders Hejlsberg has repeatedly shown excellent taste in programming languages. See C#, Delphi and Turbo Pascal.

Re: Maybe you don't need Rust and WASM to speed up your JS

#17
post #3

I'm excited about compiling to WASM not for performance but for correctness. Typescript is better than nothing but it really can't compete with the safety and ease you get from a language with a really good type system.

What would you consider to be a "good type system"? I find typescript to have one of the most sane and still strict type systems of all languages that doesn't fall into the extreme functional spectrum or those that care about memory ownership.

Re: Maybe you don't need Rust and WASM to speed up your JS

#18

I thought all the benchmarks indicated that WASM is still slower than JS. That being said the only performance improvements offered by WASM is if it doesn't for garbage collection for consistence execution. WASM isn't about performance. It is about writing applications in any language and importing those applications into an island in a web page.

> WASM isn't about performance. It is about writing applications in any language and importing those applications into an island in a web page.

You don't really need wasm for that, do you? Anything compiles to JS nowadays and you'd actually get easier access to the DOM and GC and support for source maps (are those working for wasm yet?)

Re: Maybe you don't need Rust and WASM to speed up your JS

#19
Maybe there should be a tool from linters or VMs to warn against arguments adaptation, monomorphisation. For the rest it is a lot of know how is JS that is for free in with more performance minded languages. At the end with the optimized JS is is 4 times faster, but still 6 times faster in WASM it seems.

Re: Maybe you don't need Rust and WASM to speed up your JS

#20
post #5

So much work to achieve what should be default behavior :-/ How did we end up in wasting so much time on trivialities?

When JS came out, it was poorly designed, but nobody cared because we used it only to make snowflakes appear on the web page.

Then MS gave us AJAX and 37 signals made it popular, until apps like gmail made it so mainstream it was impossible to go back to old static pages.

But it was too late. The shitty language we had was the only one available everywhere to do dynamic web pages now.

IE would not move, and Firefox and Opera were the underdog, spending their resources on more important things. So nobody tried to implement a better existing language.

When Google faced the challenge of creating chrome, they had to be compatible. So instead of implementing a better language, they also used JS, and injected millions of dollars into making the V8 so it has decent performances.

After that, JS was usable, and so we moved on.

Post reply on HN