Re:S-expressions for fun and profit
by jerf on Monday February 21, 2011 @12:06AM
(#2244334)
"But using JSON would have required parsing text in order to load the file."
As others pointed out, this is a silly objection. You still don't need to bring Lisp into your dependency chain. Many JSON libraries will let you serialize straight into a struct you define in C, and if you want to slam the resulting memory to disk and bring it back later, nothing stops you. You get the JSON interpreter for fast turnaround during development and a fast freeze/thaw when you're done and want speed, and the freeze/thaw is adding basically no code.
It won't be hardly any easier in Lisp than it will in C; what you win with an expressive language on a toy problem you'll lose with the impedance mismatch between Lisp and C. You can either write it once in C or twice in C and Lisp.
As others pointed out, this is a silly objection. You still don't need to bring Lisp into your dependency chain. Many JSON libraries will let you serialize straight into a struct you define in C, and if you want to slam the resulting memory to disk and bring it back later, nothing stops you. You get the JSON interpreter for fast turnaround during development and a fast freeze/thaw when you're done and want speed, and the freeze/thaw is adding basically no code.
It won't be hardly any easier in Lisp than it will in C; what you win with an expressive language on a toy problem you'll lose with the impedance mismatch between Lisp and C. You can either write it once in C or twice in C and Lisp.