Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
linking lisp to C/C++
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Zachary Turner  
View profile  
 More options Nov 23 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: "Zachary Turner" <ztur...@elsitech.com>
Date: 1998/11/23
Subject: linking lisp to C/C++
can LISP functions be linked to C/C++?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
willi  
View profile  
 More options Nov 24 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: "willi" <wi...@willi.com>
Date: 1998/11/24
Subject: Re: linking lisp to C/C++
NO, you can only link c++ funktions to lisp not  vice versa

So long willi

Zachary Turner schrieb in Nachricht <73c99f$nl...@uuneo.neosoft.com>...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco Antoniotti  
View profile  
 More options Nov 24 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Marco Antoniotti <marc...@copernico.parades.rm.cnr.it>
Date: 1998/11/24
Subject: Re: linking lisp to C/C++

"willi" <wi...@willi.com> writes:
> NO, you can only link c++ funktions to lisp not  vice versa

AFAIK not even that.  I think most languages support linking of C
objects, not C++. The only way to link in the C++ is to go through a C
layer, pretty much the way it is done in JNI.

Cheers

--
Marco Antoniotti ===========================================
PARADES, Via San Pantaleo 66, I-00186 Rome, ITALY
tel. +39 - (0)6 - 68 10 03 17, fax. +39 - (0)6 - 68 80 79 26
http://www.parades.rm.cnr.it


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Thornley  
View profile  
 More options Nov 24 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: thorn...@visi.com (David Thornley)
Date: 1998/11/24
Subject: Re: linking lisp to C/C++
In article <73c99f$nl...@uuneo.neosoft.com>,
Zachary Turner <ztur...@elsitech.com> wrote:
>can LISP functions be linked to C/C++?

Um, what platform are we talking about?  What Lisp implementation?
What C or C++ implementation?

On my Macintosh, with Macintosh Common Lisp and Metrowerks Codewarrior,
it's easy (provided you do not care about supporting old Macs.).
You simply compile the C and C++ as a shared library, provide a
pointer to the library, define a few entry points in Lisp, and
you're off.  It is necessary that the main program be in Lisp
and the C or C++ in a shared library.

--
David H. Thornley                        | These opinions are mine.  I
da...@thornley.net                       | do give them freely to those
http://www.thornley.net/~thornley/david/ | who run too slowly.       O-


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve Jacobson  
View profile  
 More options Nov 24 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: "Steve Jacobson" <s...@franz.com>
Date: 1998/11/24
Subject: Re: linking lisp to C/C++

Zachary Turner wrote in message <73c99f$nl...@uuneo.neosoft.com>...
>can LISP functions be linked to C/C++?

You can do it with Allegro Common Lisp 5.0

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pierre Mai  
View profile  
 More options Nov 24 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Pierre Mai <p...@acm.org>
Date: 1998/11/24
Subject: Re: linking lisp to C/C++

"willi" <wi...@willi.com> writes:
> NO, you can only link c++ funktions to lisp not  vice versa

> So long willi

> Zachary Turner schrieb in Nachricht <73c99f$nl...@uuneo.neosoft.com>...
> >can LISP functions be linked to C/C++?

There is at least one implementation, where this is wrong: Eclipse
Common Lisp compiles Common Lisp functions to C functions, which can be
linked against other C/C++ code.  Eclipse is a very reasonably priced
commercial CL implementation available for Win32 and Linux, IIRC.  Take
a look at http://www.elwood.com/eclipse/ for more information.

IIRC there is also EcoLisp, which does similar things, but I don't
know any details...

Regs, Pierre.

--
Pierre Mai <p...@acm.org>               http://home.pages.de/~trillian/
  "One smaller motivation which, in part, stems from altruism is Microsoft-
   bashing." [Microsoft memo, see http://www.opensource.org/halloween1.html]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Howard R. Stearns  
View profile  
 More options Nov 24 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: "Howard R. Stearns" <how...@elwood.com>
Date: 1998/11/24
Subject: Re: linking lisp to C/C++

Zachary Turner wrote:

> can LISP functions be linked to C/C++?

See http://www.elwood.com/eclipse-info, and in particular, the paper
link near the top.

More generally, see http://www.elwood.com/alu/table/combine.htm


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zachary Turner  
View profile  
 More options Nov 24 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: "Zachary Turner" <ztur...@elsitech.com>
Date: 1998/11/24
Subject: Re: linking lisp to C/C++

>Um, what platform are we talking about?  What Lisp implementation?
>What C or C++ implementation?

>On my Macintosh, with Macintosh Common Lisp and Metrowerks Codewarrior,
>it's easy (provided you do not care about supporting old Macs.).
>You simply compile the C and C++ as a shared library, provide a
>pointer to the library, define a few entry points in Lisp, and
>you're off.  It is necessary that the main program be in Lisp
>and the C or C++ in a shared library.

No No.  l  I want the other way around.  I want to know if I can write code
in LISP and link it into a program i've written in C or C++.  It shouldn't
matter what platform or implementation of anything I'm on, unless there are
only certain LISP compilers that can do this.  C functions have a standard
calling convention.  It's a matter of whether or not the LISP compiler can
compile it to a C function.  All it really has to do is put the underscore
in front of a function name (of course i know nothing about LISP or how it
handles functions.  the whole reason i started the thread is because i want
to know what i can and can't do with LISP, seeing as how i'm about to start
getting heavily into AI programming.)  But just to clarify i'm using Windows
NT 4.0 and Visual Studio 6.0.  So i want to write some functions in LISP,
compile them into a .DLL (using Allegro CL 5.0 more than likely) and call
one of these .DLL functions from my C++ program.  Can this be done?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christopher Browne  
View profile  
 More options Nov 25 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: cbbro...@news.hex.net (Christopher Browne)
Date: 1998/11/25
Subject: Re: linking lisp to C/C++

Definitely somewhat more problematic, as Lisp programs have some
"expectations" as to their access to memory, and management thereof,
particularly in the context of garbage-collectible objects.

For some insight, you might look at the model used by Guile, a SCM
variant, for how it may be embedded into C applications, you might want
to take a look at:

http://nis-www.lanl.gov/~rosalia/gnudl-doc/learn_libguile_toc.html
http://www.cygnus.com/library/ctr/guile.html
http://www.gnu.org/software/guile/guile.html

The basic point of the exercise is that any variables that you want to
pull into the C/C++ side from the "Lisp side of the world" have to be
specially accessed; variables that you want to push from the "C/C++
side" to the "Lisp side" must similarly be carefully defined so that
garbage collection sees them in an appropriate light.

--
[In response to deprecations of the use of <linux/*.h>]  ...I prefer code
that only compiles on Linux... I really don't care to help other
operating systems grow.  -- Albert D. Cahalan <acaha...@saturn.cs.uml.edu>
cbbro...@hex.net- <http://www.hex.net/~cbbrowne/lsf.html>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bruce Tobin  
View profile  
 More options Dec 5 1998, 3:00 am
Newsgroups: comp.lang.lisp
From: Bruce Tobin <bto...@columbus.rr.com>
Date: 1998/12/05
Subject: Re: linking lisp to C/C++

Zachary Turner wrote:
> [..] But just to clarify i'm using Windows
> NT 4.0 and Visual Studio 6.0.  So i want to write some functions in LISP,
> compile them into a .DLL (using Allegro CL 5.0 more than likely) and call
> one of these .DLL functions from my C++ program.  Can this be done?

Yes.  ACL 5 can compile into DLL format.  ACL 5 has just about everything that a
lot of folks in this newsgroup have been clamoring for; I strongly recommend
that anyone who's thinking about doing Windows development give it a look.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »