Live data from Hacker News

Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

plus.google.com

181–190 of 265 posts

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#181
post #149

Earlier quoted context omitted.

This is a good point, but I feel that discouraging this type of approach is not the way to go. I apologise in advance for ranting... I hope this is not too off-topic, but instead a "zoom out" on the issue. This touches on something deep and wrong about how we use computers these days. Computers are really good at being computers, and the amplification of intellectual capabilities they afford is tremendous, but this i…

In a world where users will willingly enter malicious code into their computers if they believe it will do something they want[1], can there really be a better way? [1] https://www.facebook.com/selfxss

When it comes right down to it, you can't fully protect people from themselves. Even in 'meat space', which the general population is presumably experienced with, people talk others into doing things that they should not all the time. Anything from social engineering to bog-standard scam artists masquerading as door-to-door salesmen.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#182
post #15

What's with all the XML hate? Of course, doing everything in XML is a stupid idea (e.g. XSLT and Ant) and thanks heaven that hype is over. But if I want something that is able to express data structures customized by myself, usually with hierarchical data that can be verified for validity and syntax (XML Schemas or old-school DTD), what other options are there? Doing hierarchical data in SQL is a bitch and if you wan…

People dislike XML because it's way overkill for %99 of people's use cases but it still gets used anyway! Most people who use it should of been using something simpler like JSON to create their configuration file or return their list of strings in some HTTP API. You can have bloody security vulnerabilities with XML, like you had recently with facebook: https://www.facebook.com/BugBounty/posts/778897822124446

The likelihood of a JSON feature biting you in the ass like that is far lower. Don't use XML until you actually need something XML SPECIFICALLY provides.

Also JSON easily translates with easy to work with dictionaries and lists, XML parsers take more code to work with equivalent items.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#183
post #32

Earlier quoted context omitted.

One of the core aspects of XML that is really important is that no typing is inferred by the structure of the file unlike JSON. JSON is by nature tied to the JavaScript type system which is sparse and inaccurate. For example, if you look at the following: { "name": "bob", "salary": 1e999 } Ah crap! Deserializer blew (in most cases silently converting the number to null) bob 1e999 No problem. The consumer can throw th…

> Ah crap! Deserializer blew (in most cases silently converting the number to null) Right -- the parser blew it. That many implementations do this is frustrating (and caused me so many problems that I ended up building my own validator for problems like this: http://mattfenwick.github.io/Miscue-js/ ). JSON doesn't set limits on number size. From RFC 4627: An implementation may set limits on the range of numbers. It's…

If you're looking for examples of problems, RFC7159 (http://rfc7159.net/rfc7159) is a good place to start - just search for 'interop', as suggested by [1]. A quick look at Miscue-js suggests you already check for most of them, but you might still find something new.

[1] http://www.tbray.org/ongoing/When/201x/2014/03/05/RFC7159-JS...

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#185
post #164

From the comments (Tristan Colgate) : "XML is what you do to a sysadmin if waterboarding him would get you fired. " Made my day :-)

That's just mean. Waterboarding isn't that bad...

But it gets you fired ... on the other end, nobody has ever been fired for using XML.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#187
post #137

Why reinvent on-disk data formats when you can just make a file of protocol buffers? https://code.google.com/p/protobuf/

Ironically that has already been reinvented in the form of Cap'n Proto: http://kentonv.github.io/capnproto/

(other than that I agree it's a good solution)

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#188
post #68

Earlier quoted context omitted.

The equivalent of your XML would be: {"name": "bob", "salary": "1e999"}

I believe that creates a string with the characters "1e999", not the number 1e999.

Exactly.

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#189
post #68

Earlier quoted context omitted.

The equivalent of your XML would be: {"name": "bob", "salary": "1e999"}

I believe that creates a string with the characters "1e999", not the number 1e999.

Same as the XML

Re: Linus Torvalds: “I'm happily hacking on a new save format using ‘libgit2’”

#190
post #132

Earlier quoted context omitted.

You probably know this, but remember that storing user data as code is a place where you (general "you") have to think very carefully about security. Is there any way that arbitrary code in the file could compromise the user's system? If so, does the user know to treat these data files as executables? Is there any way someone untrusted could ever edit the file without the user's knowledge? Even in combination with ot…

This is a good point, but I feel that discouraging this type of approach is not the way to go. I apologise in advance for ranting... I hope this is not too off-topic, but instead a "zoom out" on the issue. This touches on something deep and wrong about how we use computers these days. Computers are really good at being computers, and the amplification of intellectual capabilities they afford is tremendous, but this i…

You're discouraging it in the wrong place.

Learning to swim is not done by throwing a kid in the deep end of a pool. Learning to code is not done by encouraging bad security practices.

Post reply on HN