[plt-scheme] dead code elimination/closure optimization?

From: Dimitris Vyzovitis (vyzo at media.mit.edu)
Date: Sat Apr 7 20:30:35 EDT 2007

Does the bytecode compiler or the jitter do dead code elimination for

For example in
(let ((foo (lambda () ...))) body ...)
where foo is not referenced in the body (other than perhaps in in
turn unreferenced macros), is the lambda closure construction and variable
assignment code present in bytecode and ultimately in the
code generated by the jit?

What about
(letrec ((foo (lambda () ... (set! foo ...) ...))) body ...) with
similar body conditions for foo?

-- vyzo

Posted on the users mailing list.