Live data from Hacker News

Rust gets working asmjs and wasm targets

github.com

11–20 of 20 posts

Re: Rust gets working asmjs and wasm targets

#11
post #8

Earlier quoted context omitted.

An outside opinion... The JavaScript world is so fractured, what would you use? Kotlin, Dart, Elm, CoffeeScript, ClojureScript, Nim...? Which ones will keep going?

In my opinion, there are three big problems with coding for the web in a language that compiles to JS: ) The object models from other languages range from somewhat compatible to totally different. Mapping another language to good JS code is a challenge. ) Debugging and profiling become a hassle. Even with proper sourcemaps, you are just much further away from the native JS runtime. *) Libraries. As soon as you want t…

>Webassembly right now is useful for cases where high perf is really needed (games, cpu intensive tasks, ...), but there is no access to the dom.

Just want to point out that asm.js is useful for the same thing. The initial version will be roughly equivalent to asm.js anyway. Just with more consistent optimizations across browsers, faster startup and shorter downloads.

Re: Rust gets working asmjs and wasm targets

#12

Seeing that build randomly breaking on mingw reminds me of the 'fun' I've had dealing with cross platform/compiler development in C++, it will be a great day when I can just do something like 'cargo build' for asmjs/Android/iOS/Windows/OSX/Linux and this brings us one step closer :)

You already can, just `rustup add toolchain ` and `cargo build --target `

Re: Rust gets working asmjs and wasm targets

#13
post #8
post #3

Earlier quoted context omitted.

Honest question. Given the vast amount of languages that compile to JavaScript what's stopping you from moving away from EcmaScript's "madness"?

An outside opinion... The JavaScript world is so fractured, what would you use? Kotlin, Dart, Elm, CoffeeScript, ClojureScript, Nim...? Which ones will keep going?

It’s not as if existing tools disappear once they stop being maintained. Use whatever you like that lets you get the job done. (New CoffeeScript is dying out, for example, but it’s easy to learn if you need to maintain an existing project in it.)

Re: Rust gets working asmjs and wasm targets

#14
post #3
post #2

Please someone figure out how to use Web APIs with Web Assembly so we can finally move away from EcmaScript's madness

Honest question. Given the vast amount of languages that compile to JavaScript what's stopping you from moving away from EcmaScript's "madness"?

By compiling to JavaScript, you're still getting the slow JavaScript loading/parsing/JITting performance and not WASM fast path.

The blocker here is that JavaScript standard browser APIs are not accessible from WASM yet.

By compiling to JavaScript the only thing you gain is developer comfort at the expense of toolchain complexity. And developer comfort is of arguable value.

E.g. I would like to use the browser for UI on my native code projects that require all the CPU resources available (I can't afford the 2x to 10x slowdown from using JavaScript and I need real integers and 32 bit floats with SIMD). Right now my only option would be to write UI in JavaScript and access the native code (in a different processes) through a WebSocket.

Re: Rust gets working asmjs and wasm targets

#15
post #8
post #3

Earlier quoted context omitted.

Honest question. Given the vast amount of languages that compile to JavaScript what's stopping you from moving away from EcmaScript's "madness"?

An outside opinion... The JavaScript world is so fractured, what would you use? Kotlin, Dart, Elm, CoffeeScript, ClojureScript, Nim...? Which ones will keep going?

Nim, because you can also use it as a real programming language for many other uses.

Re: Rust gets working asmjs and wasm targets

#16
post #2

Please someone figure out how to use Web APIs with Web Assembly so we can finally move away from EcmaScript's madness

Compiling everything to ES6 modules and then using some TypeScript (or whatever) to glue it all together sounds pretty reasonable to me.

TypeScript and Dart are decent scripting languages. Even if your "glue code" ends up being tens of thousands of lines it's not a problem. That kind of scale is perfectly doable without too much hair pulling. They were made for this.

That's the big plan anyhow. Everything will compile to ES6 modules. I'm sure there will be also some widget libraries, but you don't really need that kind of thing. Modern scripting languages can handle those scripting tasks just fine.

Re: Rust gets working asmjs and wasm targets

#17

Seeing that build randomly breaking on mingw reminds me of the 'fun' I've had dealing with cross platform/compiler development in C++, it will be a great day when I can just do something like 'cargo build' for asmjs/Android/iOS/Windows/OSX/Linux and this brings us one step closer :)

You already can, just `rustup add toolchain ` and `cargo build --target `

On the current rustup (0.6.3) it seems to be `toolchain install`, not `add toolchain`. Is `add toolchain` a new change with a different syntax?

Re: Rust gets working asmjs and wasm targets

#18
post #15
post #8

Earlier quoted context omitted.

An outside opinion... The JavaScript world is so fractured, what would you use? Kotlin, Dart, Elm, CoffeeScript, ClojureScript, Nim...? Which ones will keep going?

Nim, because you can also use it as a real programming language for many other uses.

Unlike Kotlin or Clojure?

Re: Rust gets working asmjs and wasm targets

#19

Earlier quoted context omitted.

You already can, just `rustup add toolchain ` and `cargo build --target `

On the current rustup (0.6.3) it seems to be `toolchain install`, not `add toolchain`. Is `add toolchain` a new change with a different syntax?

No, my memory just sucks :)

Re: Rust gets working asmjs and wasm targets

#20
post #18
post #15

Earlier quoted context omitted.

Nim, because you can also use it as a real programming language for many other uses.

Unlike Kotlin or Clojure?

Yes. Nim can be used for system libraries, server and client side applications and runs on small microcontrollers.
Post reply on HN