[Lazarus] Project conversion Delphi -> FreePascal: success!
brian
brian at meadows.pair.com
Sat Jan 8 15:22:12 CET 2011
On 01/05/2011 10:18 PM, waldo kitty wrote:
> On 1/5/2011 12:33, Micha Nelissen wrote:
>> Bo Berglund wrote:
>>> 2) The fortran code failed to translate when it turned out that
>>> Fortran could change the type of a matrix multiplication depending on
>>> the dimensions of the two input matrices.
>>
>> You couldn't translate the code or the function declarations?
>> Calling the
>> fortran code from freepascal might be possible, then you don't have
>> to translate
>> the code itself, just call it.
>
> this was discussed but IIRC it seemed that determining the proper
> calling procedures came up... if the library wasn't callable in
> "pascal" or "C" format or some such... one would need to be able to
> compile those libraries in a FPC/Lazarus compatible format for the
> ""normal"" callouts (is that the proper term) to work... since this
> was hard to do (ie: no compiler with this capability??) it was looked
> into that those routines could be recoded in pascal format... this too
> has not been able to be done because there's no available FORTRAN <->
> PASCAL coder who can make the conversion...
>
Many moons ago, when I was writing projects in both FORTRAN and Pascal
on a DEC PDP-11, the limitations of the hardware were such that we
used to have to compile to assembler and then patch breakpoints into
the code in order to debug it.
Things have almost certainly changed since those days, but I do
remember that while the Pascal compiler we used pushed and popped
parameters via the stack, as you would expect, the FORTRAN compiler
instead pointed a register at a parameter list in memory.
The compilers then were DEC's FORTRAN-IV-PLUS and Oregon Pascal, which
DEC later bought and renamed RSX Pascal.
I also had to do some digging into assembly language listings from
Hewlett-Packard's FORTRAN-1000 compiler running under RTE-A, and found
that used the same technique, passing a pointer to a parameter list
via a register.
This is all ancient history now, I'm talking about back in the 1980s,
but it may be relevant to doing parameter list conversions. I don't
know how much of my FORTRAN I can remember, but I do know that
mismatched COMMON blocks were a superb way of having your program
disappear up its own CPU stack, I ended up putting in place a standard
whereby all COMMON blocks had to be declared in an INCLUDE file, so
that there was no possibility of mismatches.
FORTRAN's parameter and type checking made C (note, no ++) look good.
Brian.
More information about the Lazarus
mailing list