News for hackers. Stuff that matters.
Re:Space: A whitespace alternative to JSON by malandrew on Wednesday April 17, 2013 @06:29AM (#5563653)
Isn't this counter to the original purpose of JSON: serialization. Without braces and quotes, or similar syntax, you can't minify this for transfer over a low bandwidth, high latency connection.
Re:Space: A whitespace alternative to JSON by breck on Wednesday April 17, 2013 @12:08PM (#5565246)
I'm not sure how you couldn't minify this compared to JSON? Could you provide an example?
Re:Space: A whitespace alternative to JSON by rjempson on Wednesday April 17, 2013 @03:01AM (#5563119)
What happens if the data has spaces in it or new lines in it? in other words, how do you escape a space / new line?
Re:Space: A whitespace alternative to JSON by breck on Wednesday April 17, 2013 @12:10PM (#5565265)
Spaces are not a problem in values and need no escape. To escape a newline in a value, just indent it appropriately. For example:

    myKey this is a multiline string
     and the indent on this line indicates that.
     It can even be 3 lines long :)
    someOtherKey and now this is a separate key/value pair.
Like URLs, new lines and spaces are not allowed in keys.
Re:Space: A whitespace alternative to JSON by ericingram on Tuesday April 16, 2013 @09:32PM (#5562079)
Looks interesting, are there any serious drawbacks from JSON?
Re:Space: A whitespace alternative to JSON by breck on Tuesday April 16, 2013 @10:28PM (#5562284)
Great question. The simpler syntax reduces the number of rules to remember and shrinks the possible space for bugs. In back of the envelop user testing with non-programmers we've found people can pick up Space significantly faster than JSON.

JSON is really popular. However, the number of people in the world who can read and write JSON is say, between 2-20 million. So a very small percentage of the people who could benefit from reading and writing structured data are currently doing so. Our thought with this is that perhaps if we can get enough adoption and developers involved over the next year or two we could enable a lot more people to collaborate on the web.

Re:Space: A whitespace alternative to JSON by kissmd on Wednesday April 17, 2013 @04:44AM (#5563405)
what about arrays? what if i paste this in a html and you want to copy it? all your spaces will be stripped.

nice thought anyway.

Re:Space: A whitespace alternative to JSON by breck on Wednesday April 17, 2013 @12:41PM (#5565442)
The underlying data structure of Space is an associate array, like in PHP.

So Space objects are both hash tables and arrays. For example say you had a variable named account with the space value:

    charges
     coffee $2.12
     soda $1.21
     cupcake $2.50
You could access the individual elements of this object like you would a hash table:

     account.get('charges soda')
     // Returns $1.21
 
Or like an array:

     account.get('charges').get(1)
     // Returns $1.21
Re:Space: A whitespace alternative to JSON by luisbebop on Wednesday April 17, 2013 @01:10AM (#5562792)
amazing. simple and efficient. better than json.