<div class="gmail_quote">On Fri, Jun 8, 2012 at 6:38 PM, Steve Graham <span dir="ltr"><<a href="mailto:jsgrahamus@yahoo.com" target="_blank">jsgrahamus@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><font face="Courier, Monospaced">I'm looking for a lisp/scheme which can:
<br> 1) Output C code for the application
<br></font></div></div></div></blockquote><div><br></div><div>That's ok with ECL</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif">

<div><font face="Courier, Monospaced"> 2) Can trim unused part (tree shake?) of the compiler/interpreter
<br> which is not needed by the app itself. </font></div></div></div></blockquote></div><br clear="all"><div>ECL is not a compiler/interpreter. It is a library. Just like your C library. So when you link your application with it, you link it with the Common Lisp library.</div>

<div><br></div><div>The problem is that right now ECL is not yet organized as a C library in the sense that when you link with it, you get all of Common Lisp, not just the bits that your application uses. This is so because the original target was a shared library, which saves memory by being shared by as many components as possible (as it happens with your C library)</div>

<div><br></div><div>What would prevent this link-time optimization is currently the list of symbols that ECL has to build. Common Lisp demands that a number of symbols be bound to the functions that they represent. ECL does not know how many symbols you might use during your application's run and thus it has to bind all symbols and functions that belong to the Common Lisp library: you get all of it.</div>

<div><br></div><div>I would go as far as to argue that what you demand is impossible. The following program apparently uses only two functions, but it has access to the whole Common Lisp library</div><div><br></div><div>
(loop for form = (read *standard-input* nil nil nil)</div>
<div>   while form</div><div>   do (eval form))</div><div><br></div><div>Even without the evaluator, things are tricky</div><div><br></div><div>(loop for symbol = (read *standard-input* nil nil nil)</div><div>   while (and symbol (symbolp symbol))</div>

<div>   do (funcall symbol))</div><div><br></div><div>this does not use the interpreter, yet it may invoke any function that is named by the Common Lisp package.</div><div><br></div><div>Juanjo</div><div><br></div>-- <br>

Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a><br>