[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua is too big
- From: Sean Conner <sean@...>
- Date: Wed, 11 Jun 2014 13:26:47 -0400
It was thus said that the Great Thiago L. once stated:
> The Lua VM is too big. I have an idea of how to make it smaller, with 2
> breaking changes and 2 backwards-compatible changes:
> Breaking changes:
> 1. Remove OP_ADD (use `-(-x-y)` instead) [breaks/removes `__add` metamethod]
> 2. Remove OP_MUL (use `x/(1/y)` instead) [breaks/removes `__mul` metamethod]
Still too many left.
> Compatible changes:
> 1. Turn for loops into syntax sugar, remove OP_FORPRER and OP_FORLOOP
> (which can be used to break out of sandboxes), OP_TFORLOOP (the opcode
> for `for ... in ...`) 
How can you escape from a sandbox using OP_FORLOOP?