Hacker News new | past | comments | ask | show | jobs | submit login

I don't understand. Lua config is just Lua data structures. Load Lua data structures, modify them directly because they are the language's native data types, serialize them back to text. How much easier do you want it?



What if the file doesn't just contain literal values in the data structure?


Then yer shooting yer own foot. Don’t put functions or expressions in your “Lua-SON” any more than you would in your JSON.

I guess if you lack confidence in your coworkers’ ability to resist temptation, you could write a checker using Metalua. That would make a good git submit hook.

Doing it “wrong” was one of my fav dev tales. I wrote a custom UI system in OpenGL for an iPhone 1 game (memory budget 32mb). Didn’t have time budget to make a visual editor, so I made up a Py-SON notation that simply loaded as Python. From there I used CTypes to convert the Python data tree into binary files full of arrays of C structs. Loading that in C was just fread(), cast a pointer.

The big win came when we realized we had way too much UI to create and not enough artist time to create it. So, another programmer and I sat down and wrote a suite of Python functions that made generating UI components much easier. It required a programmer-artist pair to use. But, otherwise it would have simply been impossible to complete on time.


A plain ASCII text file which doesn't require the user to be familiar with any programming language. The fathers of UNIX postulated that for a reason. It came out of experience.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: