HackerTrans
トップ新着トレンドコメント過去質問紹介求人

aperturecjs

27 カルマ登録 5 年前
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

投稿

High-performance Go to TypeScript transpiler

github.com
2 ポイント·投稿者 aperturecjs·3 日前·0 コメント

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

github.com
3 ポイント·投稿者 aperturecjs·6 か月前·2 コメント

Goscript: Transpile Go to human-readable TypeScript

github.com
27 ポイント·投稿者 aperturecjs·6 か月前·11 コメント

コメント

aperturecjs
·6 か月前·議論
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 か月前·議論
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 か月前·議論
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 か月前·議論
With SKIFF_CONFIG=intel/desktop,skiff/core you get a Debian desktop running within a Docker container - see https://github.com/skiffos/skiffos