[haskell-llvm] haskell-llvm An LLVVN backend for DDC

Erik de Castro Lopo mle+hs at mega-nerd.com
Wed Jun 23 20:20:54 EDT 2010


Thomas Schilling wrote:

> note that there is an ongoing Summer of Code project which aims to
> modify the existing llvm library for this use case [1].

I am aware of this and I've been in contact with Alp Mestanogullari
(I'm prety sure he's on this list). What I haven't seen much of is
any progress reports.

> David generated LLVM text files for his BSc work,

I should read David's thesis as well.

> but the goal is now to
> actually use the LLVM API.  AFAIU the current llvm package does not
> support this use case directly and one part of this GSoC project is to
> add this capabilities.  Hopefully, that can take advantage of those
> efforts.

Yes indeed.

> Regarding your specific project, did you consider targeting a
> higher-level target?  Some abstract machine, like STG maybe?

Well DDC is not really *my* project, just one I work on. From my
reading so far, STG exists in GHC mainly to support the default
lazy evaluation strategy.

The Disciple language (DDC is the compler) uses eager evaluation
by default (lazy is optional) and also allows mutable values
(mutability is tracked in the type system).

Ben (the man behind DDC) has said that default eager evaluation
and mutability made Disciple sufficient different from Haskell to
make it too difficult to build DDC as a set of modifications
to the GHC compiler. For instance DDC's core language has a type
system that tracks side effects, a feature not present in GHC's
core language.

Finally, since DDC already has a working C backend, adding an
LLVM backend seems reasonable while adding a higher level backend
target doesn't seem to buy very much.

> This
> doesn't magically create interoperability with Haskell, but you could
> re-use lots of runtime services, like concurrency and GC.

The Disciple language is synatically very, very similar to Haskell.
When DDC is closer to being a fully functional compiler, converting
Haskell code to Disciple should be a relatively simple exercise and
should also be mostly automatable.

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the Haskell-llvm mailing list