HackerTrans
TopNewTrendsCommentsPastAskShowJobs

aperturecjs

27 karmajoined 5 lat temu
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

Submissions

High-performance Go to TypeScript transpiler

github.com
2 points·by aperturecjs·3 dni temu·0 comments

JavaScript virtual machine with QuickJS running in WASM under Go/JS

github.com
3 points·by aperturecjs·6 miesięcy temu·2 comments

Goscript: Transpile Go to human-readable TypeScript

github.com
27 points·by aperturecjs·6 miesięcy temu·11 comments

comments

aperturecjs
·6 miesięcy temu·discuss
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.
aperturecjs
·6 miesięcy temu·discuss
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
aperturecjs
·6 miesięcy temu·discuss
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
aperturecjs
·11 miesięcy temu·discuss
With SKIFF_CONFIG=intel/desktop,skiff/core you get a Debian desktop running within a Docker container - see https://github.com/skiffos/skiffos
aperturecjs
·w zeszłym roku·discuss
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).