Luca's meaningless thoughts  

libclang

by Leandro Lucarella on 2010- 12- 24 16:45 (updated on 2010- 12- 24 16:45)
tagged c, c++, clang, en, libclang, llvm, video - with 0 comment(s)

The 2010 LLVM Developers' Meeting was almost 2 months ago, and this time Apple employees videos are available.

I saw the libclang talk video and it was really interesting, it made me want to play with clang. I wonder if there are Python bindings to it, is so much easier to try things out using Python ;)

LDC and LLVM 2.7

by Leandro Lucarella on 2010- 05- 19 23:32 (updated on 2010- 05- 19 23:32)
tagged bitbucket, d, en, ldc, llvm, tomas lindquist olsen - with 0 comment(s)

tomas Lindquist Olsen is back!

And now LDC is updated to work with LLVM 2.7. I hope this is not an isolated event and LDC development becomes as active as it used to be =)

The sources has been moved to Bitbucket too, so if you usually keep up to date you'll have to change the repo URL.

LLVM 2.6

by Leandro Lucarella on 2009- 10- 24 21:30 (updated on 2009- 10- 24 21:30)
tagged d, en, llvm, release, software - with 0 comment(s)

Just in case you're not that well informed, Chris Lattner has just announced the release of LLVM 2.6. Enjoy!

KLEE, automatically generating tests that achieve high coverage

by Leandro Lucarella on 2009- 10- 20 14:20 (updated on 2009- 10- 20 14:20)
tagged coverage, d, en, klee, llvm, software, test, vm - with 2 comment(s)

This is the abstract of the paper describing KLEE, a new LLVM sub-project announced with the upcoming 2.6 release:

We present a new symbolic execution tool, KLEE, capable of automatically generating tests that achieve high coverage on a diverse set of complex and environmentally-intensive programs. We used KLEE to thoroughly check all 89 stand-alone programs in the GNU COREUTILS utility suite, which form the core user-level environment installed on millions of Unix systems, and arguably are the single most heavily tested set of open-source programs in existence. KLEE-generated tests achieve high line coverage — on average over 90% per tool (median: over 94%) — and significantly beat the coverage of the developers' own hand-written test suites. When we did the same for 75 equivalent tools in the BUSYBOX embedded system suite, results were even better, including 100% coverage on 31 of them. We also used KLEE as a bug finding tool, applying it to 452 applications (over 430K total lines of code), where it found 56 serious bugs, including three in COREUTILS that had been missed for over 15 years. Finally, we used KLEE to cross-check purportedly identical BUSYBOX and COREUTILS utilities, finding functional correctness errors and a myriad of inconsistencies.

I have to try this...

LLVM developer meeting videos available

by Leandro Lucarella on 2009- 10- 15 13:55 (updated on 2009- 10- 15 16:35)
tagged clang, d, en, llvm, llvm developer meeting, video - with 0 comment(s)

Chris Lattner announced that the videos for the last LLVM developer meeting are now available. They are usually very interesting, so I'd recommend to watch them if you have some time.

Update

Big WTF and many anti-cool-points for Apple:

On Oct 15, 2009, at 8:29 AM, Anton Korobeynikov wrote:
[...]
> I'm a bit curious: is there any reason why are other slides / videos
> not available (it seems that the ones missing are from Apple folks)?

Unfortunately, we found out at the last minute that Apple has a rule
which prevents its engineers from giving video taped talks or
distributing slides.  We will hold onto the video and slide assets in
case this rule changes in the future.

-Chris

Fragment from a response to the announcement.

Link Time Optimization

by Leandro Lucarella on 2009- 10- 10 18:34 (updated on 2009- 10- 10 18:34)
tagged binutils, d, en, gcc, gdc, gold, ldc, llvm, lto - with 0 comment(s)

The upcoming LLVM 2.6 will include a plug-in for Gold to implement Link Time Optimization (LTO) using LLVM's LibLTO. There is a similar project for GCC, merged into the main trunk about a week ago. It will be available in GCC 4.5.

This is all fairly new, and will be not enabled by default in LLVM (I don't know what about GCC), but it will add a lot of new optimization oportunities in the future.

So people using LDC and GDC will probably be able to enjoy LTO in a near future =)

LDC

by Leandro Lucarella on 2009- 03- 29 18:56 (updated on 2009- 03- 29 18:56)
tagged compiler, d, dgc, en, howto, ldc, llvm - with 0 comment(s)

My original plan was to use GDC as my compiler of choice. This was mainly because DMD is not free and there is a chance that I need to put my hands in the compiler guts.

This was one or two years ago, now the situation has changed a lot. GDC is dead (there was no activity for a long time, and this added to the fact that GCC hacking is hard, it pretty much removes GDC from the scene for me).

OTOH, DMD now provides full source code of the back-end (the front-end was released under the GPL/Artistic licence long ago), but the license is really unclear about what can you do with it. Most of the license mostly tell you how you can never, never, never sue Digital Mars, but about what you can actually do, it's says almost nothing:

The Software is copyrighted and comes with a single user license, and may
not be redistributed. If you wish to obtain a redistribution license,
please contact Digital Mars.

You can't redistribute it, that's for sure. It says nothing about modifications. Anyways, I don't think Walter Bright mind to give me permission to modify it and use it for my personal project, but I prefer to have a software with a better license to work with (and I never was a big fan of Walter's coding either, so =P).

Fortunately there is a new alternative now: LDC. You should know by now that LDC is the DMD front-end code glued to the LLVM back-end, that there is an alpha release (with much of the main functionality finished), that it's completely FLOSS and that it's moving fast and getting better every day (a new release is coming soon too).

I didn't play with LLVM so far, but all I hear about it is that's a nice, easy to learn and work, compiler framework that is widely used, and getting better and better very fast too.

To build LDC just follow the nice instructions (I'm using Debian so I just had to aptitude install cmake cmake-curses-gui llvm-dev libconfig++6-dev mercurial and go directly to the LDC specific part). Now I just have to learn a little about Mercurial (coming from GIT it shouldn't be too hard), and maybe a little about LLVM and I'm good to go.

So LDC is my compiler of choice now. And it should be yours too =)