[M3devel] UI, Trestle, native... Cocoa??

Mika Nystrom mika at async.async.caltech.edu
Wed Sep 29 11:53:09 CEST 2010


Darko writes:
...
>
>I don't understand where the payoff is in doing anything else when there =
>is no way of reliably automating it and making it output something =
>clean, putting you back to square one and having to hack anyway. A =
...

As long as you also generate syntax-correct C code from a higher-level 
specification there should be no extra "hacking" involved.

The main thing you can get with a higher-level representation is the
same thing you get with .i3s: annotation of memory management.  If your
library allocates and deallocates objects, you can then automatically
generate wrappers that use WeakRefs for instance.  (If you like.)
Or you can generate another, totally different interface automatically
(the one on the "other side" of the glue code).  There are many things
you can do with a suitable higher-level specification that you can't do
with .h files alone...  Sorry, I mean there are many guarantees you can
provide that you can't get with .h files.  Generally there are too many
things you can do with .h files that you really don't want to do...

And in my experience C headers sometimes use nasty things.  Macros are a
pain for instance.  Sure you can make syntactically correct .i3s fairly
easily, but there is no way of knowing how to call them from reading just
the .h; the programmer is reduced to reading machine-generated interfaces,
which is never a pleasant thing.

      Mika



More information about the M3devel mailing list