4 ms·
That's a good idea. (I am writing Chrysalis/Stencil). The current design is that there is a code-generator that outputs javascript which can be run on either si
by DanWaterworth 16y ago
That's a good idea. (I am writing Chrysalis/Stencil). The current design is that there is a code-generator that outputs javascript which can be run on either side. But outputting Lua instead for the server-side would seem possible.
- silentbicycle 16y agoAlso, compiling to Lua is not a bad option. Its syntax (http://www.lua.org/manual/5.1/manual.html#8 http://www.lua.org/manual/5.1/manual.html#8) is quite straightforward, and it's designed to compile rapidly (due to using table as a JSON-like serialization format). While writing out a (kinda silly) benchmark a while ago, it struck me that, while Python's compiler is rather slow, Lua's has very little impact on the overall runtime. Between that and the lack of weird corner cases in the grammar, I'm reasonably comfortable doing string-eval metaprogramming in Lua, something I would never do in Python. Benchmark (http://news.ycombinator.com/item?id=1800396 http://news.ycombinator.com/item?id=1800396) and commentary (http://news.ycombinator.com/item?id=1804166 http://news.ycombinator.com/item?id=1804166).