On Fri, Jul 3, 2009 at 4:18 AM, Steve Bennett stevagewp@gmail.com wrote:
On Fri, Jul 3, 2009 at 7:38 AM, Brion Vibberbrion@wikimedia.org wrote:
Since iteration over a set is frequently desired/needed, assume it will exist in a sensible programming language.
As already noted in this thread, horrible hacks for limited-depth looping are already in use.
So:
- The chosen language will support iteration over finite sets
- Could it support general iteration, recursion etc?
- If so, are there any good mechanisms for limiting the
destrutiveness of an infinite loop?
That is, is it practical to say "you can iterate all you like, but you're only getting 10ms to do it"? Sounds like it could be an interesting property of a template, where a suitably authorised person could allow certain templates longer execution times.
another option, is to use a compiled language to a intermediate languaje that is interpreted. make so the interpreted for a program has a number of instruction limit. Say.. .a budget of 90.000 opcodes. If a script break that barrier, is stoped (the interpreter "return;") and the script is marked as "dirty".
bad example follows: QuakeC is compiled to QC (a fake aseembler lang) this is interpreted by QCVM (the quake virtual machine). The interpreter include some limitations (on stock QCVM, the deep of recursion ).
A good side effect of this, is that a Quake mod work on any OS.
Trivia: Quake3 and others have a setup like this one, but using C. It probably is not useable for Wikipedia, since C is bad lang to work with strings. Too bad, because is fast, crossplatform, there are lots of tools to work with it, and existing programmers.