----boundary-LibPST-iamunique-1898131134_-_-
Content-type: text/plain
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-1898131134_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIENocmlzOlxwYXINCj4gSSd2ZSBhbHNvIGJlZW4g
ZG9pbmcgc29tZSB2ZXJ5IHByZWxpbWluYXJ5IHdvcmsgb24gdGhlIHNhbWUgdGhpbmcuIE15XHBh
cg0KPiBpbnRlcmVzdCBpcyBpbiBhIERlbHBoaSAoYS5rLmEuIE9iamVjdCBQYXNjYWwpIHRvIENv
bXBvbmVudCBQYXNjYWxccGFyDQo+IHRyYW5zbGF0b3IuIFRoZXJlIGFyZSBleGlzdGluZyBUdXJi
byBQYXNjYWwgdG8gQ29tcG9uZW50IFBhc2N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