LFortran: GSoC Student Progress (Thirumalai Shaktivel, AST project)

Hello everyone,
I’m glad to be part of the Fortran-Lang community as a GSoC student. I’m looking forward to learning a lot of things this summer. Thank you all for providing me this opportunity.

Also, Congratulation to all the students who got selected for GSoC!!

I created this thread so that I can share the progress of my work during the GSoC period.
Every Friday night, I will be posting about the progress I made this week and what I planned to do next week.
Everyone is invited to review the progress or blog post and I really appreciate for providing the feedback!


I planned to start early!

Headstart is a good sign of success.

Currently, I’m working on the issue #327

This week Progress:

  • Completed Forall Statement.

Upcoming week:

  • Complete “Missing AST nodes”
  • Work on “Refactoring the AST nodes and macros”

Awesome, thank you @ThirumalaiShaktivel. Great job!


Hello Everyone, I’m sharing this week’s progress here!
Working on the issue #327

This Week Progress:

  • Completed BOZ(!935)
  • Completed Attributes(module, pure, impure,…)(!936)
  • Completed Enumeration (!937)
  • Module Nature (Use Statement)(!937)(In progress)

Upcoming Week:

  • Complete Coarrays
  • Complete “Refactoring the AST nodes and macros”

Thank you @ThirumalaiShaktivel ! Excellent progress.


Hello Everyone!
Welcome for Week #3 Progress report
The plan for this week was discussed with the mentor(Ondřej Čertík) which was to implement Coarrays, this was quite challenging too. But thanks to Ondřej sir, who explained each and every step for implementing it. Also, Ondřej sir added a test and parsed some of the syntaxes in the parser, which gave me the confidence to get started with the coarrays, after 2 days of research and implementation I sent the MR, there were some minor corrections as suggested by Ondřej sir. I corrected all the suggestions and now LFortran can parse most of the Coarrays syntax.
The rest of the implementation(Use, derived type, array) was like a piece of cake!

Thank you sir for guiding me in each stages. It was a great help.

Related issue: #327(AST, fmt, parser)

This Week’s Progress:

  • Parse and expose operators(Use, derived type)(!960)
  • Parse, Expose(AST level), and print(fmt) Coarrays (!955)
  • Refactor Subroutine Call(!950)
  • Refactor Derived type, Error Stop, Array initializer (!948)

Upcoming Week:

  • Go over the parser, AST.asdl files, and verify that every nodes are parsed and exposed(AST level) correctly.
  • Crosscheck all the visit functions are added and printed correctly
  • Solve AST related issues

Have a wonderful day
Thank you!


Thank you @ThirumalaiShaktivel! Great progress. The parser is getting very close to complete.


Hello everyone, Welcome!!

Week #4 Progress report

This week was a completely busy week. At first, we(me and Ondřej Čertík sir) planned to execute all the source programs in fpm/src to print as it is, using

$ lfortran fmt filname.f90

After executing more and more programs, we found the missing statements that were skipped while printing(using fmt). After fixing allocate, stars(Co-arrays), defined operator, return (fmt), we started to notice some statements that were not parsed by the parser. In reference to the standards, we implemented some lines in the parser to parse stat, errmsg, until_count, ( Sync all, Event post, Event Wait) Quiet, (Error Stop) assignment and operator (Declaration).

This Week’s Progress:

  • (!962) fmt: print Allocate statment
  • (!963) fmt: print star instead of colon(co-arrays)
  • (!964) Add symbol names to differentiate symbols
  • (!965) AST: Add Stat and Errmsg attributes (Sync all, Event post, Event Wait)
  • (!966) AST: add expression for return statement
  • (!971) AST: Parse Quiet in Error Stop
  • (!972) fmt: print defined binary operator (expression)
  • (!973) parser: parse operator in Declaration
  • (!974) Create a new function, which assigns value to all the elements in the struct

After completing the above implementation, Now LFortran can parse and print most of the source code as it is!! (fmt is not yet completely finished, but the parser is almost completed)
As of now, we executed 2-3 programs from the fpm/src(which it parses and prints correctly), in the upcoming days we planned to complete the fpm programs and move forward.

Upcoming Week:

  • execute all the fpm source programs
  • fmt: print the expressions correctly by removing unwanted brackets
  • fmt: better printing of the strings
  • solve some of the existing issues

[Feel free to provide any feedback, suggestions, and improvements]

Let’s code together, Let’s develop together, Let’s grow together.

Thank you


Great job as always. Thank you @ThirumalaiShaktivel !


Hello Everyone, Welcome back!!

Week #5 Progress report

As I mentioned in the last week’s Upcoming work, I executed all the programs in the fpm/src, and we were to parse and print(fmt), all the statements in the source code! Now only the missing part is parsing the comments and empty lines, exposing them to the AST, and finally printing them using fmt. We are looking forward to start them in the upcoming days!
Some statements were not parsed by the parser, So I started to research about these statements on the internet as well as in the standard. Finally, I was able to parse, expose(to AST) and print(fmt) the code as it is, and yea!! Now LFortran can parse Critica, Data, Common, and Block Data statements.

This Week’s Progress:

  • (!978) Parse Critical statement
  • (!977) fmt: Better printing of strings
  • (!981) Parse Data statement (Declaration)
  • (!979) Add use and import statement for Block construct
  • (!983) Parse Common statement (Declaration)
  • (!982)Parse Block Data statement

Upcoming Week:

  • Parse Empty lines and Comments
  • Solve some of the existing issues

People don’t care about what you say, they care about what you build. - Mark Zuckerberg

Have a wonderful day!!
Thank you


Very good progress. Thank you. We can try to run lfortran fmt again on the fpm source code and see if there are any other issues left to resolve. I can help with tackling of the comments and empty lines.

1 Like