[Ecls-list] Phase 1 of compiler rewrite finished

Juan Jose Garcia-Ripoll worm at arrakis.es
Mon Oct 13 03:24:01 UTC 2003


Dear all,

I have now finished rewriting the Lisp->C translator so that the intermediate 
forms (C1FORMS in ECL speak) with which the translator represent lisp code, 
are now structures.

The goal is to make the translator more readable and maintainable, so that a 
proper type inference scheme can be implemented. Eventually this should also 
result in some documentation of the internals being written.

I have verified that the C code produced for ECL and some other projects 
remains the same, but there might be still some obscure spots where the old 
list format was assumed. Please report any failure to compile/execute your 
code.

Known bugs of the compiler:
* Some bignum integer operations are producing wrong results, probably due to 
an eager unboxing of variables
* Substitution of variables also fails when the variables are captured by a 
local function, as pointed out by Paul Dietz long ago. I am currently working 
on this. A sample of code which is not properly compiled:
	(defparameter *f*
	   '(lambda (a)
	      (flet ((%f8 nil (setq a 0)))
	        (let ((v9 a)) (- (%f8) v9)))))
	(print (funcall (compile nil *f*) 1))        ;; ==> 0 (incorrect)
	(print (funcall (eval `(function ,*f*)) 1))  ;; ==> -1 (correct)
This is due to V9 is being replaced with A inside the LET, which isn't
correct here.

Regards,

Juanjo





More information about the ecl-devel mailing list