News for hackers. Stuff that matters.
Re:CSS in GitHub Readmes by onion2k on Wednesday December 09, 2020 @04:24AM (#25356807)
Who wants to send image data through XML?

SVGs aren't image data. They're a set of instructions for recreating image data using a structured language. XML is very good for data like that.

Re:CSS in GitHub Readmes by porphyra on Wednesday December 09, 2020 @01:12PM (#25361659)
Text-based formats like XML and JSON are good if most of your data is strings, but storing numeric data in decimal strings is both inefficient and inaccurate. That's why I think that HTML is an appropriate use of XML-like markup but perhaps vector images would need a true binary version.

However I agree with saagarjha that it is very easy to write code to emit SVG, which is nice.

Re:CSS in GitHub Readmes by saagarjha on Wednesday December 09, 2020 @06:41AM (#25357602)
And their text format is exceedingly useful if you're writing code to generate them.
Re:CSS in GitHub Readmes by IshKebab on Wednesday December 09, 2020 @05:29PM (#25366204)
I don't think it would really be any more difficult if it were binary. The only real reason to use XML is better integration with HTML, CSS and JavaScript, which is admittedly a compelling reason.

But I think he's right - it would be nice if there was a "proper" binary vector format that was widely supported.

Re:CSS in GitHub Readmes by saagarjha on Thursday December 10, 2020 @02:28PM (#25377462)
I mean, I can write a line of Python that goes

  print(f"""<rect x="{x}" y="{y}" width="{w}" height="{h}"/>""")
I find this eminently easier than working with a binary format.
Re:CSS in GitHub Readmes by IshKebab on Friday December 11, 2020 @04:50AM (#25383994)
That's a pretty error prone way of writing SVGs though. In well written code you would use a strongly typed API and that API would be exactly the same for a binary format.

Think about how you write Protobuf files for example.

Re:CSS in GitHub Readmes by saagarjha on Friday December 11, 2020 @04:52AM (#25384013)
In the circumstances where I actually cared I would use a strongly typed language with nice wrappers, of course ;) The reason why I love SVGs is you can just belt them out from scripts and it's the easiest thing in the world. Same reason why I love GraphViz and Netpbm.