|Fortran to VB translator - an update firstname.lastname@example.org (Paul Robinson) (2004-08-05)|
|Fortran to VB translator - an update email@example.com (Paul Robinson) (2004-08-09)|
|Re: Fortran to VB translator - an update firstname.lastname@example.org (Nick Roberts) (2004-08-09)|
|From:||"Nick Roberts" <email@example.com>|
|Date:||9 Aug 2004 01:11:50 -0400|
|Posted-Date:||09 Aug 2004 01:11:50 EDT|
On 5 Aug 2004 14:24:01 -0400, Paul Robinson
> A few weeks ago I mentioned I am working on a Fortran to VB translator
> because of a contract I accepted. Some people commented to me (in a
> polite way) that I was crazy for taking on an impossible task (since
> the first Fortran compiler took 18 man years), someone pointed out
> that the current program around doing Fortran is something like 27,000
> lines of C code, and some said if I'm doing this comprehensive a
> project I should be charging hundreds of thousands of dollars based on
> the time involved.
> Maybe it goes to show that sometimes when you don't know it's
> impossible you can get some really great things done!
I'm impressed, and I think you can take it for granted that everyone
else reading this news group is, too.
This is the kind of project I would use a language such as Prolog to
The basic approach, I think, would be to write two (hopefully quite
simple) programs in an imperative language (e.g. BASIC): (a)
translates the input source (FORTRAN programs) into a series of Prolog
terms; (b) reads a series of Prolog terms and translates them into the
output (VB programs).
This then provides the basis to write a Prolog program which reads
terms from (a), does all the necessary manipulation (using a set of
rules), and outputs the result to (b).
Fortran --> (a) --> Prolog --> (b) --> VB
DO I 1,10,100
X = X + A(I)
might be serilaised into the terms:
then there might be a Prolog rule:
which might then generate the terms*:
which would then be output as:
FOR I = 1 TO 10
Hopefully this gives a flavour. Just musing really.
*To be honest, the output might be uglier than this, but it doesn't
[I'd probably do it in perl. Fortran and VB are semantically close enough
that you can often transliterate expressions and get away with it. -John]
Return to the
Search the comp.compilers archives again.