Live data from Hacker News

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

plus.google.com

101–110 of 265 posts

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

#101

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

So, it's similar to JSON (JavaScript), but valid Lua syntax.

  local t = {}
  t = {["foo"] = "bar", [123] = 456}
  t.foo2 = "bar2"

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

#102
post #24
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…

If used sensibly XML isn't too bad. But there's a whole lot of cruft in the standard that seems to do nothing except make it harder to use. Part of this is a problem with popular libraries rather than inherent to the format, but we judge a thing by its ecosystem rather than in isolation. So: namespaces are a pain, making it much harder than it should be to just make my xpath work. DTDs are annoying, especially when a…

> So: namespaces are a pain, making it much harder than it should be to just make my xpath work.

Namespaces exist to solve a real-world problem that happens in real-world use cases (SVG embedded in HTML, HTML embedded in RSS). While it would be nice to look at things that are complex and say "it would be less complex for these trivial cases without this feature", in reality there are then common use cases that become more complex or even impossible in the general case, which seems like a very short-sighted benefit. Namespace prefixes are really not that difficult to configure, and once configured XPath makes them very easy to use :/.

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

#104
post #89

Earlier quoted context omitted.

XML is unnecessarily verbose, for the supposed sake of human readability. But used as a serialization format, it isn't really readable or editable by humans (except in the sense that a Turing machine is programmable): remember that the ML in XML stands for "markup language", and SGML, its predecessor, was designed as a way of marking up normal text, not littering data with angular brackets and identifiers. (XML/SGML…

> the problem is that XML has prevented the adoption of something better What would be better?

I'm a fan of edn myself. https://github.com/edn-format/edn

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

#105
post #85
post #58

Earlier quoted context omitted.

Yes, because his design of git was so well-formed. Git is so well-designed that expert users manage to trash their repositories and propagate the damage. Maybe that's not a problem of libgit. But tools are both the infrastructure and the UI.

Not sure what you are referring to. What are some common ways "expert users" manage to "trash their repositories?"

Let's start here: http://randyfay.com/content/avoiding-git-disasters-gory-stor...

So, the solution to the fact that the merging UI is a pile of garbage is HAVE A SINGLE PERSON ALWAYS DO THE MERGE. Excuse me? The whole point of a distributed revision control system is so I don't have to have a single choke point. That's the definition of distributed.

Then there was the KDE disaster: http://jefferai.org/2013/03/29/distillation/

Yeah, the root fault wasn't Git. However, at no point did Git flag that something was going horribly wrong as the repository got corrupted and deleted. Other distributed SCM systems I have used tend to squawk very loudly if something comes off disk wrong.

Maybe the underlying git data structures are fine, but, man, the UI is a pile of crap.

And, I won't even get into rebase, because that seems to be a religious argument.

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

#106
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…

I think it's refreshing to hear someone advocate XML instead of JSON, specifically because you bring up a good point. The problem I think is that just because XML is human-readable, it's less sufficient as a format that is human-writable (I'm looking at you, Maven!). I believe this is the root cause that many people hate XML, even though it has a very sweet spot in application-to-application communication.

I would even argue that XML is not even that human-readable. Take a look at this pom: https://maven.apache.org/pom.html#The_Super_POM . Even with syntax highlighting it is extremely difficult to parse visually. Compare that to nginx's custom config file format: http://wiki.nginx.org/FullExample .

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

#107
post #49

he talks about a save file format, not a file system. or do we have different concepts of "file system"?

I agree it's confusing, I think the submitter just meant "system for files" or something.

That would be excusable if we were talking abuot somebody who writes higher-level programs that would be excusable, but not for a kernel developer.

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

#108

On the game I'm currently working on, it's built very heavily around Lua. So for the save system, we simply fill a large Lua table, and then write that to disk, as Lua code. The 'save' file then simply becomes a Lua file that can be read directly into Lua. This is absolutely amazing for debugging purposes. Also you never have to worry about corrupt save files or anything of it's ilk. Development is easier, diagnosing…

I've had to write output save file formats for various projects on several occasions, and it never occurred to me to take this approach.

Thanks for sharing this, it's one of those ideas that (to me) seems so brilliant in its simplicity that I probably would've never thought of it.

Any hiccups in the day-to-day work using this approach? I'm just trying to get a better idea of the workflow since I'm very seriously considering applying it to my next project.

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

#109
post #5

I just realized that Linus' posts are the only reason I ever go to Google Plus.

Linus : G+ :: notch : Java

That's unfair. Lots of infrastructural projects are done in java. E.g. my personal favorite: lucene (+ solr, elasticsearch).

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

#110
post #105
post #85

Earlier quoted context omitted.

Not sure what you are referring to. What are some common ways "expert users" manage to "trash their repositories?"

Let's start here: http://randyfay.com/content/avoiding-git-disasters-gory-stor... So, the solution to the fact that the merging UI is a pile of garbage is HAVE A SINGLE PERSON ALWAYS DO THE MERGE . Excuse me? The whole point of a distributed revision control system is so I don't have to have a single choke point. That's the definition of distributed . Then there was the KDE disaster: http://jefferai.org/2013/03/29/di…

I'm not sure I follow. The advice for the "single person always do the merge" is essentially make sure the people doing the merges are experts. These mistakes do not seem like the kind of thing I have heard of experts doing.

Seriously, you can not call yourself a git expert, if you think rebase is a difficult thing to explain.

Might you sometimes make mistakes? Sure. I hardly see this as a systemic thing, though.

The mirror shenanigans I agree suck. Not sure what the real takeaway is there, other than don't rely on mirror as a good form of backup.

Post reply on HN