hi
Can gambit-c fulfill this requirement? Let's say I have to implement some numerical library, and given some C headers files and description for what the library should do, and the C interface can not be changed for binary compatibility and ABI reason. The library is simply numerical and no IO or system call allowed (except malloc, free, and fprintf for debug). Can Hobbit generate C code that is suitable for linking and embeding in other project? There is no need for an interpreter.
Thanks
Afficher les réponses par date
On 30-Oct-07, at 5:33 PM, naruto canada wrote:
hi
Can gambit-c fulfill this requirement? Let's say I have to implement some numerical library, and given some C headers files and description for what the library should do, and the C interface can not be changed for binary compatibility and ABI reason. The library is simply numerical and no IO or system call allowed (except malloc, free, and fprintf for debug). Can Hobbit generate C code that is suitable for linking and embeding in other project? There is no need for an interpreter.
I assume you mean Gambit (Hobbit is actually the name of another Scheme compiler)...
Let me rephrase. You want to implement a C API in Scheme. The "main program" is in C, and it will call Gambit indirectly through the API. Yes that is possible. Check the code in tests/client.c (the "main program") and tests/server.scm (the Scheme implementation of the API).
Marc
On 10/30/07, Marc Feeley feeley@iro.umontreal.ca wrote:
On 30-Oct-07, at 5:33 PM, naruto canada wrote:
hi
Can gambit-c fulfill this requirement? Let's say I have to implement some numerical library, and given some C headers files and description for what the library should do, and the C interface can not be changed for binary compatibility and ABI reason. The library is simply numerical and no IO or system call allowed (except malloc, free, and fprintf for debug). Can Hobbit generate C code that is suitable for linking and embeding in other project? There is no need for an interpreter.
I assume you mean Gambit (Hobbit is actually the name of another Scheme compiler)...
Sorry, I send four messages to scm gambit-c chicken and bigloo lists, and scm is first one.
Let me rephrase. You want to implement a C API in Scheme. The "main program" is in C, and it will call Gambit indirectly through the API. Yes that is possible. Check the code in tests/client.c (the "main program") and tests/server.scm (the Scheme implementation of the API).
So basically, Gambit-c has all necessary c-types, good. Thanks, will look at it now.
Marc
On 10/30/07, naruto canada narutocanada@gmail.com wrote:
On 10/30/07, Marc Feeley feeley@iro.umontreal.ca wrote:
On 30-Oct-07, at 5:33 PM, naruto canada wrote:
hi
Can gambit-c fulfill this requirement? Let's say I have to implement some numerical library, and given some C headers files and description for what the library should do, and the C interface can not be changed for binary compatibility and ABI reason. The library is simply numerical and no IO or system call allowed (except malloc, free, and fprintf for debug). Can Hobbit generate C code that is suitable for linking and embeding in other project? There is no need for an interpreter.
I assume you mean Gambit (Hobbit is actually the name of another Scheme compiler)...
Sorry, I send four messages to scm gambit-c chicken and bigloo lists, and scm is first one.
Let me rephrase. You want to implement a C API in Scheme. The "main program" is in C, and it will call Gambit indirectly through the API. Yes that is possible. Check the code in tests/client.c (the "main program") and tests/server.scm (the Scheme implementation of the API).
So basically, Gambit-c has all necessary c-types, good. Thanks, will look at it now.
"server.h" has only one function: extern char *eval_string (char *);
The only header file in that directory is server.h I don't think this counts as a good example for implementing a predefined C API? Do you mean, the whole gambit-c interpreter as deliverable?
Marc
On 30-Oct-07, at 6:34 PM, naruto canada wrote:
"server.h" has only one function: extern char *eval_string (char *);
The only header file in that directory is server.h I don't think this counts as a good example for implementing a predefined C API? Do you mean, the whole gambit-c interpreter as deliverable?
It is meant as an example of the general setup of such a program. Clearly you can generalize "server.h" to contain more than one function prototype (and "server.scm" can implement more than one function).
Marc