Efficiently translating Haskell to JVM Bytecode using GHC's intermediate language, STG. LambdaVM is the proof that complete and efficient translation is possible. LambdaVM is a set of patches to GHC's which extend it to fully support generating useable JVM bytecode. It modifies the three primary components of GHC: * The compiler itself: The compiler has been modified to transform STG, one of GHC's many intermediate languages, to JVM bytecode. * The runtime system (RTS): GHC's RTS implemented as a mix of C and C-- has been reimplemented in Java. * The base libraries: GHC's base libraries have been modified to run on top of Java's standard libraries rather than ANSI C/POSIX libraries. October, 2008 Update LambdaVM is coming back! I've fixed all the GHC 6.8.x build problems and the instructions below should once again work. LambdaVM itself is still based on a circa November, 2007 GHC HEAD but moving all my changes to the current HEAD is next
One of the pleasant new features in GHC 6.10 is the long-awaited addition of view patterns. This feature is usually advertised as making it possible to pattern match against the values of an abstract type. An essential aspect of modular software design is that we don't want to expose the implementation of complex code. Someone will surely come along and start making decisions based on bits of our code that they can see, thus limiting our future room to manoeuvre. This is all amply explained on the view pattern wiki page and in the GHC User's Guide. how do they diff from f# active pats
This article is part three in a series on introductory Haskell programming. In the first article, we wrote a small program to recursively scan file-system directories and print their contents as ASCII-art trees. In the second article, we refactored the program to make its logic more reusable by separating the directory-scanning logic from the tree-printing logic. In this article, we will address a shortcoming of the refactored version: It must scan directory hierarchies completely before printing their trees, i.e., it must scan and then print, when doing both simultaneously is both more efficient and more user friendly. Recall from the previous article that our directory-printing program is factored into three pieces of logic:
LambdaVM is a JVM backend for GHC. It is available at http://darcs.brianweb.net/ghc. October, 2008 Update See http://www.cs.rit.edu/~bja8464/lambdavm/ Documentation * Building Guide * FFI * Exceptions * Concurrency Misc Notes * Implementation * Todo * NestedVM Integration
for 6.10 We show how to build a quasiquoter for a simple mathematical expression language. Although the example is small, it demonstrates all aspects of building a quasiquoter. We do not mean to suggest that one gains much from a quasiquoter for such a small language relative to using abstract syntax directly except from a pedagogical point of view---this is just a tutorial!
GHC now (as of early Jan 2006) interprets source files as UTF-8. In -fglasgow-exts mode the above special symbols are interpreted as in JHC. GHC knows about the characters classifications of all unicode characters via the Data.Char library, and can therefore understand identifiers written using alphanumeric characters from any language (but see below for note about caseless character sets).
This paper presents an automatic fusion system, stream fusion, based on equational transformations, that fuses a wider range of functions than existing short-cut fusion systems. In particular, stream fusion is able to fuse zips, left folds and functions over nested lists, including list comprehensions. A distinguishing feature of the stream fusion framework is its simplicity: by transforming list functions to expose their structure, intermediate values are eliminated by general purpose compiler optimisations. We have reimplemented the entire Haskell standard list library on top of our framework, providing stream fusion for Haskell lists. By allowing a wider range of functions to fuse, we see an increase in the number of occurrences of fusion in typical Haskell programs. We present benchmarks documenting time and space improvements.