<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-family:arial,sans-serif;font-size:13px">No. I think that you might want to use Clang for inspiration on design, but you'd certainly not be bound to that. If you'd like to take a much more start-from-scratch approach, you can also look at the code that Bill put together: </span><a href="https://github.com/isanbard/flang" target="_blank" style="font-family:arial,sans-serif;font-size:13px">https://github.com/isanbard/flang</a><span style="font-family:arial,sans-serif;font-size:13px"> - If you use that as a base, we can always merge it with the useful lfort pieces later.</span></blockquote>
<div style>Ok, that's good to know. In the next couple of days I will study the lfort repository more, and see if I can perhaps contribute a commit or two. Thankfully I know git and github and so that would make lfort really accessible for me.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/13 Hal Finkel <span dir="ltr"><<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">----- Original Message -----<br>
> From: "Alex L" <<a href="mailto:arphaman@gmail.com">arphaman@gmail.com</a>><br>
> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>
> Cc: "Anton Korobeynikov" <<a href="mailto:anton@korobeynikov.info">anton@korobeynikov.info</a>>, "Bill Wendling" <<a href="mailto:isanbard@gmail.com">isanbard@gmail.com</a>>, "LLVM Developers Mailing<br>

> List" <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>><br>
</div><div class="im">> Sent: Saturday, April 13, 2013 11:34:43 AM<br>
> Subject: Re: [LLVMdev] GSoC project questions.<br>
><br>
><br>
</div><div class="im">> Thanks for your replies.<br>
> Working on the lfort compiler would certainly be an interesting<br>
> project for me for this GSoC.<br>
<br>
</div>Great!<br>
<div class="im"><br>
> I have studied lfort repository and<br>
> commits, and I see that it has a lot of stuff for C/C++, am I<br>
> correct that this is a fork of Clang? If this is correct, I wonder<br>
> why this approach was chosen instead of starting out from scratch -<br>
> is it because Clang already has a lot of code which can be reused<br>
> for the Fortran compiler?<br>
<br>
</div>Yes, lfort started out as a fork of Clang, but I don't think that is overly relevant at this point. There are a few things from Clang that the Fortran compiler could really reuse:<br>
<br>
 1. The driver/tools infrastructure (the code that finds the system libraries, knows how to call the assembler, linker, etc.)<br>
 2. The C preprocessor (in practice, a lot of Fortran code assumes the existence of an integrated C preprocessor).<br>
   2a. The lexical analysis framework, and to some extent, the classes for printing nice error messages<br>
 3. The directory layout and regression-testing setup<br>
<br>
At this point, I've pretty much finished taking advantage of all of those pieces in lfort, and the remainder of the core code from Clang needs to be replaced with Fortran-specific bits. Keeping the same general design probably makes sense, but I could certainly be convinced otherwise.<br>

<div class="im"><br>
> I'm also unfamiliar with Clang and I was a<br>
> bit overwhelmed when I saw the lfort repository at first because of<br>
> this. If I were to work on this project, would I be required to use<br>
> the Clang code?<br>
<br>
</div>No. I think that you might want to use Clang for inspiration on design, but you'd certainly not be bound to that. If you'd like to take a much more start-from-scratch approach, you can also look at the code that Bill put together: <a href="https://github.com/isanbard/flang" target="_blank">https://github.com/isanbard/flang</a> - If you use that as a base, we can always merge it with the useful lfort pieces later.<br>

<br>
Thanks again,<br>
Hal<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
><br>
> 2013/4/13 Hal Finkel < <a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a> ><br>
><br>
><br>
><br>
> ----- Original Message -----<br>
> > From: "Anton Korobeynikov" < <a href="mailto:anton@korobeynikov.info">anton@korobeynikov.info</a> ><br>
><br>
> > To: "James Courtier-Dutton" < <a href="mailto:james.dutton@gmail.com">james.dutton@gmail.com</a> ><br>
> > Cc: "Hal Finkel" < <a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a> >, "Bill Wendling" <<br>
> > <a href="mailto:isanbard@gmail.com">isanbard@gmail.com</a> >, "LLVM Developers Mailing List"<br>
> > < <a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a> ><br>
><br>
> > Sent: Saturday, April 13, 2013 9:12:39 AM<br>
> > Subject: Re: [LLVMdev] GSoC project questions.<br>
> ><br>
><br>
> > > I agree that creating a complete Fortran compiler is a huge<br>
> > > effort.<br>
> > > But what about approaching it from a test driven development<br>
> > > perspective?<br>
> > > We start with a few small Fortran programs as "test cases".<br>
> > > The GSoC task then gives the task as getting test case 1 to work.<br>
> > > We could also apply this of "lfort". Determine a test case that<br>
> > > currently<br>
> > > fails on lfort, and ask the GSoC task to pass the test.<br>
> > All this make sense only if there is interested party in long-term<br>
> > development and maintenance. Otherwise the code will bitrot really<br>
> > quickly and thus will be waste of time and money. Is there such a<br>
> > party?<br>
><br>
> I am certainly interested in long-term development and maintenance. I<br>
> think that the first step toward making a useful Fortran compiler is<br>
> this:<br>
><br>
> 1. It should be able to compile BLAS: <a href="http://www.netlib.org/blas/" target="_blank">http://www.netlib.org/blas/</a><br>
> (these are Fortran 77, and have no I/O, so should be relatively<br>
> simple)<br>
><br>
> 2. If that is complete, then move on to LAPACK:<br>
> <a href="http://www.netlib.org/lapack/index.html" target="_blank">http://www.netlib.org/lapack/index.html</a> (these use some subset of<br>
> Fortran 90)<br>
><br>
> As you can see from the test cases currently in lfort, most of the<br>
> driver functionality and lexical analysis (for both Fortran 77 and<br>
> 90) is done, and I've started on parsing (and semantic analysis and<br>
> codegen for) variable declarations and some simple statements. I<br>
> think that a motivated student could make a lot of headway, and<br>
> should be able to at least finish step 1. Thoughts?<br>
><br>
> -Hal<br>
><br>
><br>
><br>
> ><br>
> > --<br>
> > With best regards, Anton Korobeynikov<br>
> > Faculty of Mathematics and Mechanics, Saint Petersburg State<br>
> > University<br>
> ><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>