[plt-scheme] llvm and all that

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Aug 10 09:58:30 EDT 2006

On Aug 10, 2006, at 9:27 AM, Noel Welsh wrote:

> Hi all,
> A question about tools for compilers and so on.
> If you don't have much time:
> What tools are available for writing compilers from
> (subsets of) MzScheme to something faster?  For example, is
> there a binding to LLVM?  I know someone was working on a
> LLVM compiler a while ago.

Eli and Alex Friedman (basically his undergrad thesis) were working  
on this LLVM compiler. I suspect that with enough work, this compiler  
would be significant better on the kind of code that you have than  
Matthew's JIT compiler. But the work is Incomplete. (The capital I is  
for Americans who know what this implies.) I am wondering whether  
enough public pressure may make Eli work on this again "-)

For your current situation, I could imagine using Eli's foreign  
function library. I'd write the code, use the profiler to figure out  
where the time goes, and descend into C at that point. It's your best  
short term bet, assuming you don't want to switch to PL for your MSc.

-- Matthias

> If you have more time:
> The problem:
> I have some code that is too slow.  It is a mix between
> symbolic and numeric code (fitting Markov models to data
> (but not maximum likelihood -- I allow the number of states
> to change)).  I use SRFI 42 eager comprehensions at lot.
> It makes my code very concise and I like that.
> Possible solutions:
>  - Write critical parts in C.  Possible but boring
>  - Write critical parts in O'Caml.  More fun to write, but
> honestly O'Caml isn't much more fun than C for numeric
> computation (no array comprehensions) and binding MzScheme
> to O'Caml is more work
>  - Write critical parts in Single Assignment C.
> Interesting, but documentation is almost non-existant.
>  - Write a custom compiler for the critical parts.  Much
> more fun!  I already have the beginnings of a PowerPC
> assembler, but this is a dead platform now.  I really want
> something portable.  LLVM is the obvious choice.  There
> might be others.
> Many thanks!
> Noel
> Email: noelwelsh <at> yahoo <dot> com   noel <at> untyped <dot> com
> AIM: noelhwelsh
> Blogs: http://monospaced.blogspot.com/  http://www.untyped.com/ 
> untyping/
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.