DEV Community

Discussion on: Can we compare Rust with WASM and ReasonML in the frontend future ?

Collapse
 
yawaramin profile image
Yawar Amin

ReasonML targeting JavaScript doesn't really compete for market share with Rust targeting WebAssembly. JavaScript is here to stay, people will need to target it for all kinds of apps, both frontend and backend. ReasonML is imho perfectly suited to this space of pragmatic, type-safe functional programming for targeting JavaScript. At this point I consider TypeScript to be its biggest competitor (there's some evidence for this: see 2018.stateofjs.com/javascript-flav... ).

The primary blocker to WASM for a lot of languages, is garbage collection (or rather WASM's lack thereof). This is what really makes Rust so well-suited to WASM (not any marketing efforts by Mozilla). If you need to target WASM today–the perf cost of JavaScript just isn't feasible–use Rust, no question.

That said, there is some very experimental work to give ReasonML a WASM backend. A lot remains to be done though. Overview here: medium.com/@sanderspies/the-road-t...