random-state.net

Nikodemus Siivola

<< next | top | previous >>

February 17th 2005 #
random, February 17th 2005

SBCL has always been pretty chatty — not only in terms of efficiency notes, which are generally self-induced by something like (DECLARE (OPTIMIZE SPEED)), but in terms of "normal" COMPILE-FILE output as well. For example, consider the following file:

;;;; sample.lisp
(defstruct bar foo)
(defgeneric foo (x))
(defmethod foo (x) (list 'foo x))
(defmethod foo ((x bar)) (bar-foo x))
(defun bar (x) (make-bar :foo (foo x)))

and the corresponding output under SBCL 0.8.19.19:

; compiling DEFSTRUCT BAR: 
; compiling top level form: 
; compiling top level form: 
; recognizing DEFUN MAKE-BAR
; compiling DEFSTRUCT BAR: 
; compiling top level form: 
; compiling top level form: 
; compiling top level form: 
; compiling top level form: 
; compiling top level form: 
; compiling top level form: 
; compiling top level form: 
; compiling DEFMETHOD FOO (T): 
; compiling top level form: 
; compiling DEFMETHOD FOO (BAR): 
; compiling top level form: 
; recognizing DEFUN BAR
; compiling DEFUN BAR: 
; compiling top level form:

Yikes! However, bleeding edge (0.8.19.30) is rather more discreet:

; compiling (DEFSTRUCT BAR ...)
; compiling (DEFGENERIC FOO ...)
; compiling (DEFMETHOD FOO ...)
; compiling (DEFMETHOD FOO ...)
; compiling (DEFUN BAR ...)

...unless you specifically tell it to report all post-macroexpansion top level forms by :PRINT :TOP-LEVEL-FORMS argument to COMPILE-FILE, in which case it becomes even more chatty then the old one. ;-) Remains to be seen how people feel about this new way of doing things, though: somehow I'm not too confident it will pass unchallenged.