News for hackers. Stuff that matters.
Re:TinyVG: A challenger to the throne of vector graphics by exabrial on Monday December 20, 2021 @04:56PM (#29630845)
"XML is bad" is still one of the worst engineering arguments. Why is it bad? What is the tradeoff? Things that are bad are easy to quantify as they're measurable. What does it have? It has strong schema support built in. Any intelligent IDE allows for cmd-space completion by reading the XSD. I don't buy this argument as full XML parsers are not even as complicated as HTML5 parsers, which nobody seems to have an issue with. It's not the end-all-be-all of formats, but this is something that's oft-repeated and never quantified.

Your second point is actually valid though. If the TinyVG format takes advantage of non-tree based data-structures, I can certainly understand the motivation. I have a hard time conceptualizing how a tree based format would be beneficial to a vector format, other than describing metadata about certain "areas" of the image.

Re:TinyVG: A challenger to the throne of vector graphics by ikskuh on Monday December 20, 2021 @05:24PM (#29631179)
XML is bad for TinyVG as it is too large in several regards. XML kinda requires DOM parsing, XML is a text format (so inefficient encoding) and XML parsers need to be large so they can be called XML parsers.

All of these properties contradict a embedded world where you can render vector graphics from 32k RAM on a chip that doesn't even have enough memory for a framebuffer itself.

Also implementation complexity of XML is so high that i gave up on impementing a correct parser. I don't want to have a half-assed parser that cannot parse XML, but only "XML light" and making this is a huge amount of work which i don't want to waste in my leisure time

Re:TinyVG: A challenger to the throne of vector graphics by shatteredgate on Monday December 20, 2021 @05:45PM (#29631454)
I agree that SVG/XML is bad for embedded and I think this format is cool but you probably can agree it's unlikely anything will displace SVG unless it matches it in features, one of the benefits which is to manipulate SVGs using the DOM in browsers.
Re:TinyVG: A challenger to the throne of vector graphics by dragonwriter on Monday December 20, 2021 @11:36PM (#29633937)
> XML kinda requires DOM parsing

Why? Streaming/evented (e.g., SAX) parsing for XML is as old as XML.

Re:TinyVG: A challenger to the throne of vector graphics by ikskuh on Tuesday December 21, 2021 @03:23AM (#29635205)
Yes, but SVG can and will do forward references. Ergo, we have to store some kind of DOM in order to resolve them. Even if it's not in the form of the XML doc
Re:TinyVG: A challenger to the throne of vector graphics by int_19h on Wednesday December 22, 2021 @01:13AM (#29646073)
Couldn't the proposed subset just drop forward references?
Re:TinyVG: A challenger to the throne of vector graphics by xienze on Monday December 20, 2021 @05:58PM (#29631604)
> "XML is bad" is still one of the worst engineering arguments.

It’s reached meme status. I think most people conflate complex XML-based _formats_ (e.g., WSDL, XSD) with XML _the format_. The rules of XML parsing can fit on a notecard. And a basic parser that supports all the core functionality plus namespaces is really not that complicated to implement. Now, implementing schema validation, Xlink, etc. in your parser is definitely not simple. But to make a simple XML parser those are optional bits.

Re:TinyVG: A challenger to the throne of vector graphics by anyfoo on Monday December 20, 2021 @11:46PM (#29633998)
As someone who a) personally had to deal with XML fallout, and b) actually looked into its history, I respectfully disagree. I adore typed semi-structured data, but XML is not an implementation thereof that is appropriate for, at least, nowadays (I go into just slightly more detail in a sibling comment).
Re:TinyVG: A challenger to the throne of vector graphics by templix on Tuesday December 21, 2021 @06:40AM (#29636404)
> But to make a simple XML parser those are optional bits.

Yes, but SVG requires a lot of those optional bits... A parser complex enough to deal with all the nooks and corners of SVG is not simple at all.

Re:TinyVG: A challenger to the throne of vector graphics by anyfoo on Monday December 20, 2021 @11:41PM (#29633966)
I know where you are coming from, but in the case of XML, I really think it's bad. I'm tired today so I'm not going to write an essay, but XML's history alone (look up how exactly it derives from SGML) made it a good idea with a bad execution.

Semi-structured data is not bad. Namespaces are not bad. Schema are not bad. In fact, I also on the other hand very much lament that XML's backlash lead us to JSON, which is entirely untyped semi-structured data where everyone has to write an (often buggy and incomplete) ad-hoc typechecker for every single document.

Those features are not the problem, the problem is that they are embedded in the SGML-borne XML, that has many weird and intricate corners that only make sense in light of its history, and that lead to complex parsing, obscure behavior, and lots of potential for vulnerabilities--in the parsers or in code that just uses a (perhaps in itself safe) parser. DTDs, Entities, and Processing Instructions are just some of the more known warts.

Re:TinyVG: A challenger to the throne of vector graphics by adgjlsfhk1 on Monday December 20, 2021 @05:01PM (#29630908)
XML is bad because it bloats the size by roughly 3x (compared to other text formats like s-exprs), is difficult to implement properly. HTML is bad too, we're just more stuck with it so it's less useful to complain.
Re:TinyVG: A challenger to the throne of vector graphics by shatteredgate on Monday December 20, 2021 @05:17PM (#29631110)
The size is not really an issue for any compression algorithm. I've seen quite a few small XML parsers that don't bother with the full spec and only implement a subset.
Re:TinyVG: A challenger to the throne of vector graphics by adgjlsfhk1 on Monday December 20, 2021 @06:24PM (#29631827)
Even when you compress XML, it's still around 10% bigger than JSON, and around 40% bigger than protobuf (not endorsing either, just examples). Furthermore, making the compressor work harder isn't free. The time to compress and decompress XML is roughly 2x higher than with JSON, and if you decompress the data before using it, XML will still hit you wrt RAM usage.

All of these would be fine if XML offered you some really good advantage over alternatives, but as far as I can see, it doesn't. It just eats up CPU/memory/bandwith/keystrokes for no reason.

Re:TinyVG: A challenger to the throne of vector graphics by shatteredgate on Monday December 20, 2021 @07:03PM (#29632135)
XML does offer some really good advantages when it comes to storing strings and sub-documents. I would absolutely not want to write any kind of document in JSON, but XML has been used successfully for a great many document formats.