Running Go code inside a NodeJS app with WASM (Part 1/2, 2023)

This page summarizes the projects mentioned and recommended in the original post on dev.to

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • wasmer-go

    🐹🕸️ WebAssembly runtime for Go

    However, there are other, more fleshed-out, libraries like wasmer-go that provides a runtime and help us navigate around these limitations. The wasmer-go documentation provides a good summary of these challenges:

  • CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  • wasi-libc

    WASI libc implementation for WebAssembly

    Communication between the WASM module and the rest of the application needs to be done in very simple types (bytes, ints and floats). No complex types are supported yet. This is why most WASM compilers also provide some glue-code to map between complex types like strings or arrays. The Web Assembly System Interface (WAS) is an on-progress standard aimed to solve this last limitation; once it's mature it will allow easy interoperation with almost every environment. WASI is already available in some WSAM compilers and runtimes.

  • TinyGo

    Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.

    Then, it is important to point out that our example only works in NodeJS. The compiled WASM module cannot be used in other WASM-enabled environments. Regardless, we can take the same code and use tools like wasmer-go or tinygo and this limitation can be worked around.

  • readable-stream

    Node-core streams for userland

    First, we create a NodeJS ReadStream using fs.createWriteStream to open the test.log file in "append" mode. Then we start recursively looping using setTimeout. This simulates an application that logs text in the file at a variable rate. At each iteration:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Time-series data ingestion from Rust WebAssembly application, leveraging GreptimeDB and WasmEdge

    2 projects | dev.to | 22 Dec 2023
  • Node on Web. Use Nodejs freely in your browser with Linux infrastructure.

    8 projects | /r/node | 3 Jul 2023
  • WebAssembly System Interface (WASI) with sockets for Go

    3 projects | /r/golang | 30 May 2023
  • [AskJS] Has anybody implemented and compiled ServiceWorker specification to a standalone executable?

    19 projects | /r/javascript | 4 Mar 2023
  • Show HN: I built a WASI playground for running CLI binaries in the browser

    11 projects | news.ycombinator.com | 9 Oct 2022

Did you konow that Go is
the 4th most popular programming language
based on number of metions?