sd2k

Joined 12 years ago

Karma
124
Submissions
14
Member since
May 22
meet.hn/city/gb-Sheffield

Socials: - github.com/sd2k

Interests: AI/ML, Remote Work, Open Source, Running, Climbing

---

View on Hacker News

Recent submissions

Comment · 4 months ago
Comment · 8 months ago
Comment · 9 months ago
I'm not super familiar with how pyodide works but I think it uses CPython compiled with Emscripten then needs to be run from a Javascript environment, and uses the browser's (or Node's) Wasm engine.

This uses CPython compiled to WASI and can (in theory) be run from any WASI-compatible Wasm runtime, in this case wasmtime, which has bindings in lots of languages. WASI uses capability based security rather than browser sandboxing and lets the host intercept any syscalls which is pretty cool. Wasmtime also lets you do things like epoch-based interruption, 'gas' for limiting instruction count, memory limits, and a bunch of other things that give you tons of control over the sandbox.

Pyodide/Emscripten might offer something similar but I'm not sure!

Comment · 9 months ago
Good call, yes, I'll get that added soon!
Comment · 9 months ago
Comment · 9 months ago
Hah, that is exactly the same approach I landed on. Fortunately the most common tools either seem to have Rust ports or are fairly easy to port 80% of the functionality! Conch's Wasm file is around ~3.5MB and only has a few tools though so I can see it growing. I think for the places where size really matters (e.g. the web) it should be possible to split it using the component model and `jco` (which I think splits Wasm components into modules along interface boundaries, and could defer loading of unused modules) but I haven't got that far yet.

I did something very similar to you for networking in eryx too (no networking in conch yet); defined an `eryx:net` interface in WIT and reimplemented the `urllib` module using host networking, which most downstream packages (httpx, requests, etc) use far enough down the stack. It's a tradeoff but I think it's pretty much good enough for most use cases like this, and gives the host full control which is great.

Oh full transparency, the vast majority of conch and eryx were written by Opus 4.5. Being backed by wasmtime and the rather strict Rust compiler is definitely a boon here!

Comment · 9 months ago
Comment · 1 year ago
Comment · 1 year ago
Most of the algorithms in augurs were chosen to solve problems we've had at Grafana, which tend to require a solution that doesn't require tweaking too many parameters and deals with higher frequency series than many other time series algorithms are designed to deal with. For example, the DBSCAN clustering algorithm works without having to choose the number of clusters, and MSTL/Prophet work with multiple seasonalities and sub-daily data.

The other criteria is that they needed to be fast and cheap, which ruled out many of the deep learning/neural net based models, although I'd still like to try some foundation models using Burn or some other Rust deep learning framework!

Comment · 1 year ago
Comment · 7 years ago
You may like [ptipython](https://github.com/prompt-toolkit/ptpython/blob/master/READM... python-support) for vim bindings in an ipython(-ish) environment.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton