HNHacker News
TopNewBestAskShowJobs

toomim

3,057 karma · joined May 5, 2012

Independent Scientist in Computer Science and Psychology

https://invisible.college/@toomim

https://braid.org

submissionscomments
toomim··on SCCS roach motel
The SCCS "weave" data structure is indeed poorly-understood; and what almost nobody knows is that it's equivalent to a text CRDT!

https://braid.org/meeting-60/sccs-is-a-time-collapse

toomim··on A16Z 2025 Big Ideas for Crypto
I'm building a liquid democracy. The cool thing is that we won't bother applying it to "democracy" first — the killer app will actually be to computer your news feed, in a way that you control through your social network, rather than an AI.

Here's a prototype of it: https://peeryview.org. Check out the /about page. It's like Reddit or HN, but instead if having a single "moderator" with monopoly power over a set of "voters" with one vote each; you weight everyone's vote for your unique feed. And they weight a second layer of people's votes, etc.

We call this network a Web-of-Opinions, or a WoO. The Woo is subjective. It's soft. It's social. It determines your attention (in the news feed).

As it grows, it creates a new game-resistant reputation system, aka a "Liquid Democracy", that can be used for many things: like a Proof of Personhood, or an actual Democracy.

We just announced a protocol draft last week at https://braid.org/meeting-99. If you're interested, please give feedback here, in the braid group, or write me directly at toomim@gmail. This is the time!

toomim··on Structured Editing and Incremental Parsing
It's really fun seeing my old research groups mentioned decades later. Thanks for writing this up.
toomim··on HPV vaccination: How the world can eliminate cervical cancer
Go find a doctor who will prescribe it off-label.

I was in a similar situation to you. The doctor said it wasn't indicated for me, but I said I wanted it anyway, and the doctor said ok, and it cleared up my existing HPV infections after dose #2.

toomim··on HPV vaccination: How the world can eliminate cervical cancer
I don't think it's been tested in studies, but I can offer that I had hand warts for 7 years until I got the HPV vaccine, and the hand warts suddenly disappeared after dose 2.

HPV functions by cloaking itself from your immune system. The reason why treatments like freezing work is not by removing the HPV -- it's by stimulating your immune system to look at the area around the wart. Then your immune system can get past the cloaking, and recognize the HPV, and then it destroys it.

So functionally, it makes total sense that the HPV vaccine would clear existing infections, and anecdotally, lots of patients (such as myself) have seen HPV clear after getting the vaccine. It's a shame that our bureaucracy doesn't have the incentives to run the studies to acknowledge it institutionally.

toomim··on RTP: One protocol to rule them all?
That's an awesome user test! Upvoted.
toomim··on JSON Patch
Yeah, it sucks. It was borrowed from XPath. And it's not appropriate for JSON.

https://en.wikipedia.org/wiki/XPath

toomim··on JSON Patch
JSON Patch doesn't let you represent insertions or deletions to strings. You can only replace them. This makes it useless for collaborative text editing. Thus, we can't use it in Braid-HTTP: https://datatracker.ietf.org/doc/html/draft-toomim-httpbis-b...
toomim··on Faster CRDTs (2021)
It stores the deleted ranges, but not the chars of text that compose those ranges.

So from a privacy perspective, you see the metadata of edit history (the DAG of character positions edited), but are blind to the text.

toomim··on Ask HN: Do we need to pay billions in fees to Stripe, Block, PayPal and Visa/MC?
Try Bitcoin Cash. It's Bitcoin as it was intended. Transactions are practically free, and zero-conf hasn't been crippled by RBF!
toomim··on Magic Wormhole: get things from one computer to another, safely
How does this relate to https://wormhole.app/ ?
toomim··on Gangs in the Los Angeles County Sheriff's Department
Quite a biased Wikipedia article. If you read the sources, you can read quotes from the officers themselves, who openly discuss their tattoos, but say they are being misinterpreted as rogue law enforcement groups when they are just particular stations bonding together and displaying their pride.

> [the officer] bristled at the idea of calling the groups “deputy gangs” ... state penal code uses the term “gangs” to describe rogue law enforcement groups. Repeatedly, Murakami insisted that the tattoos symbolize hard work and “station pride” and that there was “no nefarious connotation” to having deputy subgroups operate inside the department.

Obviously law enforcement isn't perfect, but we should show both sides of the issue, and this wikipedia article is selecting only one side from already-biased articles.

The result is to dilute the term "gang." We have actual gangs to deal with, like MS13, which literally worships satan and seeks out and kills babies when "the beast" demands it. E.g. https://www.nzherald.co.nz/world/ms-13-gang-members-accused-...

That's a far cry from sherrifs with tattoos.

toomim··on Resilient Sync for Local First
...and they existed long before 2010, too. 1975 called, and said to check out the SCCS "Weave" data structure: https://en.wikipedia.org/wiki/Interleaved_deltas

Weaves are the same thing as modern text CRDTs!

toomim··on Japan enacts law to promote competition in smartphone app stores
So would Apple have to allow browsers other than Safari to exist on iOS?
toomim··on Braid: Synchronization for HTTP
Yes, when I wrote that stateb.us/what page, my intent was to express the aspirational vision of statebus. It soon became clear that, in order for the vision to succeed, we needed the network protocol to become a widely-used standard. Thus began my Braid work.

I started approaching the IETF to learn how to standardize State Synchronization in HTTP. I ran across this HN comment by JosephG [1] making a call to the same mission. I sent him an email, we decided to team up, and we went to dwebcamp in California and then IETF in Montreal together, and made a presentation to the HTTPWG proposing to extend HTTP into a state sync protocol. We got an enthusiastic reception, and I have been working on it ever since.

The HTTP extension is getting into pretty good shape, and we're now manifesting the promises on that /what page. They aren't all production-ready (e.g. no blockchains built on statebus/braid yet), but they are coming true at a steady clip!

[1] https://news.ycombinator.com/item?id=19816648

toomim··on Braid: Synchronization for HTTP
> But it's also the case that the purposes of Braid don't lend themselves to large binary blobs.

That's not true. We want to use Braid to distribute OS updates, sending patches to multi-GB binary blobs; and for filesystem synchronization (think Dropbox/SyncThing/Resilio) with large binary files.

Braiders have put an impressive amount of work into compressing data: https://josephg.com/blog/crdts-go-brrr/. Data compression is critical, because these mutation histories can grow very large. There would be very strong resistance to a 33% overhead without a good reason.

> whether you emit an update over SSE or a HTTP subscription doesn't change that. Both are literally just TCP connections.

You're failing to consider a P2P mesh network. TCP only connects two computers. Braid enables a P2P mesh network where any peer can come and go, work offline, or switch connections, and nonetheless the whole network must synchronize with strong eventual consistency. Think distributed. Watch the distributed network partition, repartition, and reconfigure in https://braid.org/antimatter#viz. This won't make sense until you flip your mindset to distributed.

> You can package that data not as in the shape of a HTTP response.

Then we wouldn't be using HTTP. We wouldn't be able to re-use HTTP parsers and generators. We would lose a huge amount of interoperability with existing code.

It's confusing that you're arguing against using HTTP in order to use SSE -- while insinuating that using SSE means using HTTP. SSE is built on, but is not itself HTTP. It wasn't even standardized in the IETF HTTPWG. It's a way to tunnel a specific, limited, use-case of centralized, text-only, server-to-client-only event streaming over a HTTP response, without bothering to specify anything about how those events might change actual HTTP resource state. It's time to do better, and to bake that into HTTP more generally. We are making something way more powerful than SSE.

As for the rest of your comment, I am trying, but cannot understand what you are trying to say. Perhaps you could rephrase it.

toomim··on API Shouldn't Redirect HTTP to HTTPS
Ah... you know, that idea sounds not too shtty to me.
toomim··on Braid: Synchronization for HTTP
Yes, the big secret here is that CRDTs + Braid will enable a higher level of abstraction for programmers: an Abstraction of Distributed State.

As a programmer, you'll no longer have to write any networking code. You won't be touching HTTP headers and methods. That will all be handled by libraries for you, which will let you read and write any state, anywhere on the network, as if it's a local variable on your own computer—already downloaded, and always up-to-date.

The CRDT handles network delays, and race conditions, under multiple writers, so that everything merges automatically, and you don't have to think about them.

The Braid Protocol ensures that all servers, everywhere on the network, speak "state sync" in a standard way, even if they have different implementations behind the scenes, even with different algorithms.

This means that our libraries will be able to detect which algorithms need to be employed to synchronize with any service you are connecting to, and implement all that for you. You, as the application programmer, will just read and write variables like:

    state['https://foo.com/news-feed'].push({
       author: 'me',
       post: 'hey guys!!!',
       inreplyto: state['https://bar.net/post/2423h'].id
    })
The reason why HTTP gets abused today is that it doesn't provide full synchronization support, which means that programmers have to abuse it in order to actually write web apps, which becomes a pain in the ass, and then everything feels a lot easier when you drop down into a WebSocket and get rid of the cruft. But now you're writing a custom WebSocket protocol, that only you will fully understand...

...unless you document it, and try to follow a standard like AsyncAPI, which gets you part of the way there...

...but what you really need is a State Synchronization protocol, and libraries that abstract away all the networking for you, and guarantee interoperability, creating a system of shared state. We're getting closer to this glorious world. The magical statebus in the sky that connects all our state together. When the abstraction is complete, it's going to blow everything else away.

We don't need Web Browsers to implement this natively -- that'll just be a performance improvement, like when JSON.stringify() and parse() became native in browsers. The important part is defining a standard that allows us to invest in robust State Sync algorithms and libraries, and lets developers invest in the applications that share this beautifully interoperable state, and make this new abstraction succeed across the globe.

toomim··on Braid: Synchronization for HTTP
I'm not convinced on 209, either. There might be a better response code. See the discussion at https://github.com/braid-org/braid-spec/issues/16

Braid is not trying to be "application logic" or "transport protocol" -- it is a State Synchronization Protocol. If you can think of a more elegant method to support all of state synchronization within SSE, we're all ears!

But AFAICS you end up having to embed base64-encoded HTTP responses within SSE events within HTTP responses, which is gross pile of russian dolls, where both the innermost and outermost dolls are the same type of doll -- an HTTP response! So why all the intermediate dolls?

It's more elegant and simpler to extend HTTP at the root level, and say: "Instead of returning 1 HTTP response, a Braid server can return N HTTP responses, concatenated together with optional newline separators."

toomim··on Braid: Synchronization for HTTP
Base64 encoding hurts performance, adding about 33% overhead. It's more efficient to send binary over HTTP directly.

> SSE frames or subscription events ... arrive in the order the server sent them by virtue of being sent over TCP.

We support situations more complex than that. Multiple clients can make simultaneous edits with multiple PUTs. They can arrive in different orders to a server that relays them to other clients. Each peer in the system needs to know which versions the edits were parented from, so they can reconstruct the version DAG and merge consistently.

> The headers don't need to be a part of the protocol.

Yes, they do. Not only headers, but also status lines, and bodies. We are streaming entire HTTP responses. A HTTP response consists of a status line, headers, and a body. We need all of these. For instance, if a resource is deleted, we need to send a new 404 status line in the update. If the version changes, we need to update the Version: header. These need to be a part of the protocol so that all peers can update themselves in the same way, otherwise you don't get consistency.

toomim··on Braid: Synchronization for HTTP
Perhaps you mean multipart/braid? There is no mixed/* mime-type prefix that I know of.

How would your suggestion work? Can you give an example HTTP response to explain what it would look like?

The purpose of standards is interoperability. What software would this mixed/braid or multipart/braid mime-type help us be interoperable with?

toomim··on Braid: Synchronization for HTTP
Yes! Phoenix Liveview is very similar to the Statebus project (https://stateb.us) that inspired Braid. Braid was the protocol that Statebus needed, and Phoneix Liveview is one of the most exciting projects in the Statebus space that I know!

I think we are working from a common inspiration!

toomim··on Braid: Synchronization for HTTP
Cool! We have been building feeds on braid, too! It would be very interesting to support FeedAPI with Braid -- you would get much faster pushed updates than you currently do with client-pulled updates!

See our current work on the "feed" spec in Braidmail: https://braid.org/apps/braidmail/spec2.

To support event-sourcing, you could replace those {link: ...} objects with event objects, and just treat each event as data. Then you'd have a url like /event-stream that peers would subscribe to.

Or, you could go deeper, and come up with a custom `Patch-Type:` for your events, which could make your events first-class HTTP citizens that could also be applied to a server using the PATCH method. Then your url might be /system-state, and represent the state for the whole system.

Braid supports such custom events, but be aware that this model is limited in a few ways:

- It's less interoperable, because all peers must know and implement the custom event types (aka patch-type) in order to read or write state.

- You don't get to re-use the beautiful and complicated merge algorithms that support eventual consistency with multiple writers (the OT/CRDT algorithms).

- It doesn't allow summarization of history. It's hard to prune history when each peer needs to know all events in order to do anything.

You might also be interested in PREP, which is a pure event-update protocol being worked on by my colleague Rahul Gupta: https://github.com/CxRes/prep We're trying to merge our work together, if we can.

You might also be interested in our deliberation on the pros/cons of "events" vs. "state updates" here: https://github.com/braid-org/braid-spec/issues/102#issuecomm...

toomim··on Braid-Text: Text Synchronization Libraries over Braid-HTTP
We're actually "releasing" this new Braid-Text library today in 8 hours at Braid Meeting 86!

https://braid.org/meeting-86

The meeting is open. You're all welcome to join. :)

toomim··on Braid: Synchronization for HTTP
Ah, I've found the discussion on status code 209 here: https://github.com/braid-org/braid-spec/issues/16

Hope that helps.

toomim··on Braid: Synchronization for HTTP
It's possible that Braid could switch back to status code 200. I expect this choice to be revised in discussion within the IETF HTTP WG, but we haven't gotten to this level of detail yet. If I remember correctly, the switch to 209 in the current draft was to discourage middleboxes from caching braid responses, but it's possible that "Cache-Control: no-cache" does enough of this and that 209 is not necessary. I'll keep an eye out. Thanks for the thought.

As for text/event-stream -- braid responses are not text (they can contain binary updates to things like images) and they are not an "event" stream. Braid provides an "update" stream, as a stream of HTTP responses. Each response can specify an update using a status code, headers, and a body.

If we were to use SSE, we would be encoding an HTTP response, within a base64-encoding (to fit as text), within a sequence of `data: ` lines, in an "event", within an event stream, within a text/event-stream content-type, within an HTTP response. It's a lot simpler to just extend HTTP to say "instead of one response, a server can provide N responses" than to go through all this rigamorale to encode responses within an event stream within a response.

As for events vs. updates, an update may or may not describe the raw underlying events. Updates can also be summaries of many events. For instance, a normal HTTP response body provides a snapshot that summarizes all of the edits up to that point that created the resource. This is an update, but is not the raw sequence of events.

toomim··on Braid: Synchronization for HTTP
You can use any CRDT with Braid. Many of them prune history. In fact, we have developed the first pruning p2p text sync algorithm: braid.org/antimatter

Indeed, text sync requires old history to merge with old edits. However, Braid does not force you to hold everything. Peers can implement their own policies for deciding who to sync with. They can also ask each other for modules of old history they've forgotten if they realize they need it to merge something. This is made possible with the new Time Machine architecture that we are writing up.

This architecture also allows you to sync at multiple time resolutions -- realtime, fine grained, or slower, course grained -- within the same system. Different peers can hold and share at different resolutions. And they can all guarantee consistency with each other in the end. See the recent simpleton algorithm work for an example.

toomim··on Braid: Synchronization for HTTP
See this comment on SSE: https://news.ycombinator.com/item?id=40482389

PATCH is supported in Braid, but only works for client->server. It does not support updates from server->client. So we need a way to express general updates, in both directions. Braid lets you use existing PATCH specs (as Patch-Type) if you want.

The PATCH specification also confounds multiple concerns (versioning, conflicts, validation, data formatting, applicable data types) into a single spec. It's nicer for these aspects to be modular and independent. Partial PUT happens to be already a modular, independent way to specify just the patch format, and can be extended to new data types by "Range Units." But use PATCH if you prefer!

toomim··on Braid: Synchronization for HTTP
Yes, like for images. You can't send image updates over SSE.
toomim··on Braid: Synchronization for HTTP
In some sense, you could!

The reason is that almost every use WebSockets is actually for Synchronizing State. What you really want to do is to synchronize state. Braid is a protocol for doing just that. So you don't need to turn to WebSockets anymore!

← PreviousPage 5 of 34Next →