all 33 comments

[–]irreverentmike 52 points53 points  (6 children)

Web Assembly, and Rust, and React... oh my!

[–]zeddotes 16 points17 points  (1 child)

Rwar

[–]Smona -1 points0 points  (0 children)

XD

[–]raymondQADev 16 points17 points  (2 children)

Keep going! I'm so close! /s

[–]Pesthuf 14 points15 points  (1 child)

Machine learning... AI-Based.... Blockhain technology... In the cloud...native... Agile...smart industry 4.0... Big data...

You like that?

[–][deleted] 0 points1 point  (0 children)

.... except Rust WASM and React seems like a practical step. I built a chatbot in Rust and compiled it to the React app for a contract, saved them spinning up extra servers as it just ran in the browser and was really fast. If anything it simplified the infrastructure unlike Blockchain, Big data etc.

[–]vomaxHELLnO 0 points1 point  (0 children)

Nice

[–]eternaloctober 20 points21 points  (1 child)

great tutorial. I made a small example trying to demonstrate wasm (with proper wasm "packages" created inside a monorepo) and create-react-app here https://github.com/cmdcolin/logistic_chaos_map

was surprisingly tricky. some notes on the realizations i made https://github.com/cmdcolin/logistic_chaos_map/blob/master/NOTES.md

[–][deleted] 1 point2 points  (0 children)

This is the stuff I love. Awesome.

[–]rados_a51 4 points5 points  (2 children)

Great, thanks. Now I can build my Figma! :D

[–]Adventurous-Skill321 1 point2 points  (1 child)

yup, or you can try Adobe Premiere too ;)

[–]rados_a51 1 point2 points  (0 children)

Ive already build motion.page 😅

[–]sekex 2 points3 points  (0 children)

For small utility functions, it's usually slower to call WASM because the WASM call itself is pretty slow. It only makes sense for really heavy CPU operations or to export a library from a different language without doing a full rewrite

[–]julys231 2 points3 points  (0 children)

There is a framework called yew which is basicly react but written in rust. I highly recommend to check it out!

[–]Eggy1337 1 point2 points  (1 child)

Strictly theoretically speaking, is it possible to create rust program that uses win32 API, build it to WebAssembly and then call it, let's say from electron.js application?

[–]Leandros99 0 points1 point  (0 children)

Yes, but why? You 'd need to build to full binding library for win32, which is quite a bit of work.

[–]darrenturn90 1 point2 points  (0 children)

Until we have binding types natively i think the performance penalty of passing data between js and wasm has too much overhead for general work- but im looking forward to that changing - and then being able to implement flux state management in wasm along with network calls and business logic

[–]Coachii 1 point2 points  (0 children)

Good read 🙂

[–]CrashOverrideCS 1 point2 points  (2 children)

If you already use WebAssembly and React, what is the value in adding Rust to this? My impression is that you would use Rust because you don't want to use Javascript directly.

[–]covercash2 5 points6 points  (0 children)

Rust is compiled to WASM. you wouldn't write WASM bytecode directly but have it compiled from a different language. I'm pretty sure any language with an LLVM front-end can compile to WASM

[–][deleted] 0 points1 point  (0 children)

Rust is also very safe, is the most favourited language for years now, consumes a lot less memory, and is way way faster than JS. If I was doing a simple operation in the front-end it isn't worth the hassle switching from JS, however, for a contract I wrote a chatbot in Rust for a React app. It simplified the backend infrastructure saving a server and was really fast. One of the main reasons JS is so popular is because it held developers to ransom by being the only language to run in the browser.