Easy, readable and fast text based format for Rev?

Mark Smith mark at maseurope.net
Tue Jun 12 11:11:27 EDT 2007


So it's simply name/value pairs. UrlEncoding might be worth  
considering - will deal with any line-ending stuff, and since it  
encodes tab to "%09" should allow for nesting?

Not that it would necessarily matter, but I've generally used "=" as  
the name/value delimiter in such cases.

Best,

Mark

On 12 Jun 2007, at 15:54, David Bovill 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




More information about the use-livecode mailing list