Version 4 of NRE

Updated 2008-03-04 22:25:40 by ms

MS 2008-03-04

NRE is the nickname for Non-recursive Engine, an experimental new implementation of Tcl at [L1 ]. It was announced at [L2 ], a short clumsy description is at [L3 ].

The initial problem NRE is called to solve is Tcl's hungryness for C stack resources, which preempt deep recursion. NRE reduces the C stack consumption very noticeably, essentially making it infinite (recursion depth is bound by the heap not the stack). It also provides an experimental implementation for proper tailcalls - ie, making the recursion depth bound by the electricity supply and/or the lifetime of the hardware.

Exciting further developments are planned, mostly with respect to concurrency concepts.

NRE's first implementation lives in the mod-core-8-3-4 branch at CVS. The new and much improved can be downloaded from [L4 ], a specific wiki is also maintained there.


Showing off - on a 256kB stack (128kB crashes on startup):

 mig@uh:/home/CVS/fossil/tcl/unix$ ulimit -s 256
 mig@uh:/home/CVS/fossil/tcl/unix$ ulimit -S 256
 mig@uh:/home/CVS/fossil/tcl/unix$ ./tclsh
 % proc a i {if {[incr i] > 50000} {return $i}; a $i}
 % a 0
 too many nested evaluations (infinite loop?)
 % interp recursionlimit {} 10000000
 10000000
 % a 0
 50001