----boundary-LibPST-iamunique-356969422_-_-
Content-type: text/plain
Wojtek,
You've hit the nail on the head with regard to FORTRAN.
Yes COMMON and EQUIVALENCE are indeed subtle issues.
It is my intent to flag FORTRAN code that does the 'wrong thing' and
simply leave it for hand correction. The rest will be mapped as well as
possible.
Great care will be needed to choose what code should and should not be
translated. That is phase II and phase III of the project.
-Doug
skulski{([at]})nowhere.xy
> Chris:
>
>>I've also been doing some very preliminary work on the same thing. My
>>interest is in a Delphi (a.k.a. Object Pascal) to Component Pascal
>>translator. There are existing Turbo Pascal to Component Pascal,
>>Modula-2 to Oberon, Modula-2 to Pascal translators but a common problem
>>seems to be that they give up as soon as they don't recognise something.
>>I'm not looking for perfection. Basically I only need something that
>>will do 70-90% of the job and just highlight the bits that it doesn't
>>understand.
>
>
> Doug mentioned to me he was thinking of a Fortran-to-CP translator,
> on the premise that having such translator would be politically
> correct for physics. Since I have my own extensive experience with
> Fortran, I tend to be a bit skeptical concerning such a project.
> We in physics used to do lots of low-level dirty tricks using
> COMMON and EQUIVALENCE. These two together serve to overlay variables
> in memory to make type conversions. This is extremely dangerous,
> error-prone, and indeed the common experience is that you can spend
> weeks debugging such things, or even worse, you can be getting wrong
> results for years and never even notice. I vividly remember debugging
> a large theoretical code where I discovered that various coefficients
> were taken from wrong places of memory and thus random and completely
> wrong. Nobody ever noticed because this was a Monte Carlo code, so the
> results always had some random spread. The particular bugs that
> I discovered were in second-order corrections that did not contribute
> much to the result, so nobody noticed this particular part of the code
> was completely wrong.
>
> Fortran programs can be even more interesting. You can check out a
> scientific package named ZEBRA on the CERN web site. It is huge and
> nightmarish, what is even mentioned in the documentation. What this
> library is doing in Fortran, would be unnecessary in CP, Pascal,
> or even C. This library provides memory management for Fortran-77.
> That is, the equivalent for "NEW/DELETE", or "malloc/free". ZEBRA was
> implemented for Fortran-77 using the COMMON and EQUIVALENCE, but boy,
> what a mess! High Energy Physics is full of folklore stories concerning
> ZEBRA and other software based on ZEBRA, such as Physics Analysis
> Workstation (PAW). My friends used to tell me many stories from their
> own experience with ZEBRA/PAW.
>
> I have no idea how you can tell the Fortran-to-CP translator how to
> translate COMMON and EQUIVALENCE. I guess you would need to allocate
> a large [untagged] byte buffer and manually perform all the memory
> management that ZEBRA is doing. However, doing it would be a complete
> nonsense. You would never need to translate ZEBRA into any language
> that has memory management, which ZEBRA is a substitute of. This entire
> huge junk just disappears.
>
> Therefore the only approach that makes sense is to re-engineer this kind
> of legacy software, rather than translate it. This however may be a very
> politically incorrect idea.
>
> Cheers,
> W
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
blackbox-request{([at]})nowhere.xy
To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
owner-blackbox{([at]})nowhere.xy
Current posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-356969422_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFdvanRlayxccGFyDQpccGFyDQpZb3UndmUgaGl0
IHRoZSBuYWlsIG9uIHRoZSBoZWFkIH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