<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 13, 2010, at 4:05 AM, Gustavo wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">Em 13 de setembro de 2010 02:05, JTK <span dir="ltr"><<a href="mailto:jetmonk@gmail.com">jetmonk@gmail.com</a>></span> escreveu:<br><div><br></div><div>It looks like some implementations need you to say that the array should be created in static memory so it doesn't get relocated. In your library, SBCL is somehow privileged, which is not bad but neither ideal. CFFI seems to have code for using pointers to native Lisp arrays in various implementations. I think the right answer would be to extend the specification of the proposal. CFFI should detect the cases where the implementation can't provide a pointer to the array so it copies the array instead.</div>
<div><br></div><div>Just a though.</div></div></blockquote><br></div><div>Perhaps my explanation is confusing.   Each Lisp is treated exactly the same, because WAAF uses only</div><div>the public CFFI interface.   My code knows nothing about different Lisp implementations.</div><div>SBCL is just an example case that runs very fast, without consing.  CCL is</div><div>slower and conses, but it is not at optimized as SBCL in general.</div><div><br></div><div>I agree that the best of all possible worlds would be code that exploits each Lisp to the fullest of its abilities,</div><div>passing Lisp arrays when it can, and copying when necessary.  But even a copying-only implementation</div><div>is nice to have, because people keep inventing and reinventing it, and doing it well is a fair bit of work.  And it </div><div>can always be improved case by case. And even copy-only has good performance.</div><div><br></div><div>At any rate, I've simply put WAAF on <a href="http://cliki.net">cliki.net</a>.  As long as CFFI doesn't have this capability, people </div><div>can use it if they like or pick another one of the several array interfaces available (though I wish  </div><div>their authors would publicize them on <a href="http://cliki.net">cliki.net</a>).  </div><div><br></div><div>John</div></body></html>