Skip to content

eschnett/Fortran.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fortran.jl

Execute Fortran code from Julia.

  • Documenter
  • GitHub CI
  • Codecov

(This project is at the moment just a proof of principle.)

The ultimate goal is to have a parser that reads Fortran code and generates Julia code (i.e. Julia expressions) from them. This would allow a seamless integration of Fortran and Julia code, and might even make it easier to convert Fortran code to Julia.

To achieve this goal, three major pieces need to exist:

  • A Fortran parser that generates a Fortran abstract syntax tree
  • Defining a Fortran machine, and a pass that converts the abstract syntax tree to the Fortran machine tree
  • A Fortran "compiler" that converts the abstract machine to Julia.

Writing a parser for Fortran is a well-understood problem. The Fortran standard defines the language well, and this part of the probme is thus "straightforward but tedious".

This project here takes the first steps towards defining a Fortran machine. So far, very little is supported -- you can define functions that use scalar variables and perform simple arithmetic, as well as loops and if statements.

Finally, converting the Fortran machine tree to Julia is also straightforward since Julia is a lispy language, and thus generating Julia code in Julia is well supported.

Related Projects:

About

Execute Fortran code from Julia

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages