Live data from Hacker News

Moving from TypeScript to Rust / WebAssembly

nicolodavis.com

1–10 of 428 posts

Re: Moving from TypeScript to Rust / WebAssembly

#2
I don’t know Rust and haven’t done JavaScript for years but isn’t JavaScript a bit more of a higher level language, which would make a developer more productive?

Rust being closer to the hardware should require more code, and effort, to accomplish the same task.

Re: Moving from TypeScript to Rust / WebAssembly

#3
post #2

I don’t know Rust and haven’t done JavaScript for years but isn’t JavaScript a bit more of a higher level language, which would make a developer more productive? Rust being closer to the hardware should require more code, and effort, to accomplish the same task.

JavaScript's a sloppier language.

Re: Moving from TypeScript to Rust / WebAssembly

#4
post #2

I don’t know Rust and haven’t done JavaScript for years but isn’t JavaScript a bit more of a higher level language, which would make a developer more productive? Rust being closer to the hardware should require more code, and effort, to accomplish the same task.

Depends on what you're optimizing for. If you want memory efficiency and near-native speeds, then you need WebAssembly. And Rust is a fantastic source language to compile to WebAssembly because of its memory safety.

Re: Moving from TypeScript to Rust / WebAssembly

#5
post #2

I don’t know Rust and haven’t done JavaScript for years but isn’t JavaScript a bit more of a higher level language, which would make a developer more productive? Rust being closer to the hardware should require more code, and effort, to accomplish the same task.

Depends on what you're optimizing for. If you want memory efficiency and near-native speeds, then you need WebAssembly. And Rust is a fantastic source language to compile to WebAssembly because of its memory safety.

Mind explaining a bit more here why Rust is a particularly good language to compile to wasm? Why does memory safety help here?

Asking out of ignorance!

Re: Moving from TypeScript to Rust / WebAssembly

#6
post #2

I don’t know Rust and haven’t done JavaScript for years but isn’t JavaScript a bit more of a higher level language, which would make a developer more productive? Rust being closer to the hardware should require more code, and effort, to accomplish the same task.

It’s not that bad once you get used to it.

Re: Moving from TypeScript to Rust / WebAssembly

#8
post #2

I don’t know Rust and haven’t done JavaScript for years but isn’t JavaScript a bit more of a higher level language, which would make a developer more productive? Rust being closer to the hardware should require more code, and effort, to accomplish the same task.

Rust actually can be a higher language. It has true generics, static algebraic data types, functional programming features, and so on, even as it is closer to the metal. It is closer to Haskell or OCaml, but more pragmatic.

Re: Moving from TypeScript to Rust / WebAssembly

#9
post #5

Earlier quoted context omitted.

Depends on what you're optimizing for. If you want memory efficiency and near-native speeds, then you need WebAssembly. And Rust is a fantastic source language to compile to WebAssembly because of its memory safety.

Mind explaining a bit more here why Rust is a particularly good language to compile to wasm? Why does memory safety help here? Asking out of ignorance!

Mostly because WebAssembly does not include GC yet, so being a non-GC language helps.

Re: Moving from TypeScript to Rust / WebAssembly

#10
post #5

Earlier quoted context omitted.

Depends on what you're optimizing for. If you want memory efficiency and near-native speeds, then you need WebAssembly. And Rust is a fantastic source language to compile to WebAssembly because of its memory safety.

Mind explaining a bit more here why Rust is a particularly good language to compile to wasm? Why does memory safety help here? Asking out of ignorance!

From what I understand, this mainly means that a lot of work has been put into making this process possible, while for some other languages the workflow to wasm is lacking.
Post reply on HN