Re:ATProto for Distributed System Engineers
by str4d on Monday September 09, 2024 @06:04AM
(#41486963)
There are a few more details about the reason they didn't use JSON-LD in Paul's blog post [0].
Re:ATProto for Distributed System Engineers
by apitman on Monday September 09, 2024 @11:15AM
(#41489302)
I'm sorry but JSON-LD is a massive pain to work with in statically typed languages. Certainly is in Go at least. The flexibility is the problem, ie you never know if something is going to be an object or an IRI (did we really need a 3rd name for URIs?) to an object. I think you could get most of the benefit while still requiring specific types.
Re:ATProto for Distributed System Engineers
by Diti on Monday September 09, 2024 @12:58PM
(#41490585)
You shouldn’t be having this problem if you use a library which offers normalization (like github.com:piprate/json-gold) so that you get objects when there’s an IRI context, and a simple string when there’s a regular IRI.
Re:ATProto for Distributed System Engineers
by apitman on Monday September 09, 2024 @02:35PM
(#41491850)
I'm not aware of any such libary for Go. Besides, I prefer protocols that are simple enough to implement myself. That's not feasible in every case, but it certainly is for the social media use case.
I get why they did that (graph data is, uh, particular to work with, especially for newcomers who only know JSON), but ATProto not using JSON-LD is actually what made me unwilling to tinker with the protocol.
Not a direct answer to your question, sorry. Mostly a rant.
[link:Lexicon]: https://atproto.com/guides/faq#why-create-lexicon-instead-of...