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
Lisp as a scripting language from within 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
  19 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
 
dan b  
View profile  
 More options Sep 10 2001, 4:53 pm
Newsgroups: comp.lang.lisp
From: dan_...@Hotmail.com (dan b)
Date: 10 Sep 2001 13:53:21 -0700
Local: Mon, Sep 10 2001 4:53 pm
Subject: Lisp as a scripting language from within C++?
I'm writing a small, simple tile based RPG using C++ to hopefully
expand my knowledge, and I'd like to know how I can use Common Lisp as
a scripting language from within the C++ engine. Yes, I know it would
be much slower than scheme, guile, or TCL, but I want to do it anyway
just for the experience and the fun of it. I'm on a Unix machine
(FreeBSD 4.3 to be exact) and i use the CMU Common lisp compiler. If
it's possisble to use it as a scripting language, could I have a few
links to show how I would go about doing this, as i have no idea where
to even start. Thanks!

 
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 Sep 10 2001, 5:26 pm
Newsgroups: comp.lang.lisp
From: Marco Antoniotti <marc...@cs.nyu.edu>
Date: 10 Sep 2001 17:07:42 -0400
Local: Mon, Sep 10 2001 5:07 pm
Subject: Re: Lisp as a scripting language from within C++?

dan_...@Hotmail.com (dan b) writes:
> I'm writing a small, simple tile based RPG using C++ to hopefully
> expand my knowledge, and I'd like to know how I can use Common Lisp as
> a scripting language from within the C++ engine. Yes, I know it would
> be much slower than scheme, guile, or TCL,

Since when a language for which native compilers exist, is slower than
"scheme, guile, or TCL,"? (And you forgot the innominable one).

Are you trolling?

Cheers

--
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.


 
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.
dan b  
View profile  
 More options Sep 10 2001, 9:28 pm
Newsgroups: comp.lang.lisp
From: dan_...@hotmail.com (dan b)
Date: 10 Sep 2001 18:28:25 -0700
Local: Mon, Sep 10 2001 9:28 pm
Subject: Re: Lisp as a scripting language from within C++?

Marco Antoniotti <marc...@cs.nyu.edu> wrote in message <news:y6c7kv64uw1.fsf@octagon.mrl.nyu.edu>...
> dan_...@Hotmail.com (dan b) writes:

> > I'm writing a small, simple tile based RPG using C++ to hopefully
> > expand my knowledge, and I'd like to know how I can use Common Lisp as
> > a scripting language from within the C++ engine. Yes, I know it would
> > be much slower than scheme, guile, or TCL,

> Since when a language for which native compilers exist, is slower than
> "scheme, guile, or TCL,"? (And you forgot the innominable one).

> Are you trolling?

> Cheers

Woah, chill out, i didn't mean to offend you. I meant as a SCRIPTING
LANGUAGE, i've HEARD, scheme, guile, and TCL are better suited. Back
to my original question, do you know how I could use Common Lisp for
that purpose?

 
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.
Geoffrey Summerhayes  
View profile  
 More options Sep 11 2001, 12:13 am
Newsgroups: comp.lang.lisp
From: "Geoffrey Summerhayes" <sNuOmSrPnA...@hNoOtSmPAaMil.com>
Date: Tue, 11 Sep 2001 00:06:30 -0400
Local: Tues, Sep 11 2001 12:06 am
Subject: Re: Lisp as a scripting language from within C++?

"dan b" <dan_...@Hotmail.com> wrote in message

news:8dea8c27.0109101253.22650b1b@posting.google.com...

> I'm writing a small, simple tile based RPG using C++ to hopefully
> expand my knowledge, and I'd like to know how I can use Common Lisp as
> a scripting language from within the C++ engine. Yes, I know it would
> be much slower than scheme, guile, or TCL, but I want to do it anyway
> just for the experience and the fun of it. I'm on a Unix machine
> (FreeBSD 4.3 to be exact) and i use the CMU Common lisp compiler. If
> it's possisble to use it as a scripting language, could I have a few
> links to show how I would go about doing this, as i have no idea where
> to even start. Thanks!

Search for "Abuse" by crack-dot-com. 2D side scrolling shooter.
They posted the complete code for the game when they went out
of business. The main graphic engine is in C++ with a mini-lisp
interpreter, possibly compiler, built into it. The entire game
logic is written in Lisp. It's also annoyingly fast. Their web
page was still up a year ago, it seems to have finally disappeared.
There were numerous ports to Linux around the web at one time,
check some ftp sites, it's probably still around.

Geoff


 
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.
Thomas F. Burdick  
View profile  
 More options Sep 11 2001, 2:05 am
Newsgroups: comp.lang.lisp
From: t...@conquest.OCF.Berkeley.EDU (Thomas F. Burdick)
Date: 10 Sep 2001 23:05:26 -0700
Local: Tues, Sep 11 2001 2:05 am
Subject: Re: Lisp as a scripting language from within C++?

dan_...@Hotmail.com (dan b) writes:
> I'm writing a small, simple tile based RPG using C++ to hopefully
> expand my knowledge, and I'd like to know how I can use Common Lisp as
> a scripting language from within the C++ engine. Yes, I know it would
> be much slower than scheme, guile, or TCL, but I want to do it anyway
> just for the experience and the fun of it. I'm on a Unix machine
> (FreeBSD 4.3 to be exact) and i use the CMU Common lisp compiler. If
> it's possisble to use it as a scripting language, could I have a few
> links to show how I would go about doing this, as i have no idea where
> to even start. Thanks!

Actually, it's almost certain to be much faster than Guile Scheme or
TCL.  CMUCL makes it very easy for the Lisp program to call out to C,
but it's not so easy for C to call into Lisp.  It's possible, but I
would not recommend it as a way of adding scripting to your program.
Think about it and see if you can come up with a way for it to make
sense for the Lisp to call up into C, and if you can, use CMUCL.

If you can't, try ECLS <http://ecls.sourceforge.net/>, which is
designed to be embedded in C apps.  It's not ANSI compliant, but it's
moving in that direction.  And the limbo between CLtL1 and ANSI CL is
a much nicer place to be than Scheme or, god forbid, TCL.


 
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.
Eugene Zaikonnikov  
View profile  
 More options Sep 11 2001, 6:50 am
Newsgroups: comp.lang.lisp
From: vik...@funcall.org (Eugene Zaikonnikov)
Date: 11 Sep 2001 03:50:14 -0700
Local: Tues, Sep 11 2001 6:50 am
Subject: Re: Lisp as a scripting language from within C++?
dan_...@hotmail.com (dan b) wrote in message

[...]

> I meant as a SCRIPTING LANGUAGE, i've HEARD, scheme, guile, and TCL
> are better suited.

Even if they are, Common Lisp in general is *not* slower than Scheme,
and CMU CL is defenitely faster than Guile (a particular Scheme dialect)
and TCL.

> Back to my original question, do you know how I could use Common Lisp
> for that purpose?

Take a look at http://langband.sf.net - a rougelike RPG using
Common Lisp both as a scripting and the main implementation language.
It's author usually can be found on IRC channel #lisp at
irc.openprojects.net.
--
  Eugene.

 
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.
Erik Naggum  
View profile  
 More options Sep 11 2001, 6:59 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: Tue, 11 Sep 2001 10:59:10 GMT
Local: Tues, Sep 11 2001 6:59 am
Subject: Re: Lisp as a scripting language from within C++?
* dan_...@Hotmail.com (dan b)

> I'm writing a small, simple tile based RPG using C++ to hopefully
> expand my knowledge, and I'd like to know how I can use Common Lisp as
> a scripting language from within the C++ engine.  Yes, I know it would
> be much slower than scheme, guile, or TCL, but I want to do it anyway
> just for the experience and the fun of it.

  Are you referring to the startup time of the interpreter, or to the
  execution time of the code once the interpreter is executing?  Do you
  expect to be able to pre-compile most of the code that will be run, or do
  you intend to ship tons of source code into your system?

///


 
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.
dan b  
View profile  
 More options Sep 11 2001, 10:08 am
Newsgroups: comp.lang.lisp
From: dan_...@hotmail.com (dan b)
Date: 11 Sep 2001 07:08:40 -0700
Local: Tues, Sep 11 2001 10:08 am
Subject: Re: Lisp as a scripting language from within C++?
So it's hard for C to call lisp eh? Hmmm... I was worried about that.
I'm not good enough at lisp to write it in lisp, plus it's graphical
and thats even more advanced if i was to write it in lisp. Well i'll
check out the links you guys gave me. Thanks for answering my
questions.

 
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 Stacy  
View profile  
 More options Sep 11 2001, 1:55 pm
Newsgroups: comp.lang.lisp
From: Christopher Stacy <cst...@spacy.Boston.MA.US>
Date: Tue, 11 Sep 2001 17:53:20 GMT
Local: Tues, Sep 11 2001 1:53 pm
Subject: Re: Lisp as a scripting language from within C++?
>>>>> On 11 Sep 2001 07:08:40 -0700, dan b ("dan") writes:

 dan> So it's hard for C to call lisp eh? Hmmm... I was worried about that.

It's not a standard part of Lisp, and in some compilers it is easy,
as several people pointed out.   (It's the same problem as calling Java.)


 
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.
Thomas F. Burdick  
View profile  
 More options Sep 11 2001, 3:03 pm
Newsgroups: comp.lang.lisp
From: t...@famine.OCF.Berkeley.EDU (Thomas F. Burdick)
Date: 11 Sep 2001 12:03:13 -0700
Local: Tues, Sep 11 2001 3:03 pm
Subject: Re: Lisp as a scripting language from within C++?

dan_...@hotmail.com (dan b) writes:
> So it's hard for C to call lisp eh? Hmmm... I was worried about that.
> I'm not good enough at lisp to write it in lisp, plus it's graphical
> and thats even more advanced if i was to write it in lisp. Well i'll
> check out the links you guys gave me. Thanks for answering my
> questions.

Calling between Lisp and other languages is outside of the scope of
the spec, so statements like "it's hard for C to call Lisp" aren't
very useful.  It is hard for C to call CMUCL.  It's not so hard for C
to call into ECLS.  Try to remember that CL isn't a one-implementation
language, unlike most things people try to use for scripting.

 
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.
Olivier Lefevre  
View profile  
 More options Sep 11 2001, 3:14 pm
Newsgroups: comp.lang.lisp
From: "Olivier Lefevre" <Olivier.Lefe...@genedata.com>
Date: Tue, 11 Sep 2001 21:16:14 +0200
Local: Tues, Sep 11 2001 3:16 pm
Subject: Re: Lisp as a scripting language from within C++?

> Search for "Abuse" by crack-dot-com.

The game seems to live on at abuse2.com and the code at
http://sourceforge.net/projects/abuse2

-- O.L.


 
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.
dan b  
View profile  
 More options Sep 11 2001, 8:05 pm
Newsgroups: comp.lang.lisp
From: dan_...@hotmail.com (dan b)
Date: 11 Sep 2001 17:05:35 -0700
Local: Tues, Sep 11 2001 8:05 pm
Subject: Re: Lisp as a scripting language from within C++?

>   Are you referring to the startup time of the interpreter, or to the
>   execution time of the code once the interpreter is executing?  Do you
>   expect to be able to pre-compile most of the code that will be run, or do
>   you intend to ship tons of source code into your system?

Again-- I am just a newbie, and i'm not sure what the best way to do
it would be, so I'm not sure myself. I was just wondering if it's even
possible-- if so i was looking for links to show how it could be done,
if anyone has more...

 
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.
dave linenberg  
View profile  
 More options Sep 11 2001, 9:15 pm
Newsgroups: comp.lang.lisp
From: dave linenberg <dline...@home.com>
Date: Wed, 12 Sep 2001 01:15:08 GMT
Local: Tues, Sep 11 2001 9:15 pm
Subject: Re: Lisp as a scripting language from within C++?

dan b wrote:
> >   Are you referring to the startup time of the interpreter, or to the
> >   execution time of the code once the interpreter is executing?  Do you
> >   expect to be able to pre-compile most of the code that will be run, or do
> >   you intend to ship tons of source code into your system?

> Again-- I am just a newbie, and i'm not sure what the best way to do
> it would be, so I'm not sure myself. I was just wondering if it's even
> possible-- if so i was looking for links to show how it could be done,
> if anyone has more...

I've called Lisp from C using the following techniques:

The server:
* create a socket server which forks off the following process for each client
trying to connect -
* create a pseudoterminal  (see W.Richard Stevens, Advanced Unix Programming)
* start up CMUCL Lisp in the pseudo terminal
* I have created C functions callable from Lisp which enable it to transmit lisp
data or code back to the client over a socket in a self-describing XDR format

The client:
* A GUI GTK program connects to the lisp server.
* The GUI program executes commands on the lisp server, as if it were on the
same machine or in
the same process space
* If a result is desired, the server is instructed to relay data or code in an
XDR format back to the client.

Using these techniques, I have been able to send code to a lisp server, which
then returns code ..which can
in turn be resent back to the server  (etc etc) until finally data is sent back
to the C program.  Thread(s) are spawned in the client which receives the data,
decodes it, and processes it.

(I actually embed a terminal  (gnome ZVT_TERM  widget) in my client, and I even
employ readline, to make CMUCL code entry easier if I desire to hand to hand
enter it instead of having widget clicks generate it).  Also, my C program uses
the lispreader library (www.complang.tuwien.ac.at/~schani/lispreader/), and all
data returned from CMUCL, gets decoded in C into a lisp_object_t* object, so I
can car , cdr and cons (manipulate) it in C in a lispy way.

There is heavy use of threading, forking, as well as placing graphics events
into the gtk event stack.  The code is currently proprietary, but this should
give you a start.

I'm not sure this is the *best* way of doing it, but it works, and it is
**very** fast.

Dave Linenberg


 
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.
Geoffrey Summerhayes  
View profile  
 More options Sep 11 2001, 10:06 pm
Newsgroups: comp.lang.lisp
From: "Geoffrey Summerhayes" <sNuOmSrPnA...@hNoOtSmPAaMil.com>
Date: Tue, 11 Sep 2001 21:59:49 -0400
Local: Tues, Sep 11 2001 9:59 pm
Subject: Re: Lisp as a scripting language from within C++?

"Olivier Lefevre" <Olivier.Lefe...@genedata.com> wrote in message

news:3b9e6282@news.core.genedata.com...

> > Search for "Abuse" by crack-dot-com.

> The game seems to live on at abuse2.com and the code at
> http://sourceforge.net/projects/abuse2

Interesting. It's a shame they don't have to much there
at the moment although it looks like they've put the entire
original source in the CVS tree. I was thinking about tackling
a rewrite of the code myself and making it Win32-DX friendly.
Since they are aiming for a Win-Linux mix I hope they dump the
assembly code and rely on the compilers instead of consigning
it to x86 machines.

Geoff


 
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.
dan b  
View profile  
 More options Sep 12 2001, 10:01 am
Newsgroups: comp.lang.lisp
From: dan_...@hotmail.com (dan b)
Date: 12 Sep 2001 07:01:35 -0700
Local: Wed, Sep 12 2001 10:01 am
Subject: Re: Lisp as a scripting language from within C++?

Wow! That's a little advanced for me but it might be doable, i've done
linux sockets a little. Thanks alot for that!

 
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.
Dennis Dunn  
View profile  
 More options Sep 12 2001, 9:58 pm
Newsgroups: comp.lang.lisp
From: "Dennis Dunn" <ansof...@bellsouth.net>
Date: Wed, 12 Sep 2001 21:58:09 -0400
Local: Wed, Sep 12 2001 9:58 pm
Subject: Re: Lisp as a scripting language from within C++?
Hey Dan,

You might want to take a look at "librep." It lives on Sourceforge
http://librep.sourceforge.net/ and seems like it might be what you need.  It
is a Lisp system that is meant to be embedded into an application to provide
scripting functionality in that app.

Good luck.

--dennis


 
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.
Håkon Alstadheim  
View profile  
 More options Sep 13 2001, 11:52 pm
Newsgroups: comp.lang.lisp
From: hakonm...@enitel.no (Håkon Alstadheim)
Date: 13 Sep 2001 22:58:45 -0400
Local: Thurs, Sep 13 2001 10:58 pm
Subject: Re: Lisp as a scripting language from within C++?

"Dennis Dunn" <ansof...@bellsouth.net> writes:
> Hey Dan,

> You might want to take a look at "librep." It lives on Sourceforge

Anyone care to characterise where librep lives in the family-trees of
Lisp and Scheme dialects? I seem to remember reading that it started
out as a clone of emacs lisp, and then drifted towards standard lisp.
(Which standard lisp might that be, i.e. when did this drift happen).

Somewhere else I encountered some talk about Scheme in librep. I
believe it encapsulates some kind of embedded Scheme dialect, but how
this works is kind of hazy to me.

The reason I'm asking is because most of sawfish ( default WM for
GNOME) is written in this lispish language. Much of that in a
seemingly Scheemish subset of that lispish language. This language
makes me a bit --- unnhh --- uncomfortable, and as a newbie I need
some guru to tell me exactly why. The more details the better. A good
place to start would be talking about how SETF does not work in
librep.

--
Håkon Alstadheim, Montreal, Quebec, Canada  


 
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.
Janis Dzerins  
View profile  
 More options Sep 14 2001, 3:45 am
Newsgroups: comp.lang.lisp
From: Janis Dzerins <jo...@latnet.lv>
Date: 14 Sep 2001 10:29:42 +0300
Local: Fri, Sep 14 2001 3:29 am
Subject: Re: Lisp as a scripting language from within C++?

hakonm...@enitel.no (Håkon Alstadheim) writes:
> "Dennis Dunn" <ansof...@bellsouth.net> writes:

> > Hey Dan,

> > You might want to take a look at "librep." It lives on Sourceforge

> Anyone care to characterise where librep lives in the family-trees of
> Lisp and Scheme dialects? I seem to remember reading that it started
> out as a clone of emacs lisp, and then drifted towards standard lisp.
> (Which standard lisp might that be, i.e. when did this drift happen).

http://librep.sourceforge.net/librep-manual.html

  librep is a dialect of Lisp, designed to be used both as an
  extension language for applications, and for use as a general
  programming language. It was originally written to be
  mostly-compatible with Emacs Lisp, but has subsequently diverged
  markedly. Its aim is to combine the best features of Scheme and
  Common Lisp and provide an environment that is comfortable for
  implementing both small and large scale systems. It tries to be a
  "pragmatic" programming language.

Although looking at http://librep.sourceforge.net/ I can't see
anything from Common Lisp being added to it.

--
Janis Dzerins

  If million people say a stupid thing it's still a stupid thing.


 
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.
Philip Lijnzaad  
View profile  
 More options Sep 14 2001, 5:15 am
Newsgroups: comp.lang.lisp
From: Philip Lijnzaad <lijnz...@ebi.ac.uk>
Date: 14 Sep 2001 10:15:20 +0100
Local: Fri, Sep 14 2001 5:15 am
Subject: Re: Lisp as a scripting language from within C++?

> A good place to start would be talking about how SETF does not work in
> librep.

If librep is emacs-like, perhaps one could lift all the setf macros out of
Dave Gillespie's emacs 'cl package (or better, integrate it with the librep
distro)?

                                                                       Philip
--
Real programs don't eat cache (Malay)
--------------------------------------------------------------------------- --
Philip Lijnzaad, lijnz...@ebi.ac.uk \ European Bioinformatics Institute,rm A2-08
+44 (0)1223 49 4639                 / Wellcome Trust Genome Campus, Hinxton
+44 (0)1223 49 4468 (fax)           \ Cambridgeshire CB10 1SD,  GREAT BRITAIN


 
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 »