[jhc] Emitting Optimal C

Rick R rick.richardson at gmail.com
Sun Feb 22 11:44:25 EST 2009


I have been looking for a functional language that compiles to efficient
C/C++ to fufill two rather odd criteria.

1. To conform to the requirements of the iPhone Developers Program. Code
must compile in XCode and be either C/C++/Obj-C. Garbage collection is
mostly disallowed. Program size and memory must fit below a threshold.
2. Separately, to perform Naive Bayes computation across huge datasets. What
is required is function inlining as well as use of SIMD instructions.
I would provide the inlined functions via .h's and compile them in with gcc.

I really don't know much about language design and development, so I might
be way off base here. For the GC, I guess this would imply that there would
be a way to fix the scope of closures and other structures that are
referenced/collected. With jhc taking a 'full program' approach to analysis
and optimization, I thought that this might be possible. Or perhaps there is
a way to use ref counting for objects of an indeterminate lifespan instead
of incremental (or whichever) garbage collection.

I see that jhc see offers a way to specify unboxed values and tuples. And
I'm sure there is a way to manage large native arrays as well. Is there a
way to pass that data directly to an inline C function that would be
compiled in by gcc? (i.e. not loaded from a library through FFI)

I've looked through most of the jhc mailing list archives and haven't found
any such discussions. Would this be something that would be achievable
somewhere in the jhc roadmap, or at least conceivable with a few hacks?

-- 
We can't solve problems by using the same kind of thinking we used when we
created them.
   - A. Einstein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/jhc/attachments/20090222/255b677c/attachment.htm


More information about the jhc mailing list