inet256
quickjs-emscripten
Our great sponsors
inet256 | quickjs-emscripten | |
---|---|---|
14 | 21 | |
133 | 1,122 | |
0.0% | - | |
4.6 | 9.4 | |
10 months ago | 15 days ago | |
Go | TypeScript | |
GNU General Public License v3.0 only | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
inet256
-
Show HN: A version control system based on rsync
My approach to hosting with Got has been to make it easy and secure for users to host from any machine.
INET256 solves that problem nicely. If you have access to an INET256 network, then all you have to do is swap addresses and two Got instances can communicate.
https://github.com/inet256/inet256
Also, end-to-end encryption is table stakes. Any data that leaves the user needs to be encrypted in transit, and if it hangs around away from the user, at rest.
-
Ask HN: What Are You Working on This Year?
I'm working on INET256, an API for secure identity based networking. The reference implementation, mesh256 is a mesh network using a distributed routing algorithm. There is also diet256, which is a centrally coordinated network with direct connections using QUIC over The Internet.
https://github.com/inet256/inet256
https://github.com/inet256/diet256
-
SourceHut terms of service updates, cryptocurrency projects to be removed
Thanks for sharing RocketGit. This is the first time I've heard of it, and yes, it does look like a cool copyleft solution to self-hosted Git.
Another interesting option is Brendan Caroll's got[0], which allows sharing of repositories over INET256[1]. I'm sure there are other P2P approaches to Git, but this one just piqued my interest. Unfortunately it has a naming conflict with OpenBSD's Game of Trees[2].
[0] https://github.com/gotvc/got
[1] https://github.com/inet256/inet256
[2] https://gameoftrees.org/
- INET256 is a 256 bit network address space for p2p applications
-
Ask HN: Who Wants to Collaborate?
I'm working on INET256, a 256 bit network address space for easily and securely connecting applications.
https://github.com/inet256/inet256
- The API is focused around sending and receiving messages to addresses derived from public keys.
- Each application can have its own stable address.
- Runs as a daemon process which is configured with peering information. Additional network nodes can be spawned through the API.
- Can easily support arbitrary routing algorithms through a well defined interface.
- A TUN device (similar to CJDNS or Yggdrasil) is included as a separate application. (The IP6 Portal)
https://github.com/inet256/inet256
Developers, applications, and end-users are under-served by the network layer. INET256 provides necessary features (stable addresses, encryption) to client applications, which usually have to reimplement those features themselves.
-
Show HN: Got is like Git, but with an 'o'
There is an interface for address discovery [1] (finding transport addresses for peers you know about) and autopeering [2] (peering with peers you didn't know about beforehand). There is an unfinished branch for LAN broadcast discovery/autopeering. Contributions are definitely welcome here.
I had played around with a STUN transport, but the easiest way to connect has been to stand up a cloud VM with a static IP.
INET256 addresses use the same public key serialization as TLS, but they intentionally avoid the rest of the certificate infrastructure complexity. They make great leaves in a web of trust. You can sign them, or stick them in DNS records. And if you don't want to deal with any of that, fine, just swap addresses and you can communicate securely.
[1] https://github.com/inet256/inet256/blob/master/pkg/discovery...
- INET256: A 256 bit address space for peer-to-peer applications
-
Spork: Peer-to-peer socket magic in the air
> To me, this is the future. I wish we had a set of APIs to allow connecting to a public key instead of an IP address
INET256 is working on exactly that. It's a set of APIs for connecting to addresses derived from public keys.
https://github.com/inet256/inet256
- INET256: A 256 bit address space for peer-to-peer hosts/applications
quickjs-emscripten
-
New QuickJS Release
Based on your comment below I think you figured out the difference - but if you're looking to execute JS, you can pick between ShadowRealm (where available, or using a polyfill) or my library quickjs-emscripten.
Pros of quickjs-emscripten over ShadowRealm:
- You can use quickjs today in any browser with WASM. ShadowRealm isn't available yet, and polyfills have had security issues in the past. See https://www.figma.com/blog/an-update-on-plugin-security/
- In ShadowRealm eval, untrusted code can consume arbitrary CPU cycles. With QuickJS, you can control the CPU time used during an `eval` using an [interrupt handler] that's called periodically during the eval.
- In ShadowRealm eval, untrusted code can allocate arbitrary amounts of memory. With QuickJS, you can control both the [stack size] and the [heap size] available inside the runtime.
- quickjs-emscripten can do interesting things with custom module loaders and facades that allow synchronous code inside the runtime to call async code on the host.
Pros of ShadowRealm over QuickJS:
- ShadowRealm will (presumably?) execute code using your native runtime, probably v8, JavaScriptCore, or SpiderMonkey. Quickjs is orders of magnitude slower than JIT'd javascript performance of v8 etc. It's also slower than v8/JSC's interpreters, although not by a huge amount. See [benchmarks] from 2019.
- You can easily call and pass values to ShadowRealm imported functions. Talking to quickjs-emscripten guest code requires a lot of fiddly and manual object building.
- Overall the quickjs(-emscripten) API is verbose, and requires manual memory management of references to values inside the quickjs runtime.
[interrupt handler]: https://github.com/justjake/quickjs-emscripten/blob/main/doc...
[stack size]: https://github.com/justjake/quickjs-emscripten/blob/main/doc...
[heap size]: https://github.com/justjake/quickjs-emscripten/blob/main/doc...
[benchmarks]: https://bellard.org/quickjs/bench.html
-
Extism Makes WebAssembly Easy
The thing I want to achieve with WebAssembly is still proving a lot harder than I had anticipated.
I want to be able to take strings of untrusted code provided by users and execute them in a safe sandbox.
I have all sorts of things I want this for - think custom templates for a web application, custom workflow automation scripts (Zapier-style), running transformations against JSON data.
When you're dealing with untrusted code you need a really robust sandbox. WebAssembly really should be that sandbox.
I'd like to support Python, JavaScript and maybe other languages too. I want to take a user-provided string of code in one of those languages and execute that in a sandbox with a strict limit on both memory usage and time taken (so I can't be crashed by a "while True" loop). If memory or time limit are exceeded, I want to get an exception which I can catch and return an error message to the user.
I've been exploring options for this for quite a while now. The furthest I've got was running Pyodide inside of Deno: https://til.simonwillison.net/deno/pyodide-sandbox
Surprisingly I've not found a good pattern for running a JavaScript interpreter in a WASM sandbox yet. https://github.com/justjake/quickjs-emscripten looks promising but I've not found the right recipe to call it from server-side Python or Deno yet.
Can Extism help with this? I'm confident I'm not the only person who's looking for a solution here!
-
Node on Web. Use Nodejs freely in your browser with Linux infrastructure.
"Safely execute untrusted Javascript in your Javascript, and execute synchronous code that uses async functions" quickjs-emscripten, NPM
-
Sandboxing JavaScript Code
This maybe, as a start?
https://github.com/justjake/quickjs-emscripten
-
Hacker News top posts: Nov 20, 2022
QuickJS Running in WebAssembly\ (17 comments)
-
QuickJS Running in WebAssembly
The library was inspired by Figma’s blog posts about their plug-in system: https://github.com/justjake/quickjs-emscripten#background
-
Show HN: Run unsafe user generated JavaScript in the browser
If you need to call into user-generated Javascript synchronously or have greater control over the sandbox environment, you can use WebAssembly to run a Javascript interpreter: https://github.com/justjake/quickjs-emscripten#quickjs-emscr...
QuickJS in WebAssembly is much slower than your browser's native Javascript runtime, but possibly faster than async calls using postMessage. As an added bonus, it can make async functions in the host appear to be synchronous inside the sandbox using asyncify: https://emscripten.org/docs/porting/asyncify.html.
-
Why Would Anyone Need JavaScript Generator Functions?
You can use One Weird Trick with generator functions to make your code "generic" over synchronicity. I use this technique to avoid needing to implement both sync and async versions of some functions in my quickjs-emscripten library.
The great part about this technique as a library author is that unlike choosing to use a Promise return type, this technique is invisible in my public API. I can write a function like `export function coolAlgorithm(getData: (request: I) => O | Promise): R | Promise`, and we get automatic performance improvement if the user's function happens to return synchronously, without mystery generator stuff showing up in the function signature.
Helper to make a function that can be either sync or async: https://github.com/justjake/quickjs-emscripten/blob/ff211447...
Uses: https://cs.github.com/justjake/quickjs-emscripten?q=yield*+l...
-
Why Am I Excited About WebAssembly?
This seems like a pretty nice, recently enabled way of getting a sandboxed js environment: QuickJS compiled to WASM: https://github.com/justjake/quickjs-emscripten.
What are some alternatives?
platelet - Dispatch system for emergency volunteer couriers.
wasmtime - A fast and secure runtime for WebAssembly
adama-lang - A headless spreadsheet document container service.
wasmer - 🚀 The leading Wasm Runtime supporting WASIX, WASI and Emscripten
ipdr - 🐋 IPFS-backed Docker Registry
wizer - The WebAssembly Pre-Initializer
OpenBazaar - OpenBazaar 2.0 Server Daemon in Go
rr - Record and Replay Framework
roqr - QR codes that will rock your world
go - The Go programming language
Phaser - Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering. [Moved to: https://github.com/phaserjs/phaser]
iPlug2 - C++ Audio Plug-in Framework for desktop, mobile and web