4 ms·
MusicXML is indeed widely used, and it is basically the standard interchange format for music notation apps. Every major app I can think of supports it—certainl
by chriskrycho 5y ago
MusicXML is indeed widely used, and it is basically the standard interchange format for music notation apps. Every major app I can think of supports it—certainly the “big four” of Dorico, Sibelius, Finale, and MuseScore, as well as other apps like Notion, StaffPad, etc.
I was thinking of what would make the interchange format better would be after writing up this post, and my honest conclusion was that MusicXML itself is pretty good. There are standardization choices you could make within the format itself (as alluded to in the post) which would help with interchange, but the definition is reasonable throughout. The thing that is hard is simply that XML is hard: lots of tools out there support subsets of it, but nearly everything XML-oriented ends up being either Java or some kind of libxml wrapper. (To my surprise, there really isn’t a ton even in the Rust space which would seem to be well-suited to this kind of thing. DTD support took ages to show up anywhere, for example.) While switching to some kind of JSON schema would mitigate the XML problem, getting all the vendors to adopt it would be quite a battle, I expect.
- tannhaeuser 5y agoThat makes sense. But isn't Rust able to just link against libxml2, Xerces C++, or expat?
- steveklabnik 5y agoYes, Rust can link against libxml2, at least.
- chriskrycho 5y agoYep, and it totally gets the job done. (Hey, Steve!) I’m just perpetually surprised that 6 years past 1.0 we don’t have a Rust native implementation of the equivalent. What I’ve slowly concluded is: we as an industry more broadly just don’t do that much XML anymore, so the incentives aren’t there. (And here I mean XML as XML. Obviously we have XML-related stuff everywhere in the form of HTML, but it’s a bit of a different world.) And the other piece is that for the XML we do have, the Rust implementations and the binding to libxml are good enough.
- steveklabnik 5y agoHey hey! :) I would agree with this post, for sure. The surprise, and the analysis both. There is of course always a bit of chicken and egg with this kind of thing; people don't use tons of XML with Rust because there aren't good libraries, and good libraries don't exist because people don't use a ton of XML with Rust. Normally this stalemate is broken by something being useful enough for someone to go through and implement a library, but I guess that hasn't come up yet, or that the bindings are indeed good enough.
- briggsnull 5y agoI've been trying to work on this, specifically for the purpose of a Rust implementation on MusicXML and later MNX. XML is so hard though. First I created a tree parser since I didn't see anything at the time. Maybe there's a better tree/DOM parser now. Don't know. Here's mine https://github.com/webern/exile https://github.com/webern/exile Proper handling of whitespace is probably the biggest drawback. In a private repo I've been trying to use the XSD spec to create a library that represents XSD correctly. This is where things get really hard. P.S. This is my C++ implementation of MusicXML, but I want to do everything in Rust now because the type system and tooling are so great. https://github.com/webern/mx https://github.com/webern/mx