Git Product home page Git Product logo

Comments (4)

 avatar commented on April 28, 2024

the standard golang WASM uses a ton of ram.

I have been using tinyGO that has WAMS support.
https://github.com/aykevl/tinygo/tree/master/src/examples/wasm

Tinygo is amazing... Really should try it.


Also i was thinking that running the golang WASM code inside WebWorkers is a smart way to go, so that the GUI thread is freed up. Anything you built you would want to be that way.
Also its follows the architectural patterns because its pure message passing between the WebWorkers and the main Window and its all asynchronous.
Basic overview here: https://blog.sessionstack.com/how-javascript-works-the-building-blocks-of-web-workers-5-cases-when-you-should-use-them-a547c0757f6a

This would allow people to build HTML GUI apps with shenzen and have all the logic inside the Webworkers doing whatever pipelines are needed. The GUI would be updated based on the results of any computation.

i would consider using a dependency on CommLink also to abstract it a little. But it might be overkill too. Commlink handles the aspects of communication between the Window and the Webworkers.
https://github.com/GoogleChromeLabs/comlink

from shenzhen-go.

DrJosh9000 avatar DrJosh9000 commented on April 28, 2024

For now I'm more concerned that GopherJS might become unusable - e.g. gopherjs/gopherjs#855 means that to rebuild the client one can't be doing things the module way. It's another command that needs to be installed locally, but Go WASM has the benefit of being built into Go.

TinyGo is promising. I think some Go features are in use that TinyGo isn't supporting yet, so we'll see.

from shenzhen-go.

DrJosh9000 avatar DrJosh9000 commented on April 28, 2024

A few days ago I started experimenting in the wasm branch. After many minor code fixes, it compiles and runs up to the point of displaying a graph. Sadly UI interaction is broken after that point; the client crashes inside github.com/johanbrandhorst/protobuf which is still based on GopherJS. From a very quick look, Johan's packages don't look too difficult to port to syscall/js...

from shenzhen-go.

DrJosh9000 avatar DrJosh9000 commented on April 28, 2024

Good thing I didn't keep going down that path, because of course github.com/johanbrandhorst/grpcweb-wasm-example exists already.

from shenzhen-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.