This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Feature proposal: Kawa socket procedures


Thank you Per.

On Tue, Dec 29, 2009 at 6:25 AM, Per Bothner <per@bothner.com> wrote:
>
> Have you looked at other Scheme APIs for sockets?
Yes and discarded: my main aim was "to wrap" the Java API. But really
the instant after reading your question I thought that you are right
and asked myself: why simply write a wrapper (as I've done)?

> Coincidentally, Aaron Hsu today announced a socket library:
> http://lists.r6rs.org/pipermail/r6rs-discuss/2009-December/006112.html
> Chez Scheme also has a sockets library.
>
I'll download Aaron Hsu's library.
Yes, I've also seen:
(*) the "minimalistic"  :-) MIT socket procedures...
http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-ref/TCP-Sockets.html
(*) PLT socket.ss
http://planet.plt-scheme.org/package-source/vyzo/socket.plt/1/0/doc.txt
(*) Bigloo http://pauillac.inria.fr/cdrom_a_graver/www/bigloo/manual/bigloo-5.9.html
Other Scheme implementations are (more or less) mirroring the native C
library socket. But there are some issues along that path, because in
a "Java environment" the "char" and "byte" types are strongly
distinct.
Anyway, you are right: already having the Java API, it would be better
to adapt/adopt a full Scheme library.

> Also, I think this is too large and non-standard an API to be
[..]
> be done as:
> ?(import (kawa sockets))
Again, you're right. :-)

>
> Could tell me more about why you need to call setAccessible?
>
I use Kawa most in an interactive way (I know that it is
compiler-oriented, but I prefer the interactive, at least during
development... :-)) and - calling the Java socket API  - I faced the
problem described here (java.lang.IllegalAccessException: Class
gnu.expr.PrimProcedure can not access a member of class foo with
modifiers "public"):

http://savannah.gnu.org/bugs/?27239

and here:

http://sourceware.org/ml/kawa/2000/msg00294.html

so I simply applied the minimal change that let my code running...

> There are some style issues: ?These days I prefer type specifiers
> without the angle brackets, and instead of say:
> ?(*:closed? (socket-java-implementation socket))
> I now suggest:
> ?((socket-java-implementation socket):closed?)
Absolutely better! I agree. :-)

Please give me (some :-)) time to see Aaron Hsu's library.
A full Scheme-portable library would be the best.
Bye.
Andrea


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]