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!

11 Likes

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”
8 Likes

Awesome, thank you @ThirumalaiShaktivel. Great job!

2 Likes

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”
7 Likes

Thank you @ThirumalaiShaktivel ! Excellent progress.

3 Likes

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!
-tsv

8 Likes

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

3 Likes

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
-tsv

6 Likes

Great job as always. Thank you @ThirumalaiShaktivel !

3 Likes

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
-tsv

2 Likes

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

Week #6 Progress report

Worked on the issue #359

This Week’s Progress:

  • fmt: Print struct member correctly (Name)(!995)
  • fmt: Print struct member(fnarg)(SubroutineCall)(!994)
  • fmt: print ::(double colon) only for more than one symbols(import)(!992)
  • Parser: Parse <= as LTE(which was GTE earlier)(!993)
  • fmt: print do_loop label(!987)
  • Parse Declaration attributes(!984)

Upcoming Week:

  • Execute Some Fortran Source code
  • Work on Comments and Newlines
  • Solve some of the existing issues

Have a wonderful day!!
Thank you
-tsv

1 Like

Very good job. Thank you @ThirumalaiShaktivel. Our goal for this week is to fix the rest of the AST issues (besides comments / new lines) and test it on as many codes as we can to see if there are any other issues remaining. After that, we will ask the wider community to give it a spin!

We’ll also try to make progress on comments.

1 Like

Hello Everyone, Welcome back!!
As Ondřej Čertík said, Our goal for this week was to fix rest of the AST issues, for that I executed as many Fortran Source codes as possible, reported and fixed all the issues related to the source code.
And also we discussed about the Comments and empty lines in the meeting. As soon as we complete the AST issues, we are gonna start with Comments and empty lines.

Week #7 Progress report

This Week’s Progress:

  • (!1001) Parser: Parse Flush statement
  • (!1003) Parse negative constant (Data statment)
  • (!1004) Parser: parse if construct name
  • (!1005) Parse External attribute
  • (!1002) Parse Uppercase defined operators
  • (!1006) Parse GOTO keyword
  • (!1007) Parser: Parse Arrays substring
  • (!1009) Resolve “Parser: functions and coarrays in derived types

Upcoming Week:

  • Execute as many Fortran Source codes as possible
  • Work on Comments and Newlines
  • Solve some of the existing issues

“It’s not what we do once in a while that shapes our lives. It’s what we do consistently.”
~ Anthony Robbins

Have a wonderful day!!
Thank you
-tsv

2 Likes

Great job @ThirumalaiShaktivel !

Yes, our goal for next week is to try to fix the remaining issues that we know about, make an LFortran release and ask the community to test the parser out. The remaining issues are:

The first two should be easy to fix, the last one (format) will require to rework the tokenizer. I already started:

1 Like

Hello Everyone!!

Week #8 Progress report

As discussed in the Video Call, we executed some Fortran source programs, reported the bugs, and solved any related issues!!
Worked on the issue: #327(Parsing Issues)

This Week’s Progress:

  • (!1034) Parse Access_spec in Generic statement
  • (!1032) Parse Selectcase, “Selecttype”, “Selectrank” keywords
  • (!1033) Parse “doubleprecision” and Pass attributes
  • (!1031) Parse Parent_name in Submodule
  • (!1030) Parse Rename Operator in use_statement
  • (!1016) Parser: parse empty use_symbol (use_stmt)
  • (!1023) Implement Select Rank Contruct
  • (!1021) Parse Computed GOTO statement
  • (!1020) Parse keywords in Deallocate stmt
  • (!1017) Resolve “fmt: parse endtype correctly”

Ondřej Čertík helped a lot to fix most of the issues!! Thank you so much, sir!

Upcoming Week:

  • Execute as many Fortran Source codes as possible
  • Solve some of the existing issues
  • Work on Comments and Newlines

I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.
~ Bill Gates

Have a wonderful day!!
Thank you
-tsv

1 Like

Hello Everyone!

Alone, we can do so little; together, we can do so much
~ Helen Keller

Week #9 Progress report

As we planned, Ondřej Čertík sir released a new version of LFortran 0.11.0. I need to thank the people who helped us find bugs and report them! The community has been very helpful! Thank you, Everyone!. For me, this week’s work has been finding bugs and fixing them.

This Week’s Progress:

  • (!1038) Resolve “parser: implicit Syntax Error”
  • (!1059) parse Integer token in the implicit statement
  • (!1055) Parse Private keyword in Procedure Declare
  • (!1057) fmt: separate symbols by a comma
  • (!1058) Parser: parse Asterisk in type and class(var_type)
  • (!1056) Parse identifier in backspace statement

Upcoming Week:

  • Solve some of the existing issues (Parser Issues)
  • Work on Parsring Comments and Newlines

Have a wonderful day!!
Thank you
-tsv

1 Like

Hello Everyone!

Week #10 Progress report

Worked on Parser Issues

This Week’s Progress:

  • (!1073) Handle operator(/) correctly
  • (!1075) Add --no-color for Error Message
  • (!1084) fmt: Print Abstract keyword (interface)
  • (!1060) Parse format in read statement
  • (!1086) Parse format in print statement
  • (!1074) Parse EndFile Statement
  • (!1089) Parse arrays in rewind and backspace statement
  • (!1083) Parse Character type “*”(Star)
  • (!1095) Resolve “bind(c): token type ‘,’ is unexpected here”
  • (!1093) Resolve “Saved Entity is not parsed in the SAVE statement”
  • (!1099) Resolve “token type ‘(’ is unexpected in UDDTIO”

Upcoming Week:

  • Solve some of the existing issues (Parser Issues)
  • Work on Parsing Comments and Newlines

Have a nice day!!
Thank you
-tsv

3 Likes