On Sunday, 15 May 2016 at 10:29:21 UTC, Martin Nowak wrote:
On 05/10/2016 08:45 AM, Jacob Carlborg wrote:
I was listening to a discussion Don and Daniel had about the
current implementation of CTFE. They talked about using a byte
code interpreter. Even implementing a really crappy byte code
interpreter would be a huge improvement.
No need for a byte-code interpreter, it mostly just adds
overhead and complexity over an AST interpreter. If you want to
go really fast you need some sort of JIT anyhow, but a proper
interpreter will be orders of mangnitude faster than the
current implementation.
I might refer you to
http://dconf.org/2013/talks/chevalier_boisvert.pdf
page 59 ff.
+1 . One need to walk the tree anyway to generate bytecode, which
makes it impossible to make it faster for a one time execution.
For frequent executions, then a JIT is preferable, which let the
bytecode the favorite choice for more than one, but not too many
executions.