That "abusive anal thing with the quote-marks on attribute names" as you call it, is a result of a decision made by Douglas Crockford to greatly simplify the JSON format and make writing JSON parsers much easier.
Remember that in JavaScript you can't have your object keys named: break, case, catch, class, const, continue, debugger, default, delete, do, else, enum, export, extends, false, finally, for, function, if, implements, import, in, instanceof, interface, let, new, null, package, private, protected, public, return, static, super, switch, this, throw, true, try, typeof, var, void, while, with and yield, unless they are quoted.
Also any key that is not a valid JavaScript identifier has to be quoted.
When you implement your "less anal" JavaScript object literals encoder and parser, remember to make exceptions for them, or otherwise you wouldn't even have valid JavaScript object literals.
UPDATE:
If you don't want to use quotes in your keys because you are so concerned with the network traffic overhead of using quotes that you'd rather roll your own JSON-like encoders and parsers that wouldn't use quotes instead of using the standard and tested JSON libraries (as I understand from your comments) then maybe you shouldn't be using JSON in the first place.
Maybe try some binary format like the SDXF (RFC 3072 – Structured Data Exchange Format) or BSON (Binary JSON, a binary-encoded serialization of JSON-like documents) or roll your own binary format because removing quotes from JSON will not take you very far (maybe 1% for gzipped transfers at most).
UPDATE 2:
If I understand your situation correctly then you have JSON data like this one:
[{"a":1,"b":2,"c":3,"d":4},null,null,{"a":9,"b":10,"c":11,"d":12}]
It's 66 bytes. Converting it to plain JavaScript object literal it could be:
[{a:1,b:2,c:3,d:4},,,{a:9,b:10,c:11,d:12}]
It's now 42 bytes. (Keep in mind that the handling of dangling commas is inconsistent between browsers – eg. [1,,2,,] is a 4-element array in Firefox and probably 5-element array in IE.)
But this is not everything you can do. You can remove colons, curly braces and commas in objects:
a1b2c3d4,,,a9b10c11d12
It's 22 bytes now. It's about half of the version without quotes and one third of the version with quotes, and it's still easy to parse. If you have a flat data structure then it may be fine for you. I'll call this new format that I have just invented CFON for Compact Flat Object Notation.
You could convert it to JSON using code like this:
var inp = input.split(','),
out = [], i, j, m, p, output;
for (i = 0; i < inp.length; i++) {
if (inp[i]) {
out[i] = {};
m = inp[i].match(/[a-z]+\d+/ig);
for (j = 0; j < m.length; j++) {
p = /([a-z]+)(\d+)/i.exec(m[j]);
out[i][p[1]] = p[2];
}
}
}
output = JSON.stringify(out);
See CFON→JSON DEMO.
And you can convert JSON to this small format using code like this:
var inp = JSON.parse(input),
out = [], i, k, output;
for (i = 0; i < inp.length; i++) {
out[i] = '';
if (inp[i]) {
for (k in inp[i]) {
if (inp[i].hasOwnProperty(k)) {
out[i] += k + inp[i][k];
}
}
}
}
output = out.join(',');
See JSON→CFON DEMO.
Now that I'm thinking about it I might add support for decimal fractions and make a CFON library. If anyone would be interested please comment.
Anyway, this is still just a text format. If you go binary you will have better results especially for large numbers. Also if you have a list of predefined keys then it's easy to use numbers for each of them. If keys are numbers and values are numbers then it can be very compact in binary.
.net? You should explicitly state that you are looking for a Java JSON serializer and retag your question.