Live data from Hacker News

MusicXML

musicxml.com

71–80 of 80 posts

Re: MusicXML

#71

Earlier quoted context omitted.

Another concern with comments is that apps might try to (ab)use them to store app specific information, which hurts the goal of an interchange format.

"Oh no! Bad actors might abuse this absolutely necessary feature, so it's better that we leave it out and let everyone suffer to avoid that! You'll just have to cope!"

I've missed comments in JSON myself, when writing stuff like configuration files. But interchange formats are a different beast, not really meant to be read by humans. And if they need comments to be comprehensible, one might wonder whether the scheme chosen was insufficiently self documenting in the first place.

Re: MusicXML

#72
post #66

Earlier quoted context omitted.

Another concern with comments is that apps might try to (ab)use them to store app specific information, which hurts the goal of an interchange format.

They might do it even without comments by adding unused fields.

Which, if dropped, are a clear change to the document in question. Whereas a dropped comment would have to be considered equal, even if the "special comment aware software" might not agree at all. I'm not happy with the decision, but I can't refuse the argument some merit.

Re: MusicXML

#73

MusicXML is old hat. All the cool kids are using MusicJSON now. EDIT: I'd like to clarify that I posted this comment, as a joke , before the below comment went on to clarify that there was, in fact, a JSON-based rewrite of the music standard in progress: https://news.ycombinator.com/item?id=38460827 Never change, tech world!

Please don't post one-line jokes on HN. The longstanding culture of this venue finds that inappropriate.

fwiw, on my phone it showed up as two lines.

Re: MusicXML

#74
post #48

Earlier quoted context omitted.

XML is less precise, because it's more flexible. Powerful and mature tooling only matters to people creating and editing XML, not computers. XML Schemas are there to support human editors, not computers. Verboseness means larger files and longer processing times, which does matter to computers; the verbosity is explicitly and only there for human readers and editors. JSON is a much better format for something humans…

You're wrong in almost every point. Flexible definition of data allows for greater precision of data structure. Something like XSLT isn't for human interaction; it's for super-powerful machine transformations. I'll grant XML files are larger, but not enough to make much difference when opening a music notation file. Any time a dev pushes back against XML, it's been my experience they are uneducated on the subject.

> Flexible definition of data allows for greater precision of data structure.

Other way around. If there are 3 different ways of doing something, the data structure is less precise. Say you have an object with a Name as a string. You know exactly what this is going to look like in JSON:

    {
        "name": "Whizzbang"
    }
How is it going to look in XML? It might look like this:

    
It might look like this:

    
        Whizzbang
    
It might look like this:

    
        
    
XML is less precise because it's more flexible. "But you just define an XML Schema to disambiguate" -- so now you're doing more work in a separate file that you have to publish and link in just to solve a problem that JSON doesn't have at all.

> Something like XSLT isn't for human interaction; it's for super-powerful machine transformations.

It's only "super-powerful" considering XSLT as a markup language. Considering it as a programming language, it rather sucks. If you're writing ETL scripts to transform data around, use an actual programming language. The fact that XSLT is Turing Complete only drives home the point that it's not a "powerful markup language", it's "poorly-designed programming language". Sure, if you're literally only transforming the exact same data from one XML schema to another, as some sort of adapter step, then XSLT beats general-purpose languages; but you're never just doing that, are you? You're linking in other data sources, validating things, sending things over the wire, etc. You already need the code to save and load your XML into a format you prefer in memory; just use that format for these tasks.

> Any time a dev pushes back against XML, it's been my experience they are uneducated on the subject.

Many people who push back against XML are not uneducated, but rather jaded on it, having worked with ambiguous formats, buggy schemas, and 4000-line long configuration behemoths that should have just been code. You can use XML parsimoniously, but there's not much overlap between the people doing that and the people who love XSLT.

Re: MusicXML

#75
post #48

Earlier quoted context omitted.

XML is less precise, because it's more flexible. Powerful and mature tooling only matters to people creating and editing XML, not computers. XML Schemas are there to support human editors, not computers. Verboseness means larger files and longer processing times, which does matter to computers; the verbosity is explicitly and only there for human readers and editors. JSON is a much better format for something humans…

You're wrong in almost every point. Flexible definition of data allows for greater precision of data structure. Something like XSLT isn't for human interaction; it's for super-powerful machine transformations. I'll grant XML files are larger, but not enough to make much difference when opening a music notation file. Any time a dev pushes back against XML, it's been my experience they are uneducated on the subject.

The reason why you don’t need some big, formal JSON schema (though they do exist) is because you can notate most of the constraints people care about in TypeScript. It’s just a bunch of structs, arrays, string enums, etc. XML doesn’t really have a nice mapping to type systems like that so it needs schemas.

My coup de grace against XML is that it is wholly unsuitable for serializing arbitrary strings in most programming languages. It’s defeated by quite simple strings like “hello\0world”. You can’t just escape the null using &#; because the standard, in its infinite wisdom, forbids it. Instead, you’re just expected to come up with some completely non-standard way like or just interpret “\0” specially in your application code. Meanwhile, JSON just lets you put pretty much whatever Unicode you want into a string with a standard way of escaping characters like the double quote.

Re: MusicXML

#76

Earlier quoted context omitted.

Another concern with comments is that apps might try to (ab)use them to store app specific information, which hurts the goal of an interchange format.

> Another concern with comments is that apps might try to (ab)use them […] There's no "might" about. This is exactly what happened in the early/beta days of JSON, per Douglas Crockford, creator of JSON: > I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it sh…

There is a big but though: whether the loss of interoperability for those cases was any real loss. Those people wanted their own files parsed a specific way by their own infrastructure. Their files already weren't meant for every regular JSON parser: if they wanted wider interoperability they'd had dropped those comments.

And nobody stops them from continuing to use those meta-parsing semantics even if JSON-standards prohibits comments.

I think Crockford was wrong in his objection. It shouldn't have been his concern.

Re: MusicXML

#77
post #8

I work for Sibelius so I'm heavily involved in this world. MusicXML is a great standard and offered a solid basis for data interchange between music notation programs. But now there's a new group working to build a successor standard, MNX: https://w3c.github.io/mnx/docs/ It was originally going to be in XML but they recently switched to JSON, which is a good move, I think. I can't wait for it to be adopted as it will…

Never heard of either before but having looked at the comparison [0] I think I prefer the XML version. [0] https://w3c.github.io/mnx/docs/comparisons/musicxml/

I'm with you. I usually prefer JSON to XML but in the example the XML is more readable

Re: MusicXML

#79
post #74

Earlier quoted context omitted.

You're wrong in almost every point. Flexible definition of data allows for greater precision of data structure. Something like XSLT isn't for human interaction; it's for super-powerful machine transformations. I'll grant XML files are larger, but not enough to make much difference when opening a music notation file. Any time a dev pushes back against XML, it's been my experience they are uneducated on the subject.

> Flexible definition of data allows for greater precision of data structure. Other way around. If there are 3 different ways of doing something, the data structure is less precise. Say you have an object with a Name as a string. You know exactly what this is going to look like in JSON: { "name": "Whizzbang" } How is it going to look in XML? It might look like this: It might look like this: Whizzbang It might look li…

Generally agree here. Just wanted to throw out another variant, additional tags and attributes can be added or modified by XML DTD files as well. The example XML could be just "" with the additional values generated by a DTD file.

Re: MusicXML

#80

MusicXML is old hat. All the cool kids are using MusicJSON now. EDIT: I'd like to clarify that I posted this comment, as a joke , before the below comment went on to clarify that there was, in fact, a JSON-based rewrite of the music standard in progress: https://news.ycombinator.com/item?id=38460827 Never change, tech world!

[deleted]
Post reply on HN