News for hackers. Stuff that matters.
Re:Transit: JSON Data Interchange Format by lars512 on Wednesday October 14, 2015 @03:36AM (#10385405)
I couldn't get the why of the project from the Github page alone. Rich Hickey's post introducing it a year ago is clearer:

http://blog.cognitect.com/blog/2014/7/22/transit

JSON has become the go-to schemaless format between languages, despite being verbose and having problems with typing. Transit aims to be a general-purpose successor to JSON here.

Stronger typing allows the optional use of a more compact binary format (using MessagePack). Otherwise it too uses JSON on the wire.

Anyone who knows more, please correct me.

Re:Transit: JSON Data Interchange Format by gioele on Wednesday October 14, 2015 @09:18AM (#10386412)
> JSON has become the go-to schemaless format between languages, despite being verbose and having problems with typing. Transit aims to be a general-purpose successor to JSON here.

XML has become the go-to schemaless format between languages, despite being verbose and having problems with typing. JSON aims to be a general-purpose successor to XML here.

Re:Transit: JSON Data Interchange Format by brianberns on Wednesday October 14, 2015 @10:01AM (#10386627)
Yes, except that XML has a schema (XSD).
Re:Transit: JSON Data Interchange Format by nmeofthestate on Wednesday October 14, 2015 @11:33AM (#10387179)
Re:Transit: JSON Data Interchange Format by orless on Wednesday October 14, 2015 @01:18PM (#10387926)
Quoting http://json-schema.org/latest/json-schema-core.html: "This Internet-Draft will expire on August 3, 2013."
Re:Transit: JSON Data Interchange Format by orless on Thursday October 15, 2015 @10:21AM (#10393272)
... which, by the way, does not mean that JSON Schema is bad or unusable. I actually quite like it, it has certaint elegance. Just not really standard.
Re:Transit: JSON Data Interchange Format by tel on Wednesday October 14, 2015 @11:51AM (#10387292)
That's an exterior thing. It's perfectly reasonable to talk about XML the schemaless markup language.
Re:Transit: JSON Data Interchange Format by zcdziura on Wednesday October 14, 2015 @09:49AM (#10386569)
History repeats itself, after all.
Re:Transit: JSON Data Interchange Format by vocaro on Wednesday October 14, 2015 @11:16AM (#10387082)
XML is not schemaless. It was designed to be extensible through schemas. It's in the name, after all: eXtensible Markup Language.

XML also doesn't suffer the problems of a limited set of pre-defined types that JSON has. Its type system is extensible through schemas.

Re:Transit: JSON Data Interchange Format by dragonwriter on Wednesday October 14, 2015 @11:29AM (#10387151)
> XML is not schemaless.

Yes, it is, though there are a variety of schema schemes that can be used with XML.

> It was designed to be extensible through schemas.

It was designed to be extensible through custom tags (in fact, all tags are custom tags); it can be optionally be restricted through the use of schemas, not extended.

> XML also doesn't suffer the problems of a limited set of pre-defined types that JSON has.

Yes, it does, with an even smaller number of types. (Strings, with a couple different representations.)

> Its type system is extensible through schemas.

No, it isn't. Its structure can be constrained through schemas (XML Schema, Relax NG, etc.), which can provide a means of modeling a different type system on top of the data structure supported by XML, but that isn't really "extending" XMLs type system any more than using a Haskell compiler to generate x86 machine code is "extending" the type system of x86 machine code; its just providing a completely separate type system on a different layer.

Also, no matter how you view this, its not a distinction between XML and JSON, since you can do the same thing with JSON, and just as there are a variety of different schema standards that do this for XML, there are a variety that do the same thing for JSON.

Re:Transit: JSON Data Interchange Format by brandonbloom on Wednesday October 14, 2015 @01:44PM (#10388114)
Another important feature is stream-oriented caching of values. Essentially some range of opcodes in the stream language are reserved for referring to a cache of recently seen values. It's a "dynamic" encoding feature that's super beneficial for common payloads, like JSON API responses with lots of similar keys. This is something a protobuf/thrift-like should steal, as it can often be more efficient than vanilla field-number + value encoding.
Re:Transit: JSON Data Interchange Format by jimktrains2 on Wednesday October 14, 2015 @10:52AM (#10386925)
> maps (with arbitrary scalar keys, not just strings)

Floating point keys just seem like a terrible idea.

Re:Transit: JSON Data Interchange Format by dragonwriter on Wednesday October 14, 2015 @11:35AM (#10387187)
> Floating point keys just seem like a terrible idea.

I don't see why floating point (with a defined precision) keys are any worse fundamentally than any finite-domain scalar keys. The applications for which they are useful may be limited, and they may be the wrong choice for some uses, but that's true of anything.

Re:Transit: JSON Data Interchange Format by jimktrains2 on Wednesday October 14, 2015 @11:40AM (#10387224)
> floating point (with a defined precision)

If it's fixed-precision it's not floating point, it's basically an integer we interpret with a decimal point somewhere when we display it. If you didn't mean fixed-precision, then I'm not sure how actual floating points could sanely act as a hash key.

Re:Transit: JSON Data Interchange Format by dragonwriter on Wednesday October 14, 2015 @12:36PM (#10387625)
> If it's fixed-precision it's not floating point

I'm not referring to fixed point, but fixed-size representation.

> If you didn't mean fixed-precision, then I'm not sure how actual floating points could sanely act as a hash key.

I don't see what the problem is. Certainly, there's problems if you do certain floating point calculations and blindly look for the result as a key in a mapping, but that's not a problem with floats as keys, its a problem with that particular usage pattern.

Re:Transit: JSON Data Interchange Format by jimktrains2 on Wednesday October 14, 2015 @12:53PM (#10387757)
> I'm not referring to fixed point, but fixed-size representation.

I'm still not sure what you mean as any IEEE floating point (which in reality all anyone uses) is fixed-size. If you decide to truncate, round, do w/e to this value, you may still not get exactly the same answer for similar computations or even the same computation on different machines. There isn't a reason you can't (well, shouldn't) do float_val == 0.0 -- it won't work in all circumstances.

Please explain your method of making sure float_val == 0.0 while retaining the essence of being floating point (i.e. not using fixed-point).

Re:Transit: JSON Data Interchange Format by tel on Wednesday October 14, 2015 @11:52AM (#10387308)
Even with a defined precision they're weird in that they "ought to" be modeling the reals and therefore lack computable equality.

Which makes it hard to write a well-defined hash.