2014-07-08 21:53 GMT+02:00 Dāvis Mosāns <davispuh@gmail.com>:Also what about NUL bytes? I bet most parsers are implemented in C/C++ using typical char * null-terminated string, how'll pass this JSON to someone? because well NUL...
At the parser level you would find a "b" character that's not between brackets, signalling a binary header is coming. A binary header is actually just the number of bytes that follow in binary format. The following bytes are then a binary file, to be assigned to a string as if it were a variable. We have a binarybuffer in javascript, that sort of thing. It would contain the NULL byte if you like it to.
[...]
I think it's much more serious that you have to serve the BJSON completely as a binary file. It's not like you can dump it onto a webpage anymore. You can't slip it into your normal HTTP text transfer bodies either, has to work with attachments. Attachments should be secure when facing malformed transfers* etc. Inconvenient, but not the end.
I haven't used it in years, but I was always quite fond of XDR
https://en.wikipedia.org/wiki/External_Data_Representation
Sun's External Data Representation coding from the 80s, RFC-1014.
Defines a bunch of variable types, and gives you tools for packing and unpacking them.
It's really nice that so many of you got into the spirit and start
thinking about how to change xmpp to make it something new, but what are
you achieving here? It will end up being a new protocol, incompatible
with existing xmpp, it will take a few years to finish the spec, then
another 10+ years until any meaningful applications start using it (if
at all)... So yeah, except being "coder porn" it does nothing to help
the problem here and now.
A technically pretty proto won't help, today’s world has a huge problem
with taking anything new. Better to stay with existing stuff, make it
maybe less efficient because of it, but it will be here fast, when it's
needed. Plus being less efficient is a no issue today, with fast
machines (you can use compression on the fly, yes really :-P ), loads of
storage, broadband connections (even the 3G data caps are getting larger
and larger each year), etc. People are sending gigabytes of binary files
in base64 each day in email messages, so why even care? ;-)
In my opinion the bottom line is - a small addition to existing xmpp has
a far larger chance of being widely adopted (by applications and by the
users) than a completely new protocol. And despite how awesome coder one
might be - you won't be able to write all those implementations yourself
or convince the masses to switch (again!).
[...]
There is no masses using XMPP. Masses of coders, maybe, and they will use the best tool for the job.
All the extensions have succeeded in making any XMPP app lacking in usability. I sure haven't found any nice XMPP clients, nice enough to compare with native clients.
In fact I'm willing to bet everyone in the western world uses FB, Google chat and MSN (slackers and slowpokes). They all have limited XMPP implementations, they native clients do more. And there's no good app for interacting with XMPP.
Pidgin really isn't good, it's just the only one out there. And it is still in the MSN era. I've switched to Office 2013 from Libre/OpenOffice and it really is in a different league all together. And it sucks that it is. But what can we do?
So how that all would be possible? It's extremely simple. In client-server architecture, open connection to server, establish TLS (for example) now send this next-gen protocol header message (to specify what kind of data you're sending) and then send your data, it could be for example a raw Theora stream (directly from your camera) or just a text message. Then server just relays it to all parties.
I don't think it could be any simpler and nothing will beat this in terms of performance. You've just some basic dependencies and what would be the reason to complicate this? It's trivial to implement as there's already libraries for those. In case of offline messages server would just store them and in fact it could do same for sound and videos too. You know Vine, Snapchat? what about YouTube, Soundcloud, basically it could support them all. IMO this is millions worth idea :D
It's worth looking at WebSockets, WebRTC and probably other standards.
I really don't understand why currently it all have been made so complicated because it isn't.