I haven't looked at f2cl recently but I remember also
looking at a
complete fortran compiler for the symbolics lisp machine.
It had the peculiar feature of infinite-size integers.
The difficulty f2cl faces is that it is in general impossible to use lisp
functions in the normal way (call by value), and so
the fortran calls must be simulated by some kind of
different mechanism.
f2cl tries to simulate this by changing call foo(a,b,c)
to
(multiple-value-setq (a b c) (foo a b c))
and having foo return 3 values. This is call by value-return,
which is ordinarily acceptable as fortran semantics.
But this does not support array slices. e.g. fortran
dimension a(400)
...
call foo(a(300))
gives foo access to a 101 element array, a(300) to a(400).
Linear algebra programs do this frequently, making translation
of BLAS code via f2cl using this mvsetq trick impossible.
Fortran arrays have no headers. In fact, fortran memory is a huge
array, and variables are indexes into it. So the
resulting lisp code for, say x=y+z officially should
look like (setf (aref mem x_offset)(float+ (aref mem y_offset)(aref mem
z_offset)))
When the fortran system probably has x,y,z in registers,
it is a lot faster. If you write the lisp code as (setf x (+ y z))
it might work but it is not exactly the same.
There may be other screw cases for f2cl other than array slices.
And f2cl only claimed to be a partial translation.
Maybe things have changed though and f2cl does more now?
RJF
>