ECL: Compile Lisp to C

Discussion of other useful tools

ECL: Compile Lisp to C

Postby imba » Thu Nov 25, 2010 7:40 am

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?
imba
 
Posts: 35
Joined: Sun Nov 21, 2010 2:13 pm

Re: ECL: Compile Lisp to C

Postby Ramarren » Thu Nov 25, 2010 11:21 am

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.
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Re: ECL: Compile Lisp to C

Postby imba » Thu Nov 25, 2010 11:33 am

Thank you!
imba
 
Posts: 35
Joined: Sun Nov 21, 2010 2:13 pm

Re: ECL: Compile Lisp to C

Postby Paul Donnelly » Sat Nov 27, 2010 6:23 pm

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.
Paul Donnelly
 
Posts: 148
Joined: Wed Jul 30, 2008 11:26 pm

Re: ECL: Compile Lisp to C

Postby imba » Sun Nov 28, 2010 4:56 pm

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?
imba
 
Posts: 35
Joined: Sun Nov 21, 2010 2:13 pm

Re: ECL: Compile Lisp to C

Postby Ramarren » Sun Nov 28, 2010 11:48 pm

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.
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Re: ECL: Compile Lisp to C

Postby imba » Mon Nov 29, 2010 1:12 pm

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.
imba
 
Posts: 35
Joined: Sun Nov 21, 2010 2:13 pm

Re: ECL: Compile Lisp to C

Postby TheGZeus » Mon Nov 29, 2010 4:50 pm

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.
TheGZeus
 
Posts: 79
Joined: Mon Jun 30, 2008 10:46 am

Re: ECL: Compile Lisp to C

Postby imba » Tue Nov 30, 2010 12:59 pm

I found a working Windows version: http://ecls.wikispaces.com/VCExpress
imba
 
Posts: 35
Joined: Sun Nov 21, 2010 2:13 pm


Return to Other Tools

Who is online

Users browsing this forum: No registered users and 2 guests

cron