lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> -----Ursprüngliche Nachricht-----
> Von: lua-l-bounces@lists.lua.org <lua-l-bounces@lists.lua.org> Im Auftrag
> von Jim
> Gesendet: Freitag, 14. September 2018 21:57
> An: Lua mailing list <lua-l@lists.lua.org>
> Betreff: new thought experiment: what would you add to Lua ?
> 
> i would add support for binary and octal integer literals like
> 0b1001011 or 0o0755 as in Python and Ruby.
> 
> octal integer literals are helpful when working with unix (file)
> modes/permissions (which i do frequently).

I know, it's actually not really a langauge feature, but I'd like to say that one of the extremely few things I miss in Lua is an integrated preprocessor to be able to completely remove parts of the code during compilation so it does not create any runtime cost at all.

Hardware these days is so fast, it's even quite possible to write reasonably complex games using Lua. But many games (and of course all kinds of other software, but I'm a game developer) have some kind of time critical inner loops where a single function call or a few if/elses are a real burden on the overall performance. F.i. during the last 2 weeks I primarily optimized the maphandling/rendering/sorting of the iso city builder I'm working on, and did so using some reasonably complex implementations where I just need to do lots of stuff per tile for all visible tiles per frame.
Especially during optimization, as I rely on some hairy edge cases, I added assertions all over the place, but at some point it's just required to remove/comment them all out as it's simply not an option to not remove them (it's ok to develop new features with small datasets, so performance is not an issue, but with actual realworld data, it is).

Of course I can just use any generic preprocessor but this makes things much more complex and even more so, if you're using a premade engine/framework with integrated editors. Also if it's not a standard, it won't be supported by any code editor and will result in all kinds of "problems" caused by the syntax highlighting, autocomplete etc. functionality.