Melange FAQ and roadmap 
Author Message
 Melange FAQ and roadmap

Since some people have been asking about Melange, here's a FAQ and future
development roadmap. Note that no delivery dates are included, as per
standard Gwydion policy. ;-)

What is Melange?
----------------

Melange parses C headers and creates Dylan bindings. Unlike SWIG and
similar tools, Melange attempts to parse all legal C headers. In theory, it
should never be necessary to edit a C header. In practice, most headers
still require a small amount of tweaking to work around bugs in Melange.

Typically, these bugs do *not* involve Melange's parser. Most problems come
from the ad hoc output code, which will go away in the future. (See below.)

What is the Harlequin C FFI?
----------------------------

The Harlequin C FFI allows a Dylan program full access to C functions and
data structures. Using the C FFI, a Dylan program can do almost anything
a C program could do. This includes calling functions, accessing data
structures and even defining functions callable from C.

Gwydion Dylan does not yet support the Harlequin C FFI, but we're working
on it. Right now, Gwydion Dylan supports a less powerful interface.

Does Melange handle C++?
------------------------

No. Two things prevent Melange from handling C++:

 1) Melange generates interfaces in Dylan, not in C or C++. This means that
    you can use Melange without a separate C compiler.
 2) No existing Dylan compiler can generate object code compatible with a
    C++ compiler. For that matter, most *C++* compilers are unable to
    generate object code compatible with other C++ compilers. Until the C++
    community solves this problem, there's little change that the Dylan
    community will solve it.

So even if Melange could parse C++ headers, it wouldn't know what to do
with the output.

How can I interface Dylan code with C++ libraries?
--------------------------------------------------

Harlequin Dylan supports COM and CORBA. Both of these technologies could be
used to build an interface between C++ and Dylan.

You could also write a C-compatible interface to your C++ classes using
'extern "C"' declarations, and then access your new interface using the C
FFI or Melange.

If none of these options are appealing, it may be necessary to wait. I know
of a few tools which might help. Write me for details.

Can Melange be compiled with Harlequin Dylan?
---------------------------------------------

Not yet. Right now, Melange requires Gwydion-specific extensions. See the
development roadmap below.

Does Melange generate C FFI bindings?
-------------------------------------

Not yet. Right now, Melange generates bindings for the more primitive
Gwydion FFI. See below.

Development Roadmap
-------------------

 * Milestone #1 ("Portable C Parser")
   - Melange's parsing code will work under both Harlequin and Gwydion Dylan.
   - The parsing code will generate a well-defined parse tree based on
     ANSI C. The ad hoc parse tree will no longer be generated.
   - The parser will understand as much of ANSI C as will be needed to
     generate C FFI bindings.

 * Milestone #2 ("Pidgin")
   - It will be possible to generate a C FFI interface by typing:
       $ pidgin my-library.h my-library.dylan
   - Pidgin will compile under both Harlequin and Gwydion Dylan.
   - Pidgin will understand how to search for C headers. In particular,
     pidgin will support GCC's standard search path under Linux and at
     least one other search path.

 * Milestone #3 ("Basic 'define interface'")
   - Pidgin will support 'define interface' clauses similar to those
     supported by Creole (from the Apple Dylan Technology Release) and
     Melange (from current versions of Gwydion Dylan).
   - c-translation, equate, map and similar features will not be supported.
   - It will be possible to invoke pidgin by typing:
       $ pidgin --interface-file=foo.dylan foo-c-glue.dylan
     This will extract all 'define interface' forms from foo.dylan and
     write C FFI bindings to foo-c-glue.dylan.

Once milestone #2 is reached, users will be invited to test Pidgin on their
local systems. Once milestone #3 is reached, we'll begin to evolve 'define
interface' based on actual experience.

What headers will be used to test Pidgin?
-----------------------------------------

My initial set of test headers will look something like the following:

 * OpenGL: GL/gl.h, GL/glu.h, GL/glut.h from the newest version of Mesa.
 * Linux headers: sys/socket.h from RedHat Linux 5.2.
 * GTK+: gtk/gtk.h from GTK+ 1.2 or newer and all recursive includes.
 * PostgreSQL: a selected header from a new version of PostgreSQL.
 * PCRE: the Perl-compatible regex engine.

If you'd like to submit a header for testing, here are the criteria:

 * The header must be generally available. If I don't already have a copy,
   you'll have to mail me a copy or tell me where to find one.
 * The header must contain only ANSI C and extensions from GCC and MSVC.

In particular, I'd like to test a header including MSVC extensions.
Ideally, this header should use both '#pragma pack' and '__stdcall'.

What about delivery dates?
--------------------------

Right now, I'm working on Gwydion Dylan infrastructure. This will take
several more days. Once this work is out of the way, I'll begin moving
towards milestones #1 and #2 as quickly as possible.

Since I'm doing this in my spare time, I won't quote any delivery dates. If
your company would benefit from a tool like pidgin, I'm also available on a
consulting basis.

Because I've been studying Melange for the last several months, I can reach
milestone #2 in about two weeks of full time work. Because I want to write
Pidgin for my own use, I'll work for less than my usual rates (which are a
good buy to begin with).

<ADVERTI{*filter*}T>
So here's my sales pitch: If your senior developers are writing C FFI
bindings, they're not writing application code. Pull out a calculator,
check your overhead rate, and find out what you're spending. For less than
the cost of a few copies of Harlequin's Enterprise Edition, I can
save you that money. If your credit's good, I'll even take payment upon
completion of each milestone. ;-)

To be honest, I'm going to write pidgin one way or the other. But if you
need it really soon--and you want your bug reports to take priority--send
me e-mail with your phone number.
</ADVERTI{*filter*}T>

Otherwise, just sit back and enjoy the anticipation. And don't bug me about
delivery dates, OK? :-)

Cheers,
Eric



Mon, 10 Sep 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. C-FFI: GC questions, wchar_t, Melange redesign

2. C-FFI: GC questions, wchar_t, Melange redesign

3. What is Melange?

4. RB Roadmap (5.0)

5. Softvelocity Roadmap

6. Enlightenment: The Roadmap?

7. Zope Directions Roadmap Posted

8. EDA Standards Roadmap Initiative: General Information

9. EDA Standards Roadmap Initiative: General Information

10. Roadmap wanted: Python access to SPIRIT.OCX (Win9x)

11. Tcl8.5 roadmap

12. Roadmap 9.0

 

 
Powered by phpBB® Forum Software