[plt-scheme] Help intigrating C/C++ into Scheme

From: Zukowski, Steven D (Steven_Zukowski at student.uml.edu)
Date: Sat Nov 29 17:38:10 EST 2008

Well I was hoping to communicate to it the easiest way possible which seemed like calling it directly from the Scheme program. I'm not sure what you mean by sockets exactly, but running it via command-line arguments did cross my mind to. I'm just at a complete loss about how to do, well, any of that from the Scheme program.

Also the program is one I'm writing myself and is very easy to for me to edit.

Steven Zukowski

-----Original Message-----
From: Geoffrey S. Knauth [mailto:geoff at knauth.org]
Sent: Sat 11/29/2008 5:33 PM
To: Zukowski, Steven D
Cc: plt-scheme at list.cs.brown.edu
Subject: Re: [plt-scheme] Help intigrating C/C++ into Scheme
 
On Nov 29, 2008, at 16:59, Zukowski, Steven D wrote:
> I am trying to have a Scheme program take input from the user, store  
> that, and then send that off to a C/C++ program for processing. Once  
> the data has been processed and worked I want to send it back to the  
> waiting Scheme program where it will then be displayed. I want the  
> user to start the Scheme Program which then brings up the GUI  
> interface I'm building, input the data and hit enter. Once the user  
> hits enter I want the Scheme part to call the C program and give it  
> the user provided parameters. The C program works them, then returns  
> the result to Scheme and shuts down.
>
> I am stuck at the part where I give data to a C/C++ program and then  
> get it back. I have tried exploring Scheme's Foreign Language  
> Interface but I can't get things working. I have tried reading over  
> the documentation supplied in the PLT docs on the PLT Scheme C API  
> but I just can't follow them. In short, I am completely stuck and I  
> have no idea how to proceed.
>
> Please, can someone tell me how to interface to a C program or link  
> one in with Scheme, I'm not sure the right way to say it. Or can  
> someone please point me to a in-depth tutorial for doing this? The  
> instructions on the PLT docs was not helpful because they were over  
> my head.
>

Steve,

How did you want to communicate to the C/C++ program?  Via sockets?   
Command-line arguments?  Direct call to C/C++ functions?  Is this a C/C 
++ program you wrote?  (I'm wondering how easy it is for you to edit  
its source code.)  If you didn't write the C/C++ program, is it well  
known?  Do other programs or languages typically interface to this C/C+ 
+ program already?

Geoff


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20081129/060d95da/attachment.html>

Posted on the users mailing list.