On Mar 27, 12:37 pm, Michele Simionato <[email protected]>
wrote:
> Consider for instance this example:
>
> $ more test.sls
> (library (test)
> (export x)
> (import (rnrs))
> (define x (/ 1 0)))
>
> The test library here is buggy, because of a division-by-zero error.
> However
> compiling it will not reveal any error :-(
>
> $ ikarus --compile-dependencies x.ss
> Serializing "./test.sls.ikarus-fasl" ...
>
> The error will be visibile only when the library is used (too late!)
FWIW, I have just checked what happens in Python.
$ echo lib.py
x = 1/0
$ python -mpy_compile lib
$ python -c"import lib"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "lib.py", line 1, in <module>
x = 1/0
ZeroDivisionError: integer division or modulo by zero
So, it is exactly the same as in Scheme. The library
is compiled to bytecode without any check, and the
error is discovered at runtime only.
It guess this explain why the compilation is
so fast, the compiler does very little indeed.
All this must be obvious to compiler writers but
I must confess I was a bit surprised as a poor man user.
Michele Simionato