Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.

Note: CTE Cycles

alexrp edited this page Mar 22, 2013 · 3 revisions

Cycles can appear in some places when doing CTE.

Consider:

pub glob foo : int = bar();

pub fn bar() -> int {
    foo;
}

If we're currently evaluating the RHS of a glob or tls, we simply flag any access of that glob/tls as invalid.

There is also the problem of dealing with infinite loops during CTE. Of course, this problem is generally not practical to solve, but what we can do is allow the programmer to specify timeouts for CTE operations. Since Flect is implemented in Elixir, running the CTE interpreter in a separate Erlang process and giving it a timeout is trivial.

The most sensible way to specify a timeout is probably via an environment variable. It would be a bad idea to pretend that the timeout is a build system concern, since whether a timeout is sufficient depends entirely on the machine compilation takes place on.

The default timeout should probably be infinity.

Clone this wiki locally