<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">We have a similar problem with CLSQL;
      one API with multiple database backends. CLSQL's backend choice is
      a little different; the backend choice is a user-facing decision
      whereas usocket choosing iolib is an internal matter, but I
      thought I'd offer our approach.<br>
      <br>
      We solve it in two ways:<br>
      <ul>
        <li>an ASD files for each backend: clsql-mysql, clsql-sqlite3,
          etc. (akin to the proposed usocket-iolib)<br>
        </li>
        <li>a generic ASD file that tries to dynamically load more
          backends on request; if we try to connect to a :sqlite3
          database, the connect function checks to see if clsql-sqlite3
          is loaded, and if not, issues the load on the spot - see
          <meta http-equiv="content-type" content="text/html;
            charset=ISO-8859-1">
          <a
href="https://github.com/UnwashedMeme/clsql/blob/master/sql/database.lisp#L99">https://github.com/UnwashedMeme/clsql/blob/master/sql/database.lisp#L99</a></li>
      </ul>
      So library users can specify which backend they want via a direct
      dependency via ASDF, or let the environment take care of it. It's
      not the cleanest solution in the world and has some restrictions,
      but it's worked pretty well.<br>
      <br>
      Thanks,<br>
      <br>
      <pre class="moz-signature" cols="72">Ryan Davis
Director of Programming, Acceleration.net
2837 NW 41st Street, Unit 320
Gainesville, FL 32606
352-335-6500 x124
<a class="moz-txt-link-freetext" href="http://www.acceleration.net">http://www.acceleration.net</a> 
</pre>
      On 06/24/2013 06:27 AM, Chun Tian (binghe) wrote:<br>
    </div>
    <blockquote
      cite="mid:A9C66BF1-DE99-4A5D-8AD9-FD8EDD878B36@gmail.com"
      type="cite">
      <pre wrap="">Hi Anton

On 24/giu/2013, at 18:10, Anton Vodonosov <a class="moz-txt-link-rfc2396E" href="mailto:avodonosov@yandex.ru"><avodonosov@yandex.ru></a> wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
To solve all related issue, I'm going to do some runtime detection on *features*: if last compile time usocket was compiled with or without :usocket-iolib but current load time the feature set is different, ASDF should re-compile all usocket source files instead, not just load previous FASLs.  (I'm not sure if ASDF have already provided such a feature, so let me also copy this mail to Faré, the ASDF maintainer)

I don't like the idea of creating a whole new ASDF system like "usocket-iolib", because that will require other packages to change their system definitions to benefit from this new work.  And the most important thing, whether to depend on IOlib is totally an internal fair of usocket: it doesn't change the programming interface at all.  And the choice on if user want to use native network support of IOlib-based network support on their current platforms, ONLY depends on if they like to load additional DLLs (by CFFI).   I always want usocket  to depend on nothing, so that we can easily patch those 24x7 lisp servers to upgrade the networking support smoothly.
</pre>
        </blockquote>
        <pre wrap="">
I agree that the usocket clients (application and other libraries) should work via the API and do not depend on particular implementation.
What I suggest is to make the implementation switchable at runtime, instead of compile time. I think the solution will be simpler and more flexible solution.
Up the the level that we can have at the same time in the same lisp image both IOlib sockets and sockets based on the API provided by the Lisp implementation.
</pre>
      </blockquote>
      <pre wrap="">
It's possible to implement the runtime switches, and I admit this is a good idea when IOlib is being depended by usocket.   Now I think it's also possible to provide a standalone, new ASDF system "usocket-iolib", which *explicitly* make sure IOlib is used as backend.  But all my previous ideas should still work, there's no conflicts I can see.

</pre>
      <blockquote type="cite">
        <pre wrap="">
Best regards,
- Anton
</pre>
      </blockquote>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>