On 27.03.2012 1:07, Timon Gehr wrote:
On 03/26/2012 09:10 PM, Dmitry Olshansky wrote:
Speaking more of run-time version of regex, it is essentially running a
VM that executes instructions that do various kinds of match-this,
match-that. The VM dispatch code is quite slow, the optimal _threaded_
code requires either doing it in _assembly_ or _computed_ goto in the
language.
Language-enforced tail call optimization would probably work too.
Indeed it would.
I recall being close to that observation, when I pictured a feature like
guaranteed non-return function call, a-la:
void foo()
{
...
goto fn(); //can safely overwrite foo's stack frame
//never gets here
}
kind of unix exec for functions.
--
Dmitry Olshansky