| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi, which would be the best scheme implementation for embedding in a C program. I think what I need is a scheme that is provided as a library that I can link with the rest of my app. But main() will be in the C application, not in the scheme library. I would want to be able to create scheme functions callable from the C application. I would also need to call C functions from scheme. I think maybe guile does all this, but was wondering if there were any others out there that can work this way. It would need to work on Linux x86 and OSX x86. Thanks, Neil |
|
#2
| |||
| |||
| On 24 ago, 22:39, Neil Baylis <neil.bay...@gmail.com> wrote: > Hi, > > which would be the best scheme implementation for embedding in a C > program. I think what I need is a scheme that is provided as a library > that I can link with the rest of my app. But main() will be in the C > application, not in the scheme library. I would want to be able to > create scheme functions callable from the C application. I would also > need to call C functions from scheme. > > I think maybe guile does all this, but was wondering if there were any > others out there that can work this way. It would need to work on > Linux x86 and OSX x86. > > Thanks, > > Neil Have you looked at tinyscheme? Not quite R5RS-compatible, let alone R6RS, but a fine and lightweight Scheme terp. http://tinyscheme.sourceforge.net/home.html |
|
#3
| |||
| |||
| Neil Baylis <neil.baylis@gmail.com> writes: > Hi, > > which would be the best scheme implementation for embedding in a C > program. I think what I need is a scheme that is provided as a library > that I can link with the rest of my app. But main() will be in the C > application, not in the scheme library. I would want to be able to > create scheme functions callable from the C application. I would also > need to call C functions from scheme. > > I think maybe guile does all this, but was wondering if there were any > others out there that can work this way. It would need to work on > Linux x86 and OSX x86. AFAIKT this was the "goal" of Guile and it should replace Emacs Lisp, but this never has taken place really. If you are a bit flexible about the language you might like to check lush (which stated goals is for "embedding" http://lush.sourceforge.net/ Regards Friedrich -- Please remove just-for-news- to reply via e-mail. |
|
#4
| |||
| |||
| Friedrich <just-for-news-frido@q-software-solutions.de> writes: > Neil Baylis <neil.baylis@gmail.com> writes: > >> Hi, >> >> which would be the best scheme implementation for embedding in a C >> program. I think what I need is a scheme that is provided as a library >> that I can link with the rest of my app. But main() will be in the C >> application, not in the scheme library. I would want to be able to >> create scheme functions callable from the C application. I would also >> need to call C functions from scheme. >> >> I think maybe guile does all this, but was wondering if there were any >> others out there that can work this way. It would need to work on >> Linux x86 and OSX x86. > AFAIKT this was the "goal" of Guile and it should replace Emacs Lisp, > but this never has taken place really. If you are a bit flexible about > the language you might like to check lush (which stated goals is for > "embedding" > http://lush.sourceforge.net/ Well then, you might also consider ECL : http://ecls.sourceforge.net which is a nice embeddable CL implementation. -- __Pascal Bourguignon__ http://www.informatimago.com/ ADVISORY: There is an extremely small but nonzero chance that, through a process known as "tunneling," this product may spontaneously disappear from its present location and reappear at any random place in the universe, including your neighbor's domicile. The manufacturer will not be responsible for any damages or inconveniences that may result. |
|
#5
| |||
| |||
| Neil Baylis wrote: > Hi, > > which would be the best scheme implementation for embedding in a C > program. I think what I need is a scheme that is provided as a library > that I can link with the rest of my app. But main() will be in the C > application, not in the scheme library. I would want to be able to > create scheme functions callable from the C application. I would also > need to call C functions from scheme. > > I think maybe guile does all this, but was wondering if there were any > others out there that can work this way. It would need to work on > Linux x86 and OSX x86. > > Thanks, > > Neil I have used plt-scheme (MzScheme) in the past to do exactly what you are stating. I was able to call C to Scheme, then back to C, then back to Scheme to many levels of recursion without any problems. It worked well and was easy to do. The only problem I seem to remember is that I was unable to get it to work with native threads. Blake McBride |
|
#6
| |||
| |||
| Hallo, On Aug 24, 10:39*pm, Neil Baylis <neil.bay...@gmail.com> wrote: > Hi, > > which would be the best scheme implementation for embedding in a C > program. I think what I need is a scheme that is provided as a library > that I can link with the rest of my app. But main() will be in the C > application, not in the scheme library. I would want to be able to > create scheme functions callable from the C application. I would also > need to call C functions from scheme. > I am currently using Gambit-C for this. You can call C functions from Scheme, Scheme functions from C etc. -alex |
|
#7
| |||
| |||
| On Aug 26, 5:33*am, asandroq <asand...@gmail.com> wrote: > Hallo, > > On Aug 24, 10:39*pm, Neil Baylis <neil.bay...@gmail.com> wrote: > > > Hi, > > > which would be the best scheme implementation for embedding in a C > > program. I think what I need is a scheme that is provided as a library > > that I can link with the rest of my app. But main() will be in the C > > application, not in the scheme library. I would want to be able to > > create scheme functions callable from the C application. I would also > > need to call C functions from scheme. > > * * *I am currently using Gambit-C for this. You can call C functions > from Scheme, Scheme functions from C etc. > > -alex I'm finding that when I link against the gambit runtime, I get duplicate definitions of main(). Is it possible to make a gambit runtime library that doesn't declare main()? |
|
#8
| |||
| |||
| On Aug 24, 10:58*pm, namekuseijin <namekusei...@gmail.com> wrote: > On 24 ago, 22:39, Neil Baylis <neil.bay...@gmail.com> wrote: > > > > > Hi, > > > which would be the best scheme implementation for embedding in a C > > program. I think what I need is a scheme that is provided as a library > > that I can link with the rest of my app. But main() will be in the C > > application, not in the scheme library. I would want to be able to > > create scheme functions callable from the C application. I would also > > need to call C functions from scheme. > > > I think maybe guile does all this, but was wondering if there were any > > others out there that can work this way. It would need to work on > > Linux x86 and OSX x86. > > > Thanks, > > > Neil > > Have you looked at tinyscheme? *Not quite R5RS-compatible, let alone > R6RS, but a fine and lightweight Scheme terp. > > http://tinyscheme.sourceforge.net/home.html This looks like a possibility, thanks. I would prefer a compiler, but this might work for me. |
|
#9
| |||
| |||
| Just a clarification of what I'm trying to accomplish... I'm trying to understand how one would write a plugin in scheme (or CL). For example, a screensaver, a firefox plugin, an itunes plugin, or a photoshop plugin. The plugin needs to export an entry point that the main app calls. This will be with c calling conventions. During this call, the plugin initializes itself, allocates memory, etc. It obtains pointers to functions it must call, and provides pointers to functions that the main app can call. Maybe they pass c structs between them. However: the main app is already linked, and has its own main() entry point. To provide a plugin, you don't link against the main app. Instead, it discovers your plugin at runtime (by searching some well known path), and calls your exported entry point. |
|
#10
| |||
| |||
| On Aug 26, 12:41*pm, Neil Baylis <neil.bay...@gmail.com> wrote: > > I'm finding that when I link against the gambit runtime, I get > duplicate definitions of main(). Is it possible to make a gambit > runtime library that doesn't declare main()? You must compile the C sources Gambit-C generates with ___LIBRARY defined (-D___LIBRARY). For a complete example, look for the `pthread' example in Gambit-C source package. -alex |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.