Re: [C--] C-- development
Ning Wang <[email protected]> Wed, 13 Mar 2013 22:33:04 -0700
| Newsgroups | gmane.comp.lang.c-- |
|---|---|
| Message-ID | <[email protected]> |
On 03/13/2013 11:47 AM, Hendrik Boom wrote: > On Wed, 13 Mar 2013 12:44:12 -0400, doug moen wrote: > >> From my outsider perspective, it appears that C-- is moribund until >> someone picks it up again. However, I also think that, rather than >> starting from the current C-- code base, it would be better to migrate >> the distinctive features of C-- into the LLVM project. Then, if you >> like, the C-- syntax could continue to be supported by writing a C-- >> compiler with an LLVM back end. But you could get the benefits of C-- >> semantics for your back end without generating C-- syntax, because those >> semantics would be part of LLVM. I'm not pretending this would be easy. >> But if it could be done, it would be the best way to bring the >> innovative ideas in C-- into the mainstream. I'll also note that the C-- >> project was originally based on the design of the GHC (Haskell Compiler) >> back end, which has an intermediate language called C-- or Cmm. GHC also >> supports LLVM as an alternative back end, and I believe there are people >> in the GHC community who would gladly abandon the maintenance of the Cmm >> backend if LLVM were extended to do everything that Cmm does. >> >> Doug Moen. > But C-- is a far more elegant language. It corresponds closely to what I > consider a decent interface between a compiler and a code generator. LLVM > is too committed to a particular high-level model for me. I need to do > unscaled address arithmetic. LLVM gives me C array subscripting I think a really useful IR need both high level point arithmetic provided by GetElemPtr of LLVM and low level unscaled pointer arithmetic. I wrote a C99 front-end for C--. It's much harder to generate C-- than LLVM code. In order to generate C-- code, I have to compute the memory layout and handle alignments. It's very painful task and is hard to get it right for a language like C99 that supports bit fields and have many alignment attributes. On the other hand, LLVM provides high level construct GetElemPtr that just hides this painful task from the front-end. I believe, for most language front-ends, GetElemPtr is a welcome abstraction. Ning _______________________________________________ Cminusminus mailing list [email protected] https://lists.eecs.harvard.edu/mailman/listinfo/cminusminus