← Back to context

Comment by tristenharr

6 days ago

Happy new year HN! After a few late nights this past week, I've finally got this one over the finish line just in time to kick the year off.

I'm happy to answer any questions that might pop up...

Some things of note:

Built-in P2P Mesh Networking

Listen on "/ip4/0.0.0.0/tcp/8080". Connect to "/ip4/192.168.1.5/tcp/8080". Sync counter on "game-room".

That's all you need for libp2p, QUIC transport, mDNS discovery, GossipSub pub/sub

Full conflict-free replicated data types: - GCounter, PNCounter — distributed counters - ORSet with configurable AddWins/RemoveWins bias - RGA, YATA — sequence CRDTs for collaborative text editing - Vector clocks, dot contexts, delta CRDTs

Wrap any CRDT in Distributed<T> and get: - Automatic journaling to disk (CRC32 checksums, auto-compaction at 1000 entries) - Automatic GossipSub replication to all peers - Unified flow: Local mutation → Journal → Network. Remote update → RAM → Journal. - Survives restarts, offline nodes, network partitions.

Go-Style Concurrency - TaskHandle<T> — spawnable async tasks with abort - Pipe<T> — bounded channels (sender/receiver split) - check_preemption() — cooperative yielding every 10ms for fairness

There's more... but those are my personal favorite features.

I've put a good bit of work into this, so I hope you all can appreciate and maybe find some uses for it here on my favorite place on the interwebs!

These features seem considerably more interesting than the "English to Rust" feature. These data structures and the concurrency stuff seems pretty neat.

Do I really want to yield every 10 ms?

  • You already do, to the kernel. It's probably not much more costly to do so an extra time in userspace.

    • I yield to the kernel to allow other threads that do some kind of background work to run. Do I want my application's async tasks to yield every 10ms? I assume that is what is being meant here.

      2 replies →