From: Kragen Sitaker (firstname.lastname@example.org)
Date: Fri May 19 2000 - 08:08:02 PDT
Ka-Ping Yee writes:
> On Thu, 18 May 2000, Kragen Sitaker wrote:
> > > Binary protocols are smaller, faster, language-independant,
> > > unpatentable, and free.
> > "smaller": yes, the data is smaller. The implementation is much larger.
> Wait, you're kidding, right?
> read(handle, struct, sizeof(struct)) vs. a complete XML parser?
> XML has some advantages, yes, but speed, small data, and small
> code are not among them.
Implementing a single message type for a single platform (as above) is
obviously much simpler than writing an XML parser. Implementing a
single message type portably --- which requires byteswapping,
correcting for data type sizes, etc. --- is an order of magnitude or
two harder, but still much easier than writing an XML parser.
Implementing a generic self-describing data format portably is an order
of magnitude or two harder than that, and it seems to get to be worse
--- either that, or you lose the "smaller" and "faster" parts.
To be concrete:
$ cat `find orbit-0.5.0 -name '*.[ch]'` | wc -l
$ cat `find /home/kragen/pkgs/mozilla/expat -name '*.[ch]'` | wc -l
Even the src/IIOP part of ORBit weighs in at 3349 lines, and that
doesn't even include the IDL compiler that actually generates the code
to turn the messages into C objects.
-- <email@example.com> Kragen Sitaker <http://www.pobox.com/~kragen/> The Internet stock bubble didn't burst on 1999-11-08. Hurrah! <URL:http://www.pobox.com/~kragen/bubble.html> The power didn't go out on 2000-01-01 either. :)
This archive was generated by hypermail 2b29 : Fri May 19 2000 - 08:09:59 PDT