Easy, readable and fast text based format for Rev?

David Bovill david at openpartnership.net
Tue Jun 12 13:27:03 EDT 2007


Wow - really I'll take a look - when I had to write something for vCards /
iCal it was a really really nasty format to parse reliably!

On 12/06/07, Andre Garzia <andre at andregarzia.com> wrote:
>
> David,
>
> a format I like is the vObject format used by vCards and iCalendar files.
>
> It's easy and allow for grouping, name/value pairs and attributes.
>
> I made a alpha library that you can check. My routines have some bugs
> as many pointed out but I can't really focus on that library right
> now.
>
>     go url "http://www.soapdog.org/vObjectPackage.rev"
>
> This library also contains the RFC for the formats, this should give
> you a nice idea of how to make your own objetcs.
>
> ;-)
>
> The JSON object format is quite nice too, did someone created a
> parser/generator for that in Rev yet?
>
> Andre
>
>
> On 6/12/07, David Bovill <david at openpartnership.net> wrote:
> > Based on the simple but fast philosophy of JSON - I'm looking at
> defining a
> > text based format which is readable, non binary and as fast as possible
> for
> > Rev to parse. I want like JSON to throw away all those pesky XML tags.
> >
> > Now I can't remember the details but JSON and YAML I think use a simple
> > "name [delim] value" type notation - but keeping things completely flat
> (no
> > nesting). At the moment (see below) I am using a tab character for the
> > delimiter - I tried others but this seems to work for readability and
> > flexibility.
> >
> > The notation i am thinking of therefore are simple lines like the
> following
> > (think of " [tab] " as just a single tab character):
> >
> > name [tab] david
> > > height [tab] 6ft 2inches
> > > biography [tab]
> <sport>football</sports><interests>whatever</interests>
> > > notes [tab] flattened htmltext
> > > photo [tab] base64ofAnImage
> > >
> >
> > I've been using this format for some things for a while - but thinking
> of
> > going with it for a large project. The idea is for XML to strip out any
> > white space - flatten it into one line - here are some of the (hoped
> for)
> > advantages:
> >
> >    - for htmltext that means just "replace CR" - setting it does not
> >    require the CR so its fast.
> >    - It also means you can split and combine the format into arrays for
> >    fast processing.
> >    - Sending the data around, as messages, over socket / the wire is
> fine
> >    - As a text format I can use subversion to keep incremental backups
> >    - I seem to be able to nest it indefinitley by using base64 encoding
> >    of an entire chunk
> >    - It is fast to convert to XML, JSON or other formats
> >
> > I am not sure about using [tab] - but it just seems to work. Comments
> > appreciated.
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list