5 ms·
The distinction I'm trying to make is between parsing the text once (using a compiler-like utility which is separate from the game runtime) then shipping the "c
by ginsweater 16y ago
The distinction I'm trying to make is between parsing the text once (using a compiler-like utility which is separate from the game runtime) then shipping the "compiled" binary format, versus shipping the text file and parsing it every time it's loaded by the game.
I took the parent post to be suggesting linking JSON into the game and parsing on each load -- IMO, the separate-data-compiler approach is superior for large projects, as it speeds up loading by a couple orders of magnitude. That's what I was trying to say.
(On the other hand, linking the entire Common Lisp runtime into your game just to load text files is a terrible idea. Obviously JSON is better for runtime parsing, but I don't think that's what the author is doing.)
So, if you then ask what language the separate data compiler should be written in, it seems like Lisp is a nice approach since it has a nice native object format with a built-in parser. Presumably you could also write it in JavaScript or some other language with excellent JSON support (Ruby? I'm getting outside my expertise here) and get a similar benefit vis-a-vis not having to write a parser.
Edit: I'm betraying my C heritage by saying "linking the Common Lisp runtime." Does that make any sense at all? Assume I mean some viable method of shipping Lisp with the game and making external calls to it somehow. ;)
- scott_s 16y agoI understand what you're saying, but I think you're unnecessarily conflating two orthogonal concepts: how the human-readable data is parsed, and whether the shipped game uses that process or loads a binary format. Jerf's post made no mention of changing the second concept, only the first.
- ScottBurson 16y agoMost Common Lisp implementations are not designed for linking into another program, but there is one that is, called ECL (Embeddable Common Lisp).
- bayareaguy 16y agoPresumably you could also write it in JavaScript or some other language with excellent JSON support No surprise since JSON (aka JavaScript Object Notation) was designed for interpretation by JavaScript and subsets can also be directly interpreted by languages like Python.