HackerTrans
TopNewTrendsCommentsPastAskShowJobs

aperturecjs

27 karmajoined 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

Submissions

High-performance Go to TypeScript transpiler

github.com
2 points·by aperturecjs·3 วันที่ผ่านมา·0 comments

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

github.com
3 points·by aperturecjs·6 เดือนที่ผ่านมา·2 comments

Goscript: Transpile Go to human-readable TypeScript

github.com
27 points·by aperturecjs·6 เดือนที่ผ่านมา·11 comments

comments

aperturecjs
·6 เดือนที่ผ่านมา·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 เดือนที่ผ่านมา·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 เดือนที่ผ่านมา·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 เดือนที่ผ่านมา·discuss
With SKIFF_CONFIG=intel/desktop,skiff/core you get a Debian desktop running within a Docker container - see https://github.com/skiffos/skiffos