Chris Lattner wrote:> On Dec 21, 2007, at 1:08 PM, Richard Pennington wrote: > >> I'm a little further along now. I've started to put together a simple >> driver for Elsa and LLVM that I'm calling "ellsif" (cute name, I think >> it works). >> >> The file being compiled is a "printf" function. Here are timing >> results >> for optimized and unoptimized runs: > > Cool, this is very nice! > >> Sorry to add noise to the list with this. I'm just very excited. ;-) >> Again, my compliments to both the Elsa and LLVM teams. It says a lot >> that I got this far in 19 days of part-time work. > > This is a very cool hack, but I'm curious: what is your goal with this > work? Are you just trying to see if it can be done, or does elsa > provide an advantage over using the g++ parser with llvm? > > -Chris > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >Well, primarily I'm doing it for fun. My background is in compiler design and embedded systems programming, so I'm interested in both the front end and back end aspects. I've build gcc many times over the years for different target processors and was never able to get my head around it internally. It is incredibly complex. I also didn't like the fact that I had to have N copies of gcc to support N processors. I became interested in Elsa (via google) because I liked its extensible nature. I can drop in new syntax rules easily. It was also fairly easy to understand. At first I looked into SUIF and started down that path. I wasn't entirely pleased with the results. Then I realized SUIF had been dead for about 5 years so I started looking around for alternatives and stumbled on LLVM. It was easy to lower the Elsa AST to LLVM by using Elsa's extension capability. I'm now at the point where I can see that compiling C with Elsa is a done deal. I have about 90% (or more) of basic C covered. I decided that I wanted a cleaner way to move forward so I started writing the ellsif driver to automate the steps and make Elsa->LLVM look like a real tool. Does Elsa provide an advantage over g++? For me, understanding it is a big plus. ;-) In addition, Elsa has a Berkeley-like license which I prefer. I'll let you know if Elsa is a good choice after I get a little further along adding the C++ support. Since I only have a few weeks invested in this project, I won't feel too bad if Elsa turns out to be a dead end. Along the way I found LLVM, which is definitely the way to go. I'd like to get the Elsa stuff behind me because I'm itching to do an LLVM code generator for the Altera Nios2. ;-) I started by copying the MIPS sources and am studying them to get a feel for what's required. -Rich
On Dec 22, 2007, at 2:40 AM, Richard Pennington wrote:> Does Elsa provide an advantage over g++? For me, understanding it is a > big plus. ;-) In addition, Elsa has a Berkeley-like license which I > prefer.Ok. If you're not planning on extending the front-end, understandability doesn't really matter ;-). I get where you're coming from though!> Since I only have a few weeks invested in this project, I won't feel > too > bad if Elsa turns out to be a dead end. Along the way I found LLVM, > which is definitely the way to go.Ok. For most users to be interested in it, it would have to be faster or produce better code, and be as correct as G++. I'll be interested to see how it comes out.> I'd like to get the Elsa stuff behind me because I'm itching to do an > LLVM code generator for the Altera Nios2. ;-) I started by copying the > MIPS sources and am studying them to get a feel for what's required.Ah, nifty. I no nothing of that processor, but you can build a backend independent of the front-end :) -Chris
> I've build gcc many times over the years for different target processors > and was never able to get my head around it internally. It is incredibly > complex. I also didn't like the fact that I had to have N copies of gcc > to support N processors.Scott McPeak is rather familiar with the internals of gcc and edg and says elsa is far simpler.> I became interested in Elsa (via google) because I liked its extensible > nature. I can drop in new syntax rules easily. It was also fairly easy > to understand.We worked very hard to make it that way just so people like you can do what you are doing :-).> It was easy to lower the Elsa AST to LLVM by using Elsa's extension > capability.I'll be pretty interested to see how you did that.> Does Elsa provide an advantage over g++? For me, understanding it is a > big plus. ;-) In addition, Elsa has a Berkeley-like license which I prefer.Read it more carefully: the license is not just BSD-like, it *is* BSD!> I'll let you know if Elsa is a good choice after I get a little further > along adding the C++ support. > > Since I only have a few weeks invested in this project, I won't feel too > bad if Elsa turns out to be a dead end.Would you mind explaining what a dead-end would look like?> I'd like to get the Elsa stuff behind me because I'm itching to do an > LLVM code generator for the Altera Nios2. ;-) I started by copying the > MIPS sources and am studying them to get a feel for what's required.In other words you want a C++ compiler for the Nois2? Daniel
Daniel Wilkerson wrote:>> I've build gcc many times over the years for different target processors >> and was never able to get my head around it internally. It is incredibly >> complex. I also didn't like the fact that I had to have N copies of gcc >> to support N processors. > > Scott McPeak is rather familiar with the internals of gcc and edg and > says elsa is far simpler.I agree, very much.> >> I became interested in Elsa (via google) because I liked its extensible >> nature. I can drop in new syntax rules easily. It was also fairly easy >> to understand. > > We worked very hard to make it that way just so people like you can do > what you are doing :-).You guys did a great job!> >> It was easy to lower the Elsa AST to LLVM by using Elsa's extension >> capability. > > I'll be pretty interested to see how you did that.You'll see it soon. But basically think about cc2c. There is now a cc2llvm.> >> Does Elsa provide an advantage over g++? For me, understanding it is a >> big plus. ;-) In addition, Elsa has a Berkeley-like license which I prefer. > > Read it more carefully: the license is not just BSD-like, it *is* BSD!Yes.> >> I'll let you know if Elsa is a good choice after I get a little further >> along adding the C++ support. >> >> Since I only have a few weeks invested in this project, I won't feel too >> bad if Elsa turns out to be a dead end. > > Would you mind explaining what a dead-end would look like?A dead end would be something in the C++ part of Elsa that didn't allow me to generate a correct LLVM file to execute it and that I couldn't fix. If I knew what it looked like, I'd look for it first and decide now. ;-)> >> I'd like to get the Elsa stuff behind me because I'm itching to do an >> LLVM code generator for the Altera Nios2. ;-) I started by copying the >> MIPS sources and am studying them to get a feel for what's required. > > In other words you want a C++ compiler for the Nois2?No, g++ exists for the Nios2. Altera has a port. I am interested working with some language stuff that might be cool in an embedded environment. The Nios is a softcore processor that runs on Altera FPGAs. A programmable processor. Think of what kind of optimizations that might allow.> > Daniel > >-Rich
Chris Lattner wrote:> On Dec 22, 2007, at 2:40 AM, Richard Pennington wrote: > >> Does Elsa provide an advantage over g++? For me, understanding it is a >> big plus. ;-) In addition, Elsa has a Berkeley-like license which I >> prefer. > > Ok. If you're not planning on extending the front-end, > understandability doesn't really matter ;-). I get where you're > coming from though! > >> Since I only have a few weeks invested in this project, I won't feel >> too >> bad if Elsa turns out to be a dead end. Along the way I found LLVM, >> which is definitely the way to go. > > Ok. For most users to be interested in it, it would have to be faster > or produce better code, and be as correct as G++. I'll be interested > to see how it comes out. >Me, too.>> I'd like to get the Elsa stuff behind me because I'm itching to do an >> LLVM code generator for the Altera Nios2. ;-) I started by copying the >> MIPS sources and am studying them to get a feel for what's required. > > Ah, nifty. I no nothing of that processor, but you can build a > backend independent of the front-end :)The Nios2 is a softcore processor running in Altera FPGAs. Very MIPS like. Being soft, the instruction set can be extended as can the hardware. In software. Very cool. -Rich
Richard Pennington wrote:> Chris Lattner wrote: > >> This is a very cool hack, but I'm curious: what is your goal with this >> work? Are you just trying to see if it can be done, or does elsa >> provide an advantage over using the g++ parser with llvm? >> >> -Chris >> _______________________________________________ >> > [snipped] > I became interested in Elsa (via google) because I liked its extensible > nature. I can drop in new syntax rules easily. It was also fairly easy > to understand. > > [...] > It was easy to lower the Elsa AST to LLVM by using Elsa's extension > capability. > > I'm now at the point where I can see that compiling C with Elsa is a > done deal. I have about 90% (or more) of basic C covered. >Looks like I'm late to this discussion, but I wanted to chime in and say this is really cool stuff.> I decided that I wanted a cleaner way to move forward so I started > writing the ellsif driver to automate the steps and make Elsa->LLVM look > like a real tool. > > Does Elsa provide an advantage over g++? For me, understanding it is a > big plus. ;-) In addition, Elsa has a Berkeley-like license which I prefer. > > I'll let you know if Elsa is a good choice after I get a little further > along adding the C++ support. >From what I've learned so far, Elsa and LLVM are both much closer to a textbook design than gcc or anything like it, so I'd expect them to be much easier to work with and maintain. Hopefully easier to attract developers to as well. (I like Dan's comment about the end of gcc, too.) Dave MoCo Platform N00b