There are many environments that don't support WASM yet. Plus, JavaScript is a lot lighter weight for some things - particularly if you just need to register a bunch of callbacks that process data when events come in. I'm using WASM too quite a bit, though! Try out tinygo, gopherjs, or Go's built in wasm/wasi support for that.
HN user
aperturecjs
Open-source focused software engineer working on a app stack for local-first apps with Go and Typescript.
https://cjs.zip https://github.com/paralin https://github.com/aperturerobotics https://github.com/s4wave
Hi all,
This uses a "reactor" mode I added to quickjs recently which exposes quickjs as a wasi library instead of a traditional main() loop. This allows the host environment to call loop_once() to step once through the JS event loop, and poll_io() to check for I/O. This way, if there's nothing available to do (VM is idle), the Go host environment (or js) can sleep until some I/O arrives. This is a lot more efficient than having Js poll for I/O.
Check it out: https://github.com/aperturerobotics/go-quickjs-wasi-reactor
Try this! It works going the other way, just use esbuild to target ES2020 before you run in it. If you want to transpile to Go that's also interesting, probably tsgo's ast parser can be leveraged to do that. See: https://github.com/aperturerobotics/go-quickjs-wasi-reactor
With SKIFF_CONFIG=intel/desktop,skiff/core you get a Debian desktop running within a Docker container - see https://github.com/skiffos/skiffos
I previously wrote a prototype of streaming a JSON tree this way:
https://github.com/rgraphql/rgraphql
But it was too graphql-coupled and didn't really take off, even for my own projects.
But it might be worth revisiting this kind of protocol again someday, it can tag locations within a JSON response and send updates to specific fields (streaming changes).
Hi HN,
protobuf-go is a widely used binary serialization library and IDL for protobuf in Go. The upstream library leverages reflection to provide a wide variety of features which are useful in a server context.
Go is increasingly being used for resource-constrained environments like embedded (tinygo) and WebAssembly. In these environments, reflection is not always available, and when it is, it adds significant weight to the binary size.
vtprotobuf: https://github.com/planetscale/vtprotobuf - compiles static code generation for Protobufs in go, including functions to marshal, unmarshal, size, clone, messages. However, it still requires protobuf-go and the reflection-based code for the message structs.
protobuf-go-lite takes this one step further with a stripped-down version of the protobuf-go code generator modified to work without reflection and merged with vtprotobuf to provide modular features with static code generation for marshal/unmarshal, size, clone, and equal. It bundles a fork of protoc-gen-go-json for JSON support.
It has already been used (experimentally) for a reflection-free version of OpenTelemetry for Go: https://github.com/gburek-fastly/opentelemetry-proto-go/pull... as well as other projects at Aperture Robotics.
Thanks & have a great Friday!
~ Christian Stewart https://cjs.zip
Check out the repo on GitHub as well as the others on the same GitHub organization! Also feel free to join discord and ask questions or shoot me an email. https://aperture.vision
Dynamic configuration of components. It uses a system of communicating controllers which is more flexible in terms of runtime reconfiguration. libp2p is an excellent project and can be integrated into Bifrost's system as a library.
There is a design for routing in the repo (and tor-like circuits). However it is not implemented yet. I'd love to grow the community and have more people collaborating on this.
Bluetooth could work! Just need to implement the Transport interface.
Peer discovery is not implemented at the moment but could easily be added (and will be soon). Here's how: any controller can resolve EstablishLinkWithPeer. A peer discovery controller could compare the list of discovered peers with the list of desired connections and initiate connections via UDP when there's a match.
Signaling is managed by the Link implementation. For UDP we use quic-go.
Hi, author here. Thanks for checking out Bifrost. The short pitch is: any protocol over any transport with seamless cross-platform (browser <-> native) communication.
Building internet applications often involves writing code that is tightly integrated with the choice of communications transport, for example, one has to make the design decision to use either WebSockets or WebRTC, and then all other design decisions are driven by that.
Bifrost aims to allow developing applications without knowing or caring which protocols are used under the hood. The app can just say "Open a stream with peer X" and whatever configured transport(s) make that happen.
I'm still working to improve the docs and new user experience, if you have any suggestions on how I can make it easier to understand, I'd greatly appreciate it!
SkiffOS also supports desktop PCs (with the intel/desktop layer) + EFI with rEFInd / GRUB. Also supports the Steam Deck.