Page 1 of 1

ECL: Compile Lisp to C

PostPosted: Thu Nov 25, 2010 7:40 am
by imba
Hi,

i followed the instructions in http://ecls.sourceforge.net/new-manual/ch24s06.html and compiled a .lisp file into .fas and .o files, and finally into an executable (Ubuntu 10.10). But how can I produce a .c file?

Re: ECL: Compile Lisp to C

PostPosted: Thu Nov 25, 2010 11:21 am
by ramarren
imba wrote:But how can I produce a .c file?


The .c file is obviously produced during compilation, because otherwise it wouldn't be possible to produce the .o file. It is the deleted, because it is not really designed for human consumption. I am not sure if there is exposed interface for suppressing the deletion, but you can set the c::*delete-files* variable to NIL. Just don't expect the .c files to be comprehensible unless you already know something about ECL code generator.

Re: ECL: Compile Lisp to C

PostPosted: Thu Nov 25, 2010 11:33 am
by imba
Thank you!

Re: ECL: Compile Lisp to C

PostPosted: Sat Nov 27, 2010 6:23 pm
by Paul Donnelly
If you just want to see the code generated for a particular function, I think DECOMPILE can show you that in ECL. Something like that; it's in the manual.

Re: ECL: Compile Lisp to C

PostPosted: Sun Nov 28, 2010 4:56 pm
by imba
Ramarren wrote:
imba wrote:But how can I produce a .c file?


The .c file is obviously produced during compilation, because otherwise it wouldn't be possible to produce the .o file. It is the deleted, because it is not really designed for human consumption. I am not sure if there is exposed interface for suppressing the deletion, but you can set the c::*delete-files* variable to NIL. Just don't expect the .c files to be comprehensible unless you already know something about ECL code generator.
Strange: This doesn't work on Debian. Is there a way to prevent *my-program*.c and .h from being deleted?

Re: ECL: Compile Lisp to C

PostPosted: Sun Nov 28, 2010 11:48 pm
by ramarren
What exactly did you do? Also, are you looking in a correct place? Temporary files, which, as I said, the .c and .h files are from ECL perspective, might be somewhere under /tmp/ or ~/.fasls or whatever. Look at compilation commands which scroll by while compiling anything with ECL.

Re: ECL: Compile Lisp to C

PostPosted: Mon Nov 29, 2010 1:12 pm
by imba
I wrote a bash script, which creates a backup of the .c/.h files after being written to them.

Now I have another question: Did anyone manage to compile ECL on Windows using MSVC++? I get the error "msvcrt.lib" not found (by nmake), although ...\VC\lib is in PATH.

Re: ECL: Compile Lisp to C

PostPosted: Mon Nov 29, 2010 4:50 pm
by TheGZeus
imba wrote:I wrote a bash script, which creates a backup of the .c/.h files after being written to them.

Now I have another question: Did anyone manage to compile ECL on Windows using MSVC++? I get the error "msvcrt.lib" not found (by nmake), although ...\VC\lib is in PATH.

It's designed to work with GCC iirc.
Probably a number of GNU-isms in the code.

Re: ECL: Compile Lisp to C

PostPosted: Tue Nov 30, 2010 12:59 pm
by imba
I found a working Windows version: http://ecls.wikispaces.com/VCExpress