[Ecls-list] ECL shootout
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Fri Jun 26 15:10:48 UTC 2009
On Thu, Jun 25, 2009 at 5:59 PM, Marko Kocić<marko.kocic at gmail.com> wrote:
> Seems like ECL doesn't understand (declare ((simple-stream fixnum (*))
> a b c) as in SBCL but it works as (declare (type (simple-stream fixnum (*)) a b c).
(DECLARE (type-name VAR1 VAR2 ...)) only works for Common Lisp simple
types, not compound types and not in this case it was not
SIMPLE-STREAM (which does not exist as such), but SIMPLE-ARRAY.
Instead you should use the standard form (DECLARE (TYPE...)) as you
found out.
> Also, when compiling from outside of ECL REPL error message is not
> displayed in output. When compiling from REPL, on compilation error
> debugger is started with error message.
True. There were a couple of problems with compiler errors and its
handling. I have done two things. One is to commit seven changes to
ECL, that go from the way it sets up error handlers for the compiler,
to the way the toplevel intercepts conditions. In addition I attach to
this email a couple of changes to your shootout code.
> BTW: Shootout guys seems to not want to add ECL to benchmarks.
> Anyways, my code is still on github.
What was the argument? I do not care much, though, that it is
shootout, but some kind of benchmark should be set up so that we can
keep track of the effect of different code changes.
Juanjo
diff --git a/compile.lisp b/compile.lisp
index 00ab8b5..b7aff43 100644
--- a/compile.lisp
+++ b/compile.lisp
@@ -1,6 +1,27 @@
(require 'cmp)
(defun create-exec (file)
- (c::builder :program file
- :lisp-files (list (compile-file file :system-p t))
- :epilogue-code '(resume)))
+ (flet ((warn-or-error (c)
+ (format t "~&An error occurred while compiling ~A:~%~A~%"
+ file c)
+ (unless (typep c 'c::compiler-note)
+ (format t "~&Exiting")
+ (return-from create-exec nil))
+ nil)
+ (foo (c)
+ nil))
+ (unwind-protect
+ (with-compilation-unit (:override t)
+ (handler-bind ((error #'warn-or-error)
+ (warning #'warn-or-error)
+ (condition #'foo))
+ (multiple-value-bind (object warnings-p notes-p)
+ (compile-file file :system-p t)
+ (if object
+ (c::builder :program file :lisp-files (list object)
+ :epilogue-code '(resume))
+ (format t "~&ECL failed to compile ~A" file)))))
+ (format t "~&Unexpected exit from CREATE-EXEC"))))
+
+
+
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
More information about the ecl-devel
mailing list