Statements limit

Hi,

I just found out the existence of statements per frame limit(the only place it’s ever mentioned is in-game guide) and I am worried that it is too low and that statement is not such simple and descriptive quality of program as execution time limit would have been. For example, python generator functions like sum([x*x for x in range(10)]) – are they one statement, or are they are being translated into O(n) with statements with some nasty large constant? I think it might be worse with Clojure.

We haven’t fully figured out what to do with statement counting for non-JS languages, which will probably end up generating more statements than writing JS. We might do a per-language statement multiplier, or we might rework the statement counting to weight statements more according to how long they actually take (so calling distanceSquared() would be cheaper than distance()).

Execution time would be better, but then it wouldn’t be deterministic and would vary widely from system to system. We can eventually make it smarter until it more closely parallels execution time. At least, that’s the hope.

The experimental Python parser doesn’t have list comprehensions done yet in any case, although if you want to help out, it’s over here: https://github.com/differentmatt/filbert

1 Like

Is there a way to look up the statement count of the last chooseAction() spell?

I’m working on re-enabling the stepping and statement counter debug toolbar feature, which should give you lots of information like this.

3 Likes