Hi everyone, welcome to the first blog of my GSoC'25 journey. I will be starting the 12 weeks coding period of my GSoC journey with Compilation of Stdlib Codebase. In the Pre-GSoC period, I started the code compilation of stdlib and have compiled linalg package which is set up at CI in the current branch. After that, in Pre-GSoC period, I started to work on package hashmaps. Before starting my coding period, I was able to compile all the src files of package hashmaps by creating workarounds and opening issues for errors that I encountered during the compilation.
In the first week of coding period, I started to compile tests of package hashmaps. There are 3 test files for testing package hashmaps which are :-
- Test Open Maps
- Test Chaining Maps
- Test Maps
I started testing part with Test Open Maps. Package Hashmaps uses Submodule in its implementation which basically extends a module by providing implementations to subroutines and interfaces that are defined in parent module. But LFortran lacks ASR design for Submodule and currently, it treats submodule as a separate module and implements it accordingly. This creates an error as for a subroutine definition in a module and its implementation in submodule, two separate ASR::Function_t* nodes gets created which may lead to code generation error as in Issue #7270. So, to handle this error and proceed with compilation, I created a workaround as Submodule Workaround whose logic was to get rid of submodule by converting it to a module and directly using its subroutines in test open maps where needed.
After this workaround, compilation process became easy. For the errors that I was getting, I created Minimal Reproducible Examples (MREs) for them and then created workaround for then. While creating workarounds, I ensured two things , (1) My workarounds are working with GFortran and all tests passes using GFortran (2) I am able to proceed to next error using LFortran after creating a workaround. For all most all the cases, I was able to create successful workarounds (passing above 2 conditions) and was able to proceed in code compilation. Following is the list of issues (MREs) that I created in this week :-
The workarounds created in this week can be tracked through the latest hashmaps branch that is n-lf-hashmaps-3.
There were some errors for which I was not able to create MREs and was not able to workaround them successfully. These error were related to some sort of Deserialization error as per the stacktrace that I was getting. So, for temporary purpose and to proceed with compilation, I commented out the code lines that were causing the Deserialization error. The link to commit that commented out these lines is Commit for Deserialization
In the next week, Firstly, I am planning to work on and fix Issue #7371 because creating a workaround for this issue is not possible as it leads to a series of other errors and overall hampers the codeflow. Next, I will be working to create an MRE for above discussed Deserialization error and will try to workaround it accordingly or fix it. Finally, I will be wrapping up Test Open Maps by working around any remaining errors or fixing them.
Apart from this, the next major thing that I am planning to do is to work on submodule thing. I am planning to create MREs for various workarounds created in different-different packages of Stdlib codebase. This will give me a concrete idea about functionalities of submodule and will create a basic ASR design for it. Will further work to improvise it as per reviews and discussions on zulip.
Then, if time permits, then, I will start working on other test files of package hashmaps and try to compile as much as I can.
Overall, I worked for 25 hours this week and enjoyed the work that I did in the first week and would like to thank Ondrej Certik, Harshita Kalani, Pranav Goswami and all the other LFortran members for their reviews and suggestions which helped me a lot to tackle new difficulties. I am looking forward to continue my journey in the next week with the same excitement and enthusiasm and plan to complete my proposed tasks as quickly as I can.