Calling scheme/lisp from C shared object - commercial application 
Author Message
 Calling scheme/lisp from C shared object - commercial application

Quote:

>This would be for use in a commercial product.      I talked to a couple of
>the commercial vendors and have not found a product that will work,
>although one company did offer to modify their product to do this.

>Does anyone know of any lisp/scheme implementation that would work for me?

I'm not absolutely sure that it'll do what you want it to, but have you
looked at SIOD?  It seems to fit the bill as a small-footprint Scheme
designed for embedded use.

Unfortunately, there isn't all that much documentation out there.  You
basically have to deduce the workings from the mostly-uncommented
source code and a few examples.  There's a SIOD user's web page, and
the author, George Carrette, has a web page for it at:

          http://www.*-*-*.com/

Hopefully it will do what you need it to do.  It certainly does provide
functions like:
        repl_c_string("(define (square x) (+ x 2))",0,0,0)
and there are a few ways to get access to stuff defined in the current
REPL.

I hope that helps,

- Johann
--
Johann A. Hibschman         | Grad student in Physics, working in Astronomy.



Mon, 17 Apr 2000 03:00:00 GMT  
 Calling scheme/lisp from C shared object - commercial application

MzScheme (http://www.cs.rice.edu/CS/PLT/packages/mzscheme/) will do
this sort of thing for you.  It gives you a complete Scheme, including
continuations and tail calling, and has extensions like modules and
objects so you won't have to change Scheme's at any point.  And it
runs on a wide variety of platforms.

'shriram



Mon, 17 Apr 2000 03:00:00 GMT  
 Calling scheme/lisp from C shared object - commercial application

Quote:

>     lisp_loadFunction("(defun square(x)(* x x))");

>     result = lisp_callFunction("(square 2)");

Since everyone has mentioned how their dialect does it, I'll throw in
a word for Guile, which is designed for this kind of thing.

You would do the above with [note I use Scheme syntax, not CL]:

  SCM result;
  /* [...] */
  gh_eval_str("(define (square x) (* x x))");
  result = gh_eval_str("(square 2)");

Quote:
> I am writing a Sun shared object so the lisp implementation cannot
> include a main program.  Since I am not writing main I do not have access
> to argv[0] as required for use of some scheme implementations such as
> ELK.

You don't need access to argv[0] for Guile, but you would have to
"enter" the interpreter by offering it a sacrificial function.  The
interpreter would only be valid in that function.  I'm experimenting
with ways of making Guile not require this, but to be robust it needs
a C library call that returns the stack base, and that is not
standard.

Quote:
> This would be for use in a commercial product.     I talked to a couple of
> the commercial vendors and have not found a product that will work,
> although one company did offer to modify their product to do this.

You can use Guile in a commercial product as long as you respect the
GLGPL (a slight modification of the LGPL).  The GLGPL says you don't
have to offer source for the rest of your program -- just for Guile.
But you must use Guile unmodified.

--
             Mark Galassi --- astrophysicist, hacker, writer
             Cygnus Solutions and Los Alamos National Laboratory

                                 http://nis-www.lanl.gov/~rosalia/



Fri, 21 Apr 2000 03:00:00 GMT  
 Calling scheme/lisp from C shared object - commercial application



Quote:


>> I am writing a Sun shared object so the lisp implementation cannot
>> include a main program.  Since I am not writing main I do not have access
>> to argv[0] as required for use of some scheme implementations such as
>> ELK.

>You don't need access to argv[0] for Guile, but you would have to
>"enter" the interpreter by offering it a sacrificial function.  The
>interpreter would only be valid in that function.  I'm experimenting
>with ways of making Guile not require this, but to be robust it needs
>a C library call that returns the stack base, and that is not
>standard.

Given Guile's relationship with SIOD, have you looked at the way
it's done there? That code looks like system dependent magic,
but it does work and simplifies the initialization from the
main program's point of view.

Ulric
--
Should we or should we not follow the advice of the galactically stupid?



Thu, 27 Apr 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Calling scheme/lisp from C shared object - commercial application

2. Lisp syntax : Lisp objects :: Scheme syntax : characters

3. Commercial applications using an embedded lisp ?

4. Lisp commercial Windows application

5. Lisp and commercial applications

6. Commercial applications using an embedded lisp ?

7. Commercial Uses of Lisp (call for Volunteers)

8. Tcl_ListObjAppendElement called with shared object (crash - differs from previous posted issues)

9. Tcl_AppendStringsToObj called with shared object

10. Tcl_AppendStringsToObj called with shared object

11. Called with shared object (known buggette?)

12. Q: Tcl_ListObjAppendElement called with shared object; Abort

 

 
Powered by phpBB® Forum Software