Live data from Hacker News

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

plus.google.com

211–220 of 265 posts

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

#211

Earlier quoted context omitted.

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

Same as the XML

I don't think XML does either by itself. The schema will determine which fields are parsed as strings and which are parsed as numbers.

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

#212

Earlier quoted context omitted.

>There really is no "better way" -- if JSON was executable then calling such an API would literally be giving it full control of your app and of the user's computer. Of course there's a "better way": running the code in a sandbox. You could do so using js.js[1], for example. (Of course, replacing a JSON API with sandboxed JS code is likely to be a bad idea. But it is possible.) [1] https://sns.cs.princeton.edu/2012/0…

You're right inasmuch as I shouldn't have implied that unsandboxed interpretation is the only option. But my larger point still stands; the fundamental tradeoff is still "power of the payload" vs "guarantees to the container." Even in the case of sandboxed execution, the container loses two important guarantees compared with non-executable data formats like JSON: 1. I can know a priori roughly how much CPU I will spe…

I agree 100% with you, but #1 isn't completely true. The counterexample is the ZIP bomb (http://en.wikipedia.org/wiki/Zip_bomb) Whenever you unzip anything you got from outside, you should limit the time spent and the amount of memory written.

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

#213
post #180
post #149

Earlier quoted context omitted.

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

Perhaps modern operating systems (or hardware?) need two modes - "Safe mode", where everything is sanitised, checked, limited and Secure Boot-style verified, and "Open mode" where it's not; where experts and enthusiasts can work without limit and without DRM.

Safe mode is called iOS

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

#214

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…

While one could say that this is about savefiles for games, I would say it's implications could more be about savefiles for software projects. If you are building the game in LUA, of course LUA is going to be the preferred way to save your game in since you are already using LUA objects and interpreting files in that language will be easy to integrate.

If you ever used maven xml configs, java object marshalling or c# xml you would understand the pains of using xml as a file format for software projects and data representation. You have to find a solution that is language agnostic, neither LUA or JSON is.

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

#215
post #181
post #149

Earlier quoted context omitted.

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.

But in 'meat space', it is way harder and more expensive to do evil against large numbers of people. For example, phishing as done electronically (throw a very, very wide net, and hope) doesn't make economical sense if one had to do it manually.

Also, if, for example, cars and airplanes and banks and nuclear submarines would accept executable code as input, some people would do damage on a gargantuan scale.

Clearly, being liberal in what you accept must end somewhere. I argue that it should end very, very soon. Even innocuous things such as "let's allow everybody to read the subject of everyone's mail messages", if available at scale and cheaply, would entice criminal behavior, for example by those mining them for information that you are away from home.

Does anybody know how RMS thinks about passwords nowadays?

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

#216

Earlier quoted context omitted.

If excess CPU/non-halting behavior is the issue, you could run the code with a timeout.

You could. But that has downsides also: 1. imposing CPU limits incurs an inherent CPU overhead and code complexity. 2. if those limits are hit, you can't tell whether the code just ran too long or whether it was in an infinite loop. So now if we fully evaluate the options, the choice is between: 1. A purely data language like JSON: simple to implement, fast to parse, decoder can skip over parts it doesn't want, etc.…

I have to agree here. General Turing-completeness was known from the beginning to imply undecidable questions -- about it's structure, running time, memory and so on. I don't think this has a place as the 'data'.

Abstractions exist for a reason -- this is analogous to source/channel coding separation or internet layers. They don't have to be that way, but are there for a reason.

Someone could change my opinion, though. Provide me a data format which proves certain things about it's behavior and that would be a nice counterexample.

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

#217
Why not sqlite or sexpressions? Linus states that databases can't hold previous state but that's not really true...

I'm not sure why git is the best tool for the job in this case, even after reading the post & some of the contents.

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

#218
post #178
post #151

Earlier quoted context omitted.

And what about the people competing against the happy cheater?

in a single player game with save games on local disk? this question is nearly trolling.

Some people do compete for speed or score in single player games. Arcade games have always had scoreboards, modern "arcade-style" games have online ones, and a community can turn any solitary activity into a competitive one:

http://speedrunslive.com/

http://speeddemosarchive.com/

Speedrunners are an exceptional case, but I think everyone gets a little annoyed when they look at a leaderboard and all the top players have scores of UINT_MAX or times of 0 seconds.

Obviously cheaters will find a way regardless of whether you give them the source code or not, I'm just saying dfc's concern is not totally ridiculous.

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

#219

Earlier quoted context omitted.

Preach it. My favorite persistence code: stuff that has nothing to do with SQL/NoSQL. I leaned heavily on Python's pickle module for serializing a few thousand entities to disk a few years ago. By streaming them to the application at startup time, it remained plenty fast for all datasets it'd encounter. I intended to replace it with SQLite one day, but I never had to. I could just keep them all in memory. I'd probabl…

I used to do that, but pickle bit me once. I think it changes between versioning or something. I had to start the statistical model from scratch.

Yeah, I wouldn't use pickle for anything where backwards or forwards compatibility is important. It is however very convenient for 'I want to send/store this data for a bit' tasks.

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

#220
post #181

Earlier quoted context omitted.

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.

But in 'meat space', it is way harder and more expensive to do evil against large numbers of people. For example, phishing as done electronically (throw a very, very wide net, and hope) doesn't make economical sense if one had to do it manually. Also, if, for example, cars and airplanes and banks and nuclear submarines would accept executable code as input, some people would do damage on a gargantuan scale. Clearly,…

I'm not saying that scams in "cyberspace" don't present a greater threat than scams in "meatspace". I'm just pointing out that if you cannot protect people from themselves in "meatspace", then doing it in "cyberspace" is futile. You can fight it and cut back on it, but you will never actually win that fight. Technological problems to what is ultimately a sociological problem only go so far, and we should be careful to not obsess over them to a fault.
Post reply on HN