5 ms·
The `new Go();` is doing all the JS that you claim to not be doing.
by JasonSage 2y ago
The `new Go();` is doing all the JS that you claim to not be doing.
- andrewfromx 2y agobut all my logic that changes the DOM is in go. What am I missing?
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- Rohansi 2y agoYour logic still needs to run JS code to change the DOM. You are indirectly relying on JS despite using WASM.
- andrewfromx 2y agook but I have all the advantages of go. I can code my go in a modern way and escape JS traps despite the end result is still using js.
- vrighter 2y agoyour code is not manipulating dom. your code is interacting with a library that manipulates the dom. That library has to interface with javascript. You are still doing all dom manipulation via js, it's just hidden behind the library. If you inlined all functions from that library you'd get code that interacts with js. tldr: no, you can't possibly be doing that. Because an api for it literally, objectively does not exist.
- andrewfromx 2y agobut you are missing the bigger picture no? We can, today, stop writing business logic in javascript/typescript for any frontend code. Yes it will call an api that runs via js. But step 1, stop writing any NEW javascript right?
- vrighter 2y agothe wasm-js bridge is quite slow. because wasm is a 2nd class citizen. It's not about which language you write, per se. You wrote those parts in go. Great! Those parts slower because of it, due to this.
- andrewfromx 2y agooh but not noticeably to the user. Network latency is always what the user perceive as the slow part. Here's a complex site done this way: https://linkscopic.com/space https://linkscopic.com/space does it feel slow?