Hacker News new | ask | show | jobs
by irontoby 3418 days ago
Haha, since Subversion was born in the height of XML frenzy, they figured it was a good idea for the built-in web interface to just output XML and a default XSLT. That way if anyone wanted to customize it, they could do so to their heart's content by just specifying a different XSLT.

I loved Subversion at the time, and so created the TortoiseSVN Menu plugin [1] for Firefox, and an accompanying XSLT to add lots of rich info and styling into the main UI.

It's something that should have been pretty simple but I remember spending lots of my free time back then to get it just right. Funny thing is, since I worked on it at home but mostly used it at work, I really could have used a good distributed VCS at the time :D

[1]: https://addons.mozilla.org/en-US/firefox/addon/tortoisesvn-m...

1 comments

In my opinion, XSLT is a disappointing implementation of a great idea: a DSL for structurally transforming a data format, encoded in the same data format. I guess S-expressions fit the bill if you want to use a Lisp, but I wouldn’t mind having something similar for JSON.
I very much agree with your sentiment here. That's why I find Haskell lenses so fascinating. Although it's another level of challenge since it's done on a type level.

> something similar for JSON

And I've looked for this as well. Haven't really tried any solution in the trenches but this one might be interesting for you: https://github.com/mmckegg/json-query

Also, GraphQL is tangentially related.

Realizing just how excruciating that sounds, I think am a notch or two closer to appreciating the merits of s-expressions.
I’m curious why it sounds painful to you. I didn’t mean to imply we should reimplement XSLT in JSON syntax, just that some JSON description of a stylesheet, to be applied to JSON data, could be useful.
It very well might be. My feeling was just more or less: I don't love JSON syntax or the tendency towards big, hierarchical JSON documents overmuch (though it's certainly been a massive real-world improvement on XML for most of the overlapping use cases I'm familiar with), so describing transformations on data in it sounds likely to be unpleasant.

Perhaps one of these decades I will actually learn a Lisp.