Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Still looking for C/C++/functional integration

2 views
Skip to first unread message

Alan Baljeu

unread,
Apr 18, 2000, 3:00:00 AM4/18/00
to
I've been searching for a solution to extend our programming environment
beyond just C++. My goals are as follows:
* use a higher-order language (X)
* bidirectional communication between C++ and X
* my program must start the X environment, likely via dynamic linking
* Windows environment (just because that's where we operate)
* Interpreter for X

I guess the bottom line is I'm looking for an interpreter available in
DLL format, or something that runs as an out-of-process server (with
instructions on how to connect).

Here's the summary of what I've found so far:
The Mercury group is working on a CORBA binding, but my impression from
the web page is that this isn't ready for the real world yet.

In Haskell, the foreign function interfaces seem to be well defined, and
are well on their way to being usable. HaskellDirect features an IDL-to-
Haskell compiler, enabling easy connection via COM to other programs.
HaskellScript is a HUGS-derived Windows scripting language useful for OLE
automation (I think.) Unfortunately, I have not yet figured out how I
can fulfill my wishes via Haskell, particularly my program launching a
Haskell interpretive environment.

Scheme seems to have an abundance of implementations, and one of them
should be able to satisfy my needs. On the down side, I don't like its
style. (It's not just the parentheses either.) If nothing else works
out, this is probably the way to go. Scheme does have the advantage of
relative popularity.

SWIG (software interface generator) is a tool devised to cross language
barriers. In its current incarnation, it parses interface definition
files (similar to IDL, and similar to C++ header files), and generates
C++ wrapper code. The wrapper code includes marshalling (type
conversion) functions, and a registration function that registers
functions, classes and objects with the foreign language. This
registration is specific to the implementation of that other language,
but SWIG is designed so you can extend it to new languages.
SWIG seems to have great potential for interoperating between languages.
However, no one has written support for any languages of interest in this
context.

Alan Baljeu

Remi VANICAT

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
Alan Baljeu <aba...@ibm.net.stopspamming> writes:

> I've been searching for a solution to extend our programming environment
> beyond just C++. My goals are as follows:
> * use a higher-order language (X)
> * bidirectional communication between C++ and X
> * my program must start the X environment, likely via dynamic linking
> * Windows environment (just because that's where we operate)
> * Interpreter for X
>
> I guess the bottom line is I'm looking for an interpreter available in
> DLL format, or something that runs as an out-of-process server (with
> instructions on how to connect).
>

in Ocaml, there is a third party library call "top-level" that is
doing what you want, but i don't know if it work under windows (it
work very well under Unix, and ocaml work well under unix and win32)

Ocaml: http://caml.inria.fr/ocaml
Efun (the package that contain the toplevel library):
http://pauillac.inria.fr/~lefessan/src/

(as you can see, toplevel has been develop in the same place than
Ocaml, but not by the same team)

--
JS: par curiosité, quel matériel il faut avoir pour créer son propre FAI ?
J : Pour créer un FAI comme Havas Off Line, une machine à café suffit,
pour l'assistance technique.
-+- in: Guide du Cabaliste Usenet - Bien configurer sa Hot-Line -+-

Arjan van IJzendoorn

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
Hi there,

> Unfortunately, I have not yet figured out how I
> can fulfill my wishes via Haskell, particularly my program launching a
> Haskell interpretive environment.

With HaskellScript you can embed Haskell in webpages. The browser then
starts Hugs as a component and "talks" to it. The same method can be used
for your situation, I think.

Bye,
Arjan


Paul Steckler

unread,
Apr 19, 2000, 3:00:00 AM4/19/00
to
Alan Baljeu (aba...@ibm.net.stopspamming) wrote:
: I guess the bottom line is I'm looking for an interpreter available in
: DLL format, or something that runs as an out-of-process server (with
: instructions on how to connect).

You can embed MzScheme in your C++ program, and call C++ code
from MzScheme. MzScheme doesn't exist as a DLL or
COM class (yet) -- it lives as a static library -- but it
should fit your requirements.

See http://www.cs.rice.edu/CS/PLT/packages/mzscheme/.

The manual Inside Mz explains embedding and the FFI.

-- Paul

----------------------------------------------------------------
| Paul Steckler | Rice University PLT |
| st...@cs.rice.edu | DrScheme Project |
| Tel: 713/348-3814 | http://www.cs.rice.edu/~steck |
| FAX: 713/348-5930 | *** Ad astra per hackera *** |
----------------------------------------------------------------

Fergus Henderson

unread,
Apr 20, 2000, 3:00:00 AM4/20/00
to
Alan Baljeu <aba...@ibm.net.stopspamming> writes:

>I've been searching for a solution to extend our programming environment
>beyond just C++. My goals are as follows:
>* use a higher-order language (X)
>* bidirectional communication between C++ and X
>* my program must start the X environment, likely via dynamic linking
>* Windows environment (just because that's where we operate)
>* Interpreter for X
>

>I guess the bottom line is I'm looking for an interpreter available in
>DLL format, or something that runs as an out-of-process server (with
>instructions on how to connect).
>

>Here's the summary of what I've found so far:
>The Mercury group is working on a CORBA binding, but my impression from
>the web page is that this isn't ready for the real world yet.

Yes, that's pretty much correct. Mercury's C interface, however, is
certainly ready for the real world, and you can use that to interface
with C++ (using `extern "C"' on the C++ side). The Mercury's C
interface is bidirectional.

However, Mercury fails one of your other requirements: as yet
there's no interpreter, only a compiler.

--
Fergus Henderson <f...@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger f...@128.250.37.3 | -- the last words of T. S. Garp.

Tyson Richard DOWD

unread,
Apr 22, 2000, 3:00:00 AM4/22/00
to
Alan Baljeu <aba...@ibm.net.stopspamming> writes:

>Here's the summary of what I've found so far:
>The Mercury group is working on a CORBA binding, but my impression from
>the web page is that this isn't ready for the real world yet.

No. Although what's on the web page is not the latest version we have
in development. David Jeffery has made significant progress in adding
support for more types.

Tyson.

Asger K. Alstrup Nielsen

unread,
Apr 29, 2000, 3:00:00 AM4/29/00
to
Alan Baljeu <aba...@ibm.net.stopspamming> writes:

>I've been searching for a solution to extend our programming environment
>beyond just C++. My goals are as follows:
>* use a higher-order language (X)
>* bidirectional communication between C++ and X
>* my program must start the X environment, likely via dynamic linking
>* Windows environment (just because that's where we operate)
>* Interpreter for X

May I suggest an alternative that seems to obey your requirements?

If you can't use a higher level language together with C++, then
bring the higher level language into C++.

Check out these links:

http://www.fz-juelich.de/zam/FACT/
http://lambda.cs.utu.fi/

The first describes a method to use a form of lambda expressions
directly in C++.
The second describes another method for the same, and in addition
a way to use tuples similar to those in ML.

The rumour is that the May issue of C++ report will contain an
article about lambda expressions in C++.

Greets,

Asger Alstrup

Michael Hudson

unread,
Apr 29, 2000, 3:00:00 AM4/29/00
to
Alan Baljeu <aba...@ibm.net.stopspamming> writes:

> I've been searching for a solution to extend our programming environment
> beyond just C++. My goals are as follows:
> * use a higher-order language (X)
> * bidirectional communication between C++ and X
> * my program must start the X environment, likely via dynamic linking
> * Windows environment (just because that's where we operate)
> * Interpreter for X
>

> I guess the bottom line is I'm looking for an interpreter available in
> DLL format, or something that runs as an out-of-process server (with
> instructions on how to connect).

Python? Not functional, admittedly, but it has higher order
functions, integrates well with C++, Windows and generally seems to
satisfy all demands made in the post...

Cheers,
Michael

--
incidentally, asking why things are "left out of the language" is
a good sign that the asker is fairly clueless.
-- Erik Naggum, comp.lang.lisp

Michael Dingler

unread,
Apr 29, 2000, 3:00:00 AM4/29/00
to
> If you can't use a higher level language together with C++, then
> bring the higher level language into C++.
>
> Check out these links:
>
> http://www.fz-juelich.de/zam/FACT/
> http://lambda.cs.utu.fi/

OpenC++ might help here, too. You'll probably have to
do a lot of work on your own as there's no implicit
support for functional programming, just a MOP that
might help you to achieve this. On the other hand,
it should work without templating your code to death
with a wet towel...

That would be
http:/www.softlab.is.tsukuba.ac.jp/~chiba/openc%2B%2B.html


...Michael...

Friedrich Dominicus

unread,
Apr 30, 2000, 3:00:00 AM4/30/00
to

I may have got you completly wrong, but anyway I give it a try.

als...@diku.dk (Asger K. Alstrup Nielsen) writes:

> Alan Baljeu <aba...@ibm.net.stopspamming> writes:
>
> >I've been searching for a solution to extend our programming environment
> >beyond just C++. My goals are as follows:
> >* use a higher-order language (X)
> >* bidirectional communication between C++ and X
> >* my program must start the X environment, likely via dynamic linking
> >* Windows environment (just because that's where we operate)
> >* Interpreter for X

Isn't that what e.g Elk is all about? Please check
http://www.schemers.org

And does not any other functional language which can easily interfaced
with C++ do the job, then it would fall back to a question about FFI.
Check out: http://xarch.tu-graz.ac.at/autocad/lisp/ffis.html for on
survey of different FFIs

Otherwise you may have a look at RUBY
www.ruby-lang.org

Regards
Friedrich

Asger K. Alstrup Nielsen

unread,
Apr 30, 2000, 3:00:00 AM4/30/00
to
Michael Dingler <mdin...@mindless.com> writes:

>OpenC++ might help here, too. You'll probably have to
>do a lot of work on your own as there's no implicit
>support for functional programming, just a MOP that
>might help you to achieve this. On the other hand,
>it should work without templating your code to death
>with a wet towel...

Related, it's worth mentioning App:

http://www.primenet.com/~georgen/app.html

This is a preprocessor which will give you algebraic types
and pattern matching.

Greets,

Asger Alstrup

David McClain

unread,
Apr 30, 2000, 3:00:00 AM4/30/00
to
Have you looked closely at the OCaml language? It does everything you ask
for in your list below. See http://caml.inria.fr

- DM

Asger K. Alstrup Nielsen <als...@diku.dk> wrote in message
news:8eeusg$l...@tyr.diku.dk...


> Alan Baljeu <aba...@ibm.net.stopspamming> writes:
>
> >I've been searching for a solution to extend our programming environment
> >beyond just C++. My goals are as follows:
> >* use a higher-order language (X)
> >* bidirectional communication between C++ and X
> >* my program must start the X environment, likely via dynamic linking
> >* Windows environment (just because that's where we operate)
> >* Interpreter for X
>

> May I suggest an alternative that seems to obey your requirements?
>

> If you can't use a higher level language together with C++, then
> bring the higher level language into C++.
>
> Check out these links:
>
> http://www.fz-juelich.de/zam/FACT/
> http://lambda.cs.utu.fi/
>

Simon Helsen

unread,
Apr 30, 2000, 3:00:00 AM4/30/00
to
>Alan Baljeu <aba...@ibm.net.stopspamming> writes:
>
>>I've been searching for a solution to extend our programming environment
>>beyond just C++. My goals are as follows:
>>* use a higher-order language (X)
>>* bidirectional communication between C++ and X
>>* my program must start the X environment, likely via dynamic linking
>>* Windows environment (just because that's where we operate)
>>* Interpreter for X

Smalltalk perhaps? I don't know how well it integrates with C++, but it's
HO, has a Windows environment and interactive IDE (interpreter). I've no
idea how easy/difficult it is to start a smalltalk evironment from C++,
but my guess this would all work out. And the advantage is that you stay
in a OO setting (an advantage unless you're not writing OO in C++)

check http://www.smalltalksystems.com/references.htm

regards,

Simon

0 new messages