by scott_s · 15y ago · 0 comments
The parent post was suggesting to replace external calls to Common Lisp with external calls to a library for JSON parsing. In both instances, the text is parsed, and in both instances, it's possible to transform the human-readable data to a convenient-for-C binary format. The parent suggested that calling a JSON library would be faster than Common Lisp - I cannot evaluate that claim, but it may be true.
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. ;)
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.