Hacker News new | ask | show | jobs
by judofyr 4844 days ago
It's really annoying when you're working with JSON though. I've used some Lua libraries (the OpenResty stack) where it's close to impossible to generate "[]" because there's no difference between arrays and hashes (and thus an empty table gets converted to "{}").
2 comments

Well JSON does assume JavaScript semantics, so this type of issue crops up a lot with lots of languages. You should be able to define an arbitrary value that is used as [] by the library fairly easily, or a property of the table.
How was your experence with OpenResty btw? It looks like a really interesting project.
I think it sorely needs a framework on top that handles and generates the nginx.conf. There's quite a bit "hacking" to get every piece to work with each other (e.g. to talk to a database in Lua it needs to be configured in nginx.conf).

But all in all it's surprisingly effective.