Thanks, Martin. We expect it to be a medium size project. And we will be sure that Ethan can build, test, and debug the GNAT-FE and other GCC components.
Take care, -Tuck On Mon, Mar 24, 2025 at 7:23 PM Martin Jambor <mjam...@suse.cz> wrote: > Hello, > > in general the project proposal looks very good. A few comments inline: > > On Tue, Mar 18 2025, Tucker Taft via Gcc wrote: > > > [...] > > The GNAT front end is organized into three basic phases, a parser, a > > semantic analyzer, and an expander. In the sources, these are > represented > > by source files par-ch*.adb, sem_ch*.{ads,adb}, and exp_ch*.{ads,adb}, > > where "ch*" is short-hand for the various chapters of the Ada reference > > manual. For this project the intent is to augment primarily the "chapter > > 5" components, given that loop and parallel-do statements are defined in > > chapter 5 of the Ada reference manual. For example, the function > > Par.Ch5.P_Loop_Statement is where most of the parsing of the loop > statement > > takes place, while Par.Ch5.P_Parallel_Do_Statement would be a new local > > function of Par.Ch5. Similarly, Sem_Ch5.Analyze_Loop_Statement would be > > augmented, while Sem_Ch5.Analyze_Parallel_Do_Statement would be new. And > > finally, Exp_Ch5.Expand_Loop_Statement would be augmented, while > > Exp_Ch5.Expand_Parallel_Do_Statement would be new. > > > > The project would begin with the parser, simply recognizing the new > syntax, > > and producing debug output to report on whether the parse was successful. > > The next phase would be to construct the appropriate tree > representations, > > which would mean updating the gen_il* set of files to include new fields > > and node types to support the parallel for-loop and parallel do > statement. > > As part of doing this, pseudo-code would be developed for the semantic > and > > expansion phases, to ensure that the new tree components created meet the > > needs of these later phases. Finally the semantic and expansion phases > > would be implemented in Ada, using the new tree components available. > > > > > > For the expansion phase, the job is primarily to transform the syntax > into > > the appropriate calls on out-of-line runtime components providing > > light-weight-thread management. These routines have already been > developed > > and debugged, and are available on the GitHub site for the ParaSail > > parallel programming language ( > > https://github.com/parasail-lang/parasail/tree/main/lwt). > > > > As far as effort involved, the parsing functions in the GNAT Front End > tend > > to be quite short, often less than a page of code, making heavy use of > > shared parsing components. The semantic phase tends to be significantly > > more complex, but for this effort relatively little additional code will > be > > required, because the additional static semantics for these new features > > are pretty simple. The major effort will be in the expansion phase, > > primarily because the out-of-line light-weight-threading library expects > > the loop body to be represented as a procedure. In fact the GNAT-FE > > frequently creates simple out-of-line routines as part of implementing > > certain existing Ada features, so there should be plenty of models to > work > > from to turn the loop body into an out-of-line routine. Similarly, > > generating calls to run-time routines is also quite common as part of > > various GNAT-FE expansion routines, so we can use those as models as > well. > > > > > > One feature of the light-weight-threading library we will be interfacing > > with is that it sits on top of the existing Ada runtime, as well as the > GCC > > implementation of OpenMP, without any need to alter these underlying > > components. > > > > Overall we would estimate a couple of weeks for the parsing and initial > > semantic analysis for these two features, with the bulk of the summer > spent > > on the expansion phase, finalizing the semantic analysis, and if there is > > time, working on error recovery. > > Do you envision this as a medium-sized (approx. 175 hours) or large (350 > hours) project? > > > > > As far as mentors, Tucker Taft had agreed to be a mentor. Tucker was the > > lead designer of Ada 2022, and has implemented the light-weight-threading > > library that we will be interfacing with. Richard Wai has also agreed to > > be a mentor. Richard is an active member of the ISO-WG9 committee on Ada > > and its Ada Rapporteur Group (ARG), and has also made contributions to > GCC > > components, in particular the GNAT front end, in the past. > > > > The contributor will be Ethan Luis McDonough. Ethan is currently > finishing > > his last semester in the Penn State University online Software > Engineering > > program, and is also finishing up an internship at the Lawrence Livermore > > Laboratory focused on open source LLVM development. Ethan spent his time > > at the lab working on LLVM’s Fortran frontend as well as GPU > > instrumentation tools. Most recently Ethan has been implementing a code > > generator for a hardware description language built on top of the > ParaSail > > Programming Language, using an API he implemented in Ada providing access > > to the tree representation used by the ParaSail front end (which is > written > > in Ada). He looks forward to making a contribution to the open-source > GNAT > > FE component of the GCC compiler collection. > > That definitely looks like solid experience that proves that Ethan has > what it takes to work on the project. Still, the general rules apply, > please look at the "Before you apply" section of our GSoC page at > https://gcc.gnu.org/wiki/SummerOfCode#Before_you_apply and make sure you > are able to build, install, test and debug GCC. I am not familiar with > Ada FE myself but in this instance finding the correct dumps but also to > get a gdb session going and inspect the compiler internals from within. > > Good luck! > > Martin >