Racket v6.1

The Racket Blog 2014-08-03

PLT Design Inc. announces the release of Racket version 6.1 at http://racket-lang.org/ The major innovation concerns local recursive variable definitions. Instead of initializing variables with an undefined value, Racket raises an exception when such a variable is used before its definition. (Thanks to Claire Alvis for adapting Dybvig's "Fixing Letrec" work.) Since programs are rarely intended to produce #<undefined>, raising an exception provides early and improved feedback. Module-level variables have always triggered such an exception when used too early, and this change finally gives local bindings — including class fields — the same meaning. This change is backwards-incompatible with prior releases of Racket. Aside from exposing a few bugs, the change will mainly affect programs that include (define undefined (letrec ([x x]) x)) to obtain the #<undefined> value. In its stead, Racket provides the same value via the racket/undefined library (which was introduced in the previous release). Programmers are encouraged to use it in place of the pattern above to obtain the "undefined" value. The release also includes the following small changes:
  • Plumbers generalize the flush-on-exit capability of primitive output ports to enable arbitrary flushing actions and to give programmers control over the timing of flushes (i.e., a composable atexit). New functions include current-plumber, plumber-add-flush!, and plumber-flush-all.
  • Contracts: the contract system's random testing facility has been strengthened so that it can easily find simple mistakes in contracted data structure implementations (e.g. an accidental reverse of a conditional in a heap invariant check).
  • Redex: the semantics of mis-match patterns (variables followed by _!_) inside ellipses has changed in a backwards-incompatible way. This change simplifies the patterns' semantics and increases the usefulness of these patterns.
  • Teaching languages: check-random is an addition to the preferred unit testing framework in the teaching languages. It enables the testing of students' functions that use random-number generation. (Thanks to David Van Horn (UMaryland) for proposing this idea.)
  • Upgraded and normalized versions of graphics libraries and dependencies (Pango, Cairo, GLib, etc.) that are bundled with Racket on Windows and Mac OS X. For example, FreeType support is consistently enabled.
  • Typed Racket: its standard library includes contracted exports from the Racket standard library, such as the formatting combinators of racket/format. It also supports Racket's asynchronous channels; see the typed/racket/async-channel library.
  • SSL: The openssl library supports forward secrecy via DHE and ECDHE cipher suites (thanks to Edward Lee) and Server Name Indication (thanks to Jay Kominek).
  • The mzlib/class100 library has been removed. Use racket/class instead.