[gambit-list] scheme on llvm

Bradley Lucier lucier at math.purdue.edu
Fri Jul 31 14:57:04 EDT 2009


On Jul 31, 2009, at 1:43 PM, Harold Ancell wrote:

>
> At 09:52 AM 7/31/2009, Bradley Lucier wrote:
>
>> On Jul 31, 2009, at 7:57 AM, Harold Ancell wrote:
>>
>>>> On Thu, Jul 30, 2009 at 9:50 PM, Bradley
>>>> Lucier<lucier at math.purdue.edu> wrote:
>>>>> The last time I compiled the Gambit-generated C code with LLVM
>>>>> (which
>>>>> wasn't so long ago) gsi failed at startup.  (I know this isn't  
>>>>> what
>>>>> you're referring to, but I presume the LLVM compiler may have the
>>>>> same difficulties compiling the LLVM intermediate representation.)
>>>
>>> Hmmmm; I assume you used the gcc front end instead of Clang?
>>
>> I don't know what distinction you're trying to make; I got the C
>> compiler from llvm.org this summer and used it to compile the C files
>> in the Gambit distribution.
>
> http://en.wikipedia.org/wiki/LLVM#Front-ends
>
> or http://tinyurl.com/lqvy33
>
>  Front-ends
>
>  LLVM was originally written to be a more aggressive,
>  higher performance system for the existing GCC stack, and
>  many of the GCC front-ends have been modified to work with
>  it.  ... [ It uses ] front-ends derived from version 4.0.1
>  and 4.2 of the GNU Compiler Collection (GCC).
>
>  However, widespread interest in LLVM has led to a number
>  of efforts to develop entirely new front-ends for a
>  variety of languages. One that has received the most
>  attention is clang, a new compiler supporting C, Obj-C and
>  C++. Primarily supported by Apple, clang is aimed at
>  replacing the C/Obj-C compiler in the GCC system with a
>  modern system that is more easily integrated with IDEs,
>  and has wider support for multithreading. [ It also is
>  a better code base for Obj-C work. ]

Interesting perspective on that page:

> Obj-C development under GCC was somewhat moribund and Apple's  
> changes to the language were supported in a separately maintained  
> branch.

Apple stopped contributing code to FSF gcc development when the code  
base was converted to the GPL 3 license.  (Or, more accurately, they  
did not put any GPL 3.0 code from the FSF code base into the code base  
of their own version of gcc, which they have always maintained  
separately, and which is licensed under GPL 2.0.)  Perhaps when and if  
Apple legal passes judgement on GPL 3.0 Apple developers will merge  
the two code bases again.  But perhaps not, if they're putting all  
their work onto LLVM after hiring Chris Lattner.

>
> http://en.wikipedia.org/wiki/Clang#Overview
>
> or http://tinyurl.com/nlblw9
>
>  Clang was designed from the start to be threaded and aims
>  for reduced memory footprint and increased speed. As of
>  October 2007, clang compiled the Carbon libraries well
>  over twice as fast as GCC, while using about five times
>  less memory and disk space.
>
> And the clang/LLVM new code base, made with the hindsight of
> gcc development, is a lot more tractable.  One day maybe
> it'll be practical for Gambit-C and finding and fixing
> regressions won't be in the style of the poking at it with
> sticks that I gathered from reading your "fun with gcc" bug
> reports recently.

I don't know if you meant that literally, but I can't find any  
messages in my mail archives with "fun with gcc" in the subject line.

I misspoke about the experiment I tried.  On my 2GHz G5 running Mac OS  
X 10.5.7 I used LLVM 4.2.1, build 2064.3, from Apple's development tools

> ./configure CC='/Developer/usr/bin/llvm-gcc-4.2 -m64' --enable- 
> single-host
> make mostlyclean
> time make -j 2
> 1970.490u 87.945s 18:27.76 185.8%       0+0k 10+224io 5724pf+0w

gsi/gsi will start up but won't accept input:

> [monster-mac:~/programs/gambc-v4_4_4-devel] lucier% gsi/gsi
> Gambit v4.4.4
>
> >

When I configure with Apple's gcc 4.2.2, build 5574, things work fine:

> ./configure CC='gcc-4.2 -m64 -mcpu=970' --enable-single-host
> make mostlyclean
> time make -j 2
> 350.812u 42.799s 3:45.18 174.7% 0+0k 0+69io 5246pf+0w

So I agree that LLVM is the future of gcc.  Always has been, always  
will be.

Brad





More information about the Gambit-list mailing list