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

From: John Clements (clements at brinckerhoff.org)
Date: Sat Nov 29 18:50:56 EST 2008

On Nov 29, 2008, at 2:50 PM, Chongkai Zhu wrote:

> Zukowski, Steven D wrote:
>> 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.
> a) since you wrote the C code yourself, discard it and write your  
> Scheme code that is equivalent. In general, the Scheme version will  
> be shorter, easier to understand/maintain (in short, better)...
> b) if there is any reason that method A is impossible (say part of  
> the C code can't be rewrite in Scheme), then Scheme's Foreign  
> Language Interface is the way to go. Since you are following the  
> document and got shucked, maybe you should post here the part you  
> have problem with (i.e. the part of the doc that you can't  
> understand), so others can provide help.

I suspect it may be easier just to call the C program using the  
'system' call, but frankly, reading this thread brings out the pedant  
in me:

You can state your question(s) more precisely.  Do it. A more precise  
question will yield a more precise answer.

It sounds like your first questions have to do not with Scheme, but  
rather with building a mental model of OS-level processes (especially  
shells) and how they interact.

Apologies for the supercilious tone,

John Clements

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20081129/8c237b45/attachment.p7s>

Posted on the users mailing list.