archives

new kid on the block: fun4j is a new fp project for the Java VM

Fun4j aims at bringing concepts from functional programming to the JVM.
It provides developers with a Java API for using functional programming
techniques like anonymous functions, higher order functions and closures.
(see api tutorial for an introduction)

Functions can be defined as Java anonymous classes, or alternatively and
more elegantly, in a functional subset of LISP. LISP- and Java-functions are fully interoperable.
(see java-lisp integration for a short tutorial)

Thus fun4j also comes with a complete lambda-term to Java bytecode compiler and
a small REPL shell. Bytecode is generated on the fly with the superfast ASM library.
Thanks to some simple optimization techniques like tail code optimization (TCO) the compiler produces code that runs pretty fast.
(see the lisp repl for a short intro)

best regards,
Thomas

Articles on deforestation of functional array/vector/matrix operations in a strict language

Also happy to receive articles on deforestation of List operations in a strict language. (I've turned up SPJ's article on "easy" foldr based deforestation of Haskell's list routines).

FYI, my *general* motivation is to support within a language a family of sequence and matrix collections in a manner more-or-less "co-equal" (speed/space efficiency of operators) to the commonplace use of operators on Lists and (lazy) zLists: fixed length arrays, variable length (grow-able, mutable) vectors, Strings, and multidimensional matrices.

As always, many thanks in advance!

S.

Reading advice on memory management

Hi! I am doing some work on using functional languages (F# in particular) for game development. My goal is to capture many of the (informal) conventions that are often used in gamedev inside the language, and I have found that the state monad, quotations and a bit of meta-programming can be amazing in this direction: I have even obtained an 8x speedup by creating my own references and by arbitrating shared memory accesses in different threads statically (by comparing the type of the states of the thread to see if they access the same areas of memory) rather than trusting the garbage collector and locking stuff.

I would like to compare my approach to the existing literature, but I get the feeling that I am touching more areas than I can guess :)
So far I have found stuff that is closely related to the system I have built:
- phantom types where types are used to get faster code with less runtime checks
- resource aware programming where types represent useful information for dealing with low-level constructs
- heterogeneous lists to define one's state and in general to implement smarter containers such as custom objects or records

I have also read very little (mostly theoretical, but I would be more interested in the engineering standpoint) about separation logic, which sounds quite close to what I have done with my threads.

Any advice on further reading?

Thanks a lot!

Articles on Precise GC with Parametric Polymorphism

I've tried to search CiteSeerX for a few days now and haven't managed to turn up anything concrete.

I've only managed to turned up an article on compressing stack maps (MS Research?), three or so articles/theses on "intensional polymorphism" tangentially related, and one or two articles (beyond me, I'll admit) on complex (whole program?) type reconstruction schemes.

While of interest, none of these directly address what I'd wager must be, by now, a commonplace runtime problem to tackle for many gc'd languages supporting parametric polymorphism alongside "unboxed" full machine words/ints, untraced locative pointers, perhaps unboxed doubles, and so forth.

FYI, my interests are both polymorphic variations on the mechanics of static (return address indexed) stack maps, general stack map formats, and strategies for implementing heap object headers for parametric polymorphic data structures.

As always, so many thanks in advance!

S.