[racket] very general reliability of old stuff question

From: Eli Barzilay (eli at barzilay.org)
Date: Sat May 21 00:05:47 EDT 2011

Earlier today, Neil Van Dyke wrote:
> If someone came to you and said, "We're using PLT 4.2.5 with CGC and
> JIT, and we are wondering whether reliability would be improved by
> moving to Racket 5.x

Probably.  Most releases include fixes to crashes...  (And of course
there's no way to compare the number of such fixes vs the number of
new ones...)


> and/or moving to 3m

Definitely.


> and/or disabling 4.2.5's JIT,"

Possibly.  There are occasional jit-related bugs, but I think that
they're quite rare.


> what would you say?

Switching to 3m sounds like the main improvement.  Did you check the
memory footprint?  It can be especially bad with long-running server
processes.  (Specifically, there are certain data patterns that get
CGC to leak very fast.)


> We have set up core dumps

A stack trace from such a dump can be very useful.


> [...] moving to Racket 5.x, moving to 3m (which probably means using
> FFI for our library, or replacing it with pure Scheme Racket code),
> or disabling the 4.2.5 JIT.

If you already have a C-level interface via the C extension system,
then you can keep most of it as is.  As long as the C code deals with
Scheme_Objects, you can then use the ffi to pull the bindings in using
`_scheme' types.  You will, of course, need to be aware of the moving
GC though, in case you want to keep references to racket-allocated
values.

Another strategy for glue code is to rewrite your interface as a
wrapper around the foreign library that exposes a simple interface for
the library.  For example, instead of writing racket glue code that
deals with some exotic foo_struct, you keep it in C, and write
functions that access/mutate such structs given "simple" input/output
values.  The resulting library would be extremely easy to interface
with from the racket ffi.  As a by-product (and relevant if you worry
about GC issues like pointers moving around, GC-visible pointers to
mid-blocks, etc) it can help in separating the two worlds -- since the
only values that pass through to racket are plain values.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.