From: Eray Ozkural <exa@kablonet.com.tr>
To: skaller@users.sourceforge.net
Cc: John Goerzen <jgoerzen@complete.org>,
ronniec95@lineone.net, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Efficient C++ interfacing?
Date: Sun, 6 Jun 2004 21:44:54 +0300 [thread overview]
Message-ID: <200406062144.55004.exa@kablonet.com.tr> (raw)
In-Reply-To: <1086505241.16811.625.camel@pelican.wigram>
On Sunday 06 June 2004 10:00, skaller wrote:
> On Sun, 2004-06-06 at 13:33, John Goerzen wrote:
> > On Sun, Jun 06, 2004 at 03:31:04AM +0300, Eray Ozkural wrote:
> > > Skaller, as a KDE developer I beg you. Please do it for Qt and KDE as
> > > well.
> >
> > The other nice thing is this: if we get Qt bindings, then OCaml
> > suddenly becomes a viable language for developing embedded
> > applications thanks to Qt/Embedded. That would be excellent.
>
> Well, there are two obstacles at the moment:
>
> (1) Flxcc can't parse C++ yet
I had started writing a modern top-down C++ parser using the combinatorial
parser library Parsec in Haskell, but I had failed due to lack of time with
the project. I had stumbled upon the two major C++ ambiguity resolutions
which require the parser to know something about the semantics early on and
was frustrated with the amount of work required... Let me know how I can help
with this. There are freely available parser models [LL(k), not LR(k)] which
we can build upon. I think I was following the model from tendra but it's
been ages, now I see that I've written about 15k of Parsec code, I think I've
had a fair amount of C++ parser experience sometime in the past :)
There is also the language extensions of Qt MOC, but after doing C++ it would
be possible to cope with a few simple keywords.
> (2) Flxcc can't target Ocaml yet
This one wouldn't be hard.
> Parsing C++ - templates is quite easy:
> I've already made the mods to Frontc parser.
> However, the parse tree is processed by Cil,
> which does some complex transformations to regularise
> the representation, and modifying that isn't so easy.
> Cil handles the whole of C, whereas we actually only need
> to process interfaces -- expressions could be useful
> (default arguments, template arguments, and typeof)
So, you do have a rudimentary C++ parser?
> Generating Ocaml should be easy. However the program
> will need to be factored to have a selectable backend.
> It will need to do a bit more work than the Felix
> backend however: Ocaml has separate compilation,
> Felix doesn't. Ocaml can't do general recursion,
> Felix has trouble doing anything else.
Ok.
> But I have no doubt it can be done, even if the
> result isn't perfect.
I guess so, too. I dropped my project when I saw SWIG adding Ocaml support.
They even have some Qt examples in their new manual. Again, I have no idea
how well their stuff works. I used SWIG only once, and that was because a
compile required it.
> What's needed is developers.
> Wrapper generators need extensive testing by experts in
> the wrapped libraries, and the code has to be lifted
> out of Felix and put into a new project (and then
> Felix will have to re-integrate it).
Yes. However, doing this wrapper generator is considerably valuable. For
instance, if we can add Qt C++ syntax support, then we can target every KDE
program installed!
> I guess we need 4 developers to start off.
> And a better name than 'flxcc' before registering
> a new project :)
You find the name. I think this list will be a good place to recruit
developers :) I will try to contribute. I was trying to find a way to
contribute to KDE in a useful way now that Qt 4 will feature MVC support that
I was working on :)
Cheers,
--
Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org
http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://malfunct.iuma.com
GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2004-06-06 18:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-30 7:41 Brandon J. Van Every
2004-05-30 11:47 ` ronniec95
2004-05-30 20:17 ` Brandon J. Van Every
2004-06-05 16:45 ` Eray Ozkural
2004-06-05 19:07 ` skaller
2004-06-06 0:31 ` Eray Ozkural
2004-06-06 3:33 ` John Goerzen
2004-06-06 7:00 ` skaller
2004-06-06 16:02 ` David Fox
2004-06-06 18:44 ` Eray Ozkural [this message]
2004-06-06 20:41 ` skaller
2004-06-07 3:04 ` Eray Ozkural
2004-06-07 7:41 ` Benjamin Geer
2004-06-07 13:38 ` Eray Ozkural
2004-06-07 14:18 ` Basile Starynkevitch local
2004-06-07 14:29 ` Eray Ozkural
2004-06-07 16:29 ` Eray Ozkural
2004-06-07 15:46 ` skaller
2004-06-06 16:00 ` David Fox
2004-06-05 21:39 ` Brandon J. Van Every
2004-06-06 16:18 ` David Fox
2004-06-06 18:47 ` Eray Ozkural
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200406062144.55004.exa@kablonet.com.tr \
--to=exa@kablonet.com.tr \
--cc=caml-list@inria.fr \
--cc=erayo@cs.bilkent.edu.tr \
--cc=jgoerzen@complete.org \
--cc=ronniec95@lineone.net \
--cc=skaller@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).