[Colloquium] Reminder: Show and Tell Series at TTI-C (TODAY! @ 12:15)

Katherine Cumming kcumming at tti-c.org
Tue Feb 1 11:21:36 CST 2005


 
 
Speaker: (Matthias Blume), (TTI-C)
Speaker's home page: http://www.tti-c.org//blume.html
 
Time: Tuesday, February 1st
Location: TTI-C Conference Room
Lunch  @ 12:00pm 
Seminar @ 12:15pm
 
 
Title:    How, as a speaker of C, an ML compiler went
          from "beginner" to "intermediate"
 
Abstract:
---------
 
In this talk I am going to revisit the problem of building a
foreign-function interface from ML to C.
 
In the first part of the talk I will explain the concept of data-level
interoperability and describe the main ideas behind an encoding of the
C type system in ML types which is used in my "NLFFI" implementation.
(This is mostly a review of earlier work, but significant parts of the
audience probably have not seen this before.)
 
The original Babel'01 paper as well as early implementations of NLFFI
did a somewhat clumsy job of dealing with so-called "incomplete"
types, which frequently occur in C header files.(*) In particular, the
"ml-nlffigen" program generator used to produce a single ML module for
each .h-file, and it required complicated "functor gymnastics" for
matching incomplete types in one header file with the corresponding
completion in another.  This made the system hard to use, but worse,
for certain application with very large header files (e.g., OpenGL or
GTK+) it became a resource bottleneck since generated ML code often
measured in the megabytes for a single compilation unit!
 
A fresh look at the meaning of C types and their representation in the
ML world eliminated the need for functors completely and made it
possible to generate separate ML modules (in separate compilation
units) for every toplevel C declaration.  The resulting system is
actually more general than the original approach, it is easier to use,
and it scales well.  This will be the topic of the second half of the
talk.
 
-------
(*) An incomplete type is a "struct" or "union" type for which no more
than the name is known.  If T is an incomplete type, then derived
types such as "T*" can be used to define variables etc., but it is
illegal to do operations the require knowledge of T's size or T's
internal structure.  Such operations include pointer arithmetic on T*
values and fetching as well as storing into locations these pointer
values point to.
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.uchicago.edu/pipermail/colloquium/attachments/20050201/61cd0518/attachment.htm


More information about the Colloquium mailing list