Functional Java

Functional Java is an open source library that aims to prepare the Java programming language for the inclusion of closures. It also serves as a platform for learning functional programming concepts by introducing these concepts using a familiar language. The library is intended for use in production applications and is thoroughly tested using the technique of automated specification-based testing with ScalaCheck.

(via PLT)

HtDP Teaches More Than Programming

…you won’t believe it but by reaching part VI, you have mastered a significant chunk of mathematics that you would have never considered within reach had I told you at the outset of your studies that you’d understand rudimentary concepts from “higher” algebra (advanced college material).

— Matthias Felleisen
(via PLT)

Tarski’s World

The package is intended as a supplement to any standard logic text or for use by anyone who wants to learn the language of first order logic. The main body of the book contains a collection of exericses which use the Tarski’s World software to teach the language and semantics of first order logic. The Tarski’s World application allows the evaluation of first-order sentences within blocks world which users may construct using a simple editor. The worlds consist of collections of blocks of varying sizes and shapes, and placed on a checkerboard. We use an interpreted first-order language which allows users to write sentences about these worlds and evaluate their truth. A Henkin-Hintikka game may be used to elucidate the evaluation procedure.

Via PLT, where a few folks shared that this package is quite good.

Good books on automata theory?

I asked “What is a good book on automata theory?” because I don’t recall much of it from college. Marco replied here: Elements of the Theory of Computation by Lewis and Papadimitriou.
Do you know of any more?
Addendum: 19/02/09
Prabhakar added:

The 1979 edition of “Introduction to Automata Theory, Languages, and Computation“, by Hopcroft and Ullman. The algorithms are pretty imperative, though.

Addendum: 20/02/09 at 2:25CST
Jos added:

I very much appreciate: Formal Languages and their |Relation to Automata by John E. Hopcroft and Jeffrey D. Ullman. My first read through it was 40 years ago, but even nowadays I consult it now and then.

Functional Objects

Functional objects is a presentation by Matthias Felleisen from ECOOP 2004. It was mentioned more than a few times during the past month on the PLT discussion list.
Though it is 74 pages, it doesn’t feel very long; and there is a lot of good content in there. “Java people” will even be happy to see Joshoua Bloch’s quotes scattered liberally about.
Basically it tells a story and makes an argument about how one might go about moving forward with programming, and it does well enough in both regards.

SRFI 97: SRFI Libraries

Thanks to the efforts of David Van Horn and the ratification participants; SRFI 97 was produced. Here is the abstract:

Over the past ten years, numerous libraries have been specified via the Scheme Requests for Implementation process. Yet until the recent ratification of the Revised6 Report on the Algorithmic Language Scheme, there has been no standardized way of distributing or relying upon library code. Now that such a library system exists, there is a real need to organize these existing SRFI libraries so that they can be portably referenced.
This SRFI is designed to facilitate the writing and distribution of code that relies on SRFI libraries. It identifies a subset of existing SRFIs that specify features amenable to provision (and possibly implementation) as libraries (SRFI Libraries) and proposes a naming convention for this subset so that these libraries may be referred to by name or by number.

Basically SRFI 97 makes it easier not only to reference SRFIs in R6RS but also to find out if they are even likely to be available.

Adding a gutter to DrScheme

I had asked about how to add a gutter with line numbers to DrScheme, and Robby explained one approach here.

#lang scheme/gui
(require (lib "framework.ss" "framework")
         (lib "etc.ss"))
(define f (new frame:basic% [label ""] [width 500] [height 600]))
(define hp (new horizontal-panel% [parent (send f get-area-container)]))
(define gutter-text (new scheme:text%))
(define gutter-ec (new editor-canvas%
                       [parent hp]
                       [style '(hide-vscroll)]
                       [editor gutter-text]
                       [stretchable-width #f]
                       [min-width 60]))
(define text (new scheme:text%))
(define ec (new editor-canvas% [parent hp] [editor text]))
(send text load-file (build-path (collection-path "drscheme")
                                 "private" "rep.ss"))
(for-each
 (λ (n) (send gutter-text insert (format "~a\n" n)))
 (build-list (send text last-paragraph) add1))
(send gutter-ec scroll-to 0 0 0 0 #t)
(send f show #t)

Putting Java’s Null in its Place

Richard Cobbe’s thesis looks interesting:

Mainstream object-oriented languages include a null value that inhabits every object type and that pervades programs. It exists both because the language semantics requires it in certain places and because it is the most convenient representation for common patterns, such as for sentinel values indicating failure. Safety requires implementations of these languages to insert run-time checks throughout programs to determine whether object references are null at each field lookup and method call.
The ubiquity of null in object-oriented programs leads to severe engineering problems for programmers. First, the error messages issued by the run-time checks are typically not sufficiently informative to help the programmer find the source of the error. Second, the type systems in OO languages generally do not distinguish null from other values of (object) type, preventing the programmer from stating important invariants about the flow of null in the type system. Third, programmers’ standard use of null as a sentinel does not unambiguously represent failures. To resolve or avoid these ambiguities, component authors must incorporate additional complexity into their interfaces, and this complexity can lead to subtle bugs.
In this dissertation, we propose two changes to Java that allow us to completely remove the null value. Doing so addresses the problems above and provides significant engineering benefits to the programmer. Further, we demonstrate the practical feasibility of our proposal with a migration path that allows programmers to shift large codebases from Java to our new language, one class at a time.

(via LtU)

One reason for hygiene

You need hygiene because:

Only superstars on their highest alert level [while writing macros] get things right all the time.

–Matthias
That said, hygiene alone isn’t a cure-all for writing predictable macros. If you don’t understand what you are doing, thoroughly; you will screw up eventually. “Thar be dragons here” as someone once warned on the PLT list.
(via PLT)