[racket] Compiling Racket on Maemo 5
On Jul 14, Matthew Flatt wrote:
> At Wed, 14 Jul 2010 13:19:36 -0400, Eli Barzilay wrote:
> > On Jul 13, Matthew Flatt wrote:
> > > The main obstacle was that operations like `raco make' and `raco
> > > setup' needed SHA-1 hashing from OpenSSL via the FFI.
> > >
> > > I've adjusted several things so that `make' and `make install' can
> > > work when the FFI is disabled:
> > >
> > > * A new `file/sha1' library ports Eric Knauel's implementation of
> > > SHA-1 to Racket.
> > >
> > > * The `openssl/sha1' library falls back to `file/sha1' when the FFI
> > > isn't supported or when OpenSSL isn't available.
> > > [...]
> > >
> > > Hashing by `file/sha1' is about 500 times as slow as OpenSSL
> > > hashing, but it should work well enough for `raco setup'.
> >
> > Maybe it's better to organize things differently -- make
> > `file/sha1' provide the openssl functionality or the racket
> > version (which will move to a private subdirectory)? This looks
> > like a better layout since it's easier to make it possible to
> > remove openssl,
>
> ? I'm pretty sure that it's easier to remove "openssl" if there's no
> reference from `file/sha1' to `openssl/sha1'.
>
> My rationale was to avoid that dependency (or any `dynamic-require'
> hack that might attempt to make the dependency weak) and also
> provide a simple way to reference the pure-Racket implementation.
Yeah, I had the `dynamic-require' hack in mind...
(And since I'm in package-distribution mode these days, this point is
better too in that aspect -- and that leads to functionality that can
be provided by several packages, which is another thing to consider.)
> > and I think that a `file/sha1' is more visible, so people are
> > likely to use it directly.
>
> True. The docs point to `openssl/sha1', but maybe there's a better
> way.
Renaming it or moving it into a subdirectory might help too, but I
don't have a good idea what would work better. There's also a problem
if the docs point only to the openssl version, since then an
openssl-less installation will not have any mention of it still being
available.
So,
> Surely someone is intrigued that the OpenSSL version is 500 times
> faster, and they will work on the Racket version to make it
> reasonably fast too. Then it won't matter so much. In fact, I'm
> surprised if you haven't started already. :)
obviously, this would be a much better solution, and *obviously* it
was the first thing I thought about when I saw it... I'll probably
get to it at some point.
BTW, I still have an unsafe md5 version that is 4x faster than the
current one -- but without a type checker I didn't feel comfortable
comitting it...
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!