4 ms·
No, it wouldn't be saner. You're completely ignoring memory allocation concerns. You should almost never reach 2048 values on the stack to begin with. It's inte
by andrewmcwatters 8y ago
No, it wouldn't be saner. You're completely ignoring memory allocation concerns. You should almost never reach 2048 values on the stack to begin with. It's intentionally arbitrarily high.
Reviewing the commit in question: you have a function that blindly accepts any number of arguments. ~2047 arguments in a function is not an acceptable design choice for Lua. I can't see any language where I'd design an API for users where they could insert an upwards of ~2047 arguments and say to myself that's a good idea.
Your misuse of the Lua C API here does not grant a special use case, nor does it justify entire language implementation changes.
Your number one concern for hardening starts at the stack? And further more you think it's a good idea to compile a custom version of Lua it to avoid stack issues instead of just writing sane bindings? You would really go out of your way to do this?
Maybe instead of saying there's a problem with X, Y or Z, ask yourself if you're doing something wrong first.
Allow developers to pass in a table of values to pack instead of an arbitrary amount of arguments, push the values by index onto the stack, work with them, then pop them off. How is this difficult? What makes your use case special? Why would you avoid conventional Lua use?
vararg (..., select, {...} convention) usage in Lua almost always involves the use of tables.
- munificent 8y agoYour aggressive, insulting communication style is making you less effective and undermining your own goals with communicating.
- andrewmcwatters 8y agoI'm fully aware of the tone I'm passing off: take it or leave it. I have no vested interest in this. I'm simply a gawking spectator. Learn to accept input from others who don't give it to you on a silver platter. The otherwise timid and passive voice on HN is frequently an irritation to me. This is the author of Redis making an uninformed decision in both writing Lua bindings, and extending that ignorance to making changes to Lua to suit his ignorance. I don't care. What my tone is suggesting is how ludicrous this is and how it shouldn't be taken as a good suggestion. This is a great example of someone who has a large exposure simply using something incorrectly and him having a large exposure doesn't make his technical observations of a language meaningful. In no way here can you leverage that to justify poor decision making.