News for hackers. Stuff that matters.
Re:Unwalled.Garden: souped-up RSS for P2P social apps by gambler on Thursday June 06, 2019 @03:55PM (#20118434)
Anyone who tries to use JSON for complex, extensible formats that involve documents (as opposed to data structures), metadata and semantic data are shooting themselves and their users in the foot. Just because W3C fucked up in some of their XML-based standards doesn't mean that trying to shove JSON everywhere is a sensible idea.

  {
  "topic": "dat://unwalled.garden",
  "body": "Why didn't you use XML!?",
  "createdAt": "2018-12-07T04:15:44.722Z"
  }
Now, I want to change body to include images or something of that sort. Bam, all the software that parses the old format is now broken.

Just use XML. Preferably, extend one of the existing RSS-like formats. Apply lessons learned from HTML and XHTML. It will work zillion times better in the long run.

Re:Unwalled.Garden: souped-up RSS for P2P social apps by pfraze on Thursday June 06, 2019 @04:10PM (#20118596)
There's nothing stopping you from extending the JSON schema. We'll probably come up with extension points to make it easier (as subobjects, each declaring their own schema IDs).

The format really isn't the interesting question. The interesting question is how do we get clients to behave predictably with each other. If you start breaking the schemas that everyone on the network is using, then yes your posts should fail to render and probably be ignored.

Re:Unwalled.Garden: souped-up RSS for P2P social apps by grenoire on Thursday June 06, 2019 @05:41PM (#20119525)
The format is exactly for the purpose of getting clients to behave predictably!

Without defining these schemas to allow for flexible mixed media documents, you're always going to have chaotic implementations floating around.

Re:Unwalled.Garden: souped-up RSS for P2P social apps by theamk on Thursday June 06, 2019 @04:45PM (#20118977)
I think inability to include images it is actually a feature.

As long as your body is a plain text, you can present it in a very wide variety of ways and styles. Once you allow formatting and inline images, you start moving towards HTML documents, and lose consumer's control over content.

Re:Unwalled.Garden: souped-up RSS for P2P social apps by api on Thursday June 06, 2019 @06:14PM (#20119762)
You also invite degeneration into an imageboard which ends up being a wall of memes and stupid jokes.
Re:Unwalled.Garden: souped-up RSS for P2P social apps by elcomet on Thursday June 06, 2019 @04:10PM (#20118602)
I don't follow you. JSON is very extensible. Just add a new key like "body-image" and you're done.

How is that different from XML if your body is defined as a text field?

Re:Unwalled.Garden: souped-up RSS for P2P social apps by dpe82 on Thursday June 06, 2019 @04:25PM (#20118744)
How do you express "Why didn't you use <img src="xml_has_its_uses.png"> XML!?" with json?
Re:Unwalled.Garden: souped-up RSS for P2P social apps by rolltiide on Thursday June 06, 2019 @04:31PM (#20118826)
you don't, you just store the string as is in the body tag and let the client side parser know how to parse html strings that may also include an image tag

what is the argument here? why didn't you know you answered your own question

"body":"Why didn't you use <img src="xml_has_its_uses.png"> XML!?"

Re:Unwalled.Garden: souped-up RSS for P2P social apps by grenoire on Thursday June 06, 2019 @05:35PM (#20119489)
OP is asking what the content type of the body is to be interpreted as.

You're assuming HTML string, which might not always be correct. What do you do with Markdown?

You need to have a standard way to represent things like this, because otherwise it won't gain traction solely due to the immense complexity of implementing viewers.

Edit: On top of this, HTML might not necessarily be the best choice. In that case it'd just be browser wrappers galore.

Re:Unwalled.Garden: souped-up RSS for P2P social apps by elcomet on Friday June 07, 2019 @03:06AM (#20122293)
Well grandparent also assumed HTML since he put an HTML tag with html attributes in his node. I'm not sure how different this is, and if he wants to convert this to markdown he'll also need a html to markdown converter.
Re:Unwalled.Garden: souped-up RSS for P2P social apps by rolltiide on Friday June 07, 2019 @10:19AM (#20124738)
gain traction? you are really talking about a non-issue this decade

everyone is already used to making their frontend, backend and database parse and store external things in key value pairs

this schema pre-detecting ship has sailed a long time ago

Re:Unwalled.Garden: souped-up RSS for P2P social apps by jazzyjackson on Thursday June 06, 2019 @09:51PM (#20120972)
Assuming It's eventually going to be read as HTML I do this

  {"body":{
    "childNodes": [
      {"span":{"textContent":"Why didn't you use "}},
      {"img":{"src":"xml_has_its_uses.png"}},
      {"span":{"textContent":" XML!?"}}
    ]
  }}
Re:Unwalled.Garden: souped-up RSS for P2P social apps by rolltiide on Thursday June 06, 2019 @04:30PM (#20118815)
can you explain that example more clearly?

if you wanted to "include images or something of that sort" you would add an "images" key or a "something of that sort" key

in your particular example, body can clearly take image links image data as string and the parser can deal with it.

in my projects we typically would have a nosql database which out the box allows it to be indifferent about objects in a collection/table that include or exclude certain keys

Re:Unwalled.Garden: souped-up RSS for P2P social apps by cblades on Thursday June 06, 2019 @04:39PM (#20118908)
Not who you're responding to, but:

>and the parser can deal with it.

That's not ideal. You need a defined schema so that the majority of parsers can reliably parse the majority of objects.

>in my projects we typically would have a nosql database Parser implementations shouldn't be assumed to use the same or similar tech stack that you do.