Functional

F#, a functional language for .Net

From Microsoft Research:

F# is a variant of ML with a core language akin to that of the OCaml programming language. F# runs on top of the .NET Framework and in many ways the language is designed to be an "ML that fits with .NET". F# includes extensions for working across languages, and the aim is to have it work together seamlessly with C#, COmega, Visual Basic, SML.NET and other .NET programming languages and tools. It is the first ML language where all the types and values in an ML program can be accessed from some significant object-oriented imperative languages (e.g. C#) in a predictable and (reasonably) friendly way.

Generalized ADTs in Haskell

Simon Peyton-Jones, via Haskell-list:

I've finished my first attempt at implementing Generalised Algebraic
Data types in GHC. Ordinary algebraic data types are generalised to
allow you to write an explicit type signature for each constructor; for
example:

     data Term a where
	Lit :: Int -> Term Int
	Succ :: Term Int -> Term Int
	IsZero :: Term Int -> Term Bool	
	If :: Term Bool -> Term a -> Term a -> Term a

Notice that some of these constructors have return types that are not
just "Term a"... that's the whole point! Now you can write typed
evaluator for these terms:

    eval :: Term a -> a
    eval (Lit i)		= i
    eval (Succ t) 	= 1 + eval t
    eval (IsZero i) 	= eval i == 0
    eval (If b e1 e2)	= if eval b then eval e1 else eval e2

This is implementation of the "wobbly types" we've discussed before in GHC, slated for release in version 6.4. Simon also give a pointer to Tim Sheard's site, as he's done a lot of related work. There I found an interesting looking paper on Omega, a language which takes the GADT idea even further.

newLisp: A better Lisp/Scheme Fusion...

I had been breathlessly watching Paul Graham's website hoping for news about Arc, his "New Lisp". But I hadn't realized that a group of developers had already beaten him to the punch!

newLisp is an updated (and scaled down) Lisp, targeted at the scripting world. From the web site:

newLISP is a general purpose scripting language for developing Web applications and programs in general and in the domain of Artificial Intelligence (AI) and statistics.

Among its many interesting features (such as useful functions for getting scripting work done, good performance, and small footprint) are:

  • Dynamic and lexical scoping with multiple name spaces
  • OOP extensions
  • TCP/IP and UDP networking functions
  • Perl compatible regular expressions, PCRE
  • Matrix and advanced math functions
  • Financial math functions
  • Statistical functions
  • XML functions and SXML support
  • Tcl/Tk Graphical Fontend
  • Modules for MYSQL, SQLite and ODBC Database access
  • CGI, SMTP, POP3 and FTP Modules
  • Complete documentation in HTML and PDF

While many new scripting languages languish with good implementations, but no fully-realized libraries or interaction with outside software, newLisp seems to have sprung fully-formed, with various useful libraries already implemented.

Newlisp compiles on most LINUX, UNIX versions, CYGWIN, Windows, and presumably Mac OS X. It is licensed under the GNU Public License, GPL

Who knows -- perhaps now Ehud will have a Lisp with which he can finally get some scripting work done!

Generics for the masses

Ralf Hinze. Generics for the masses. In Kathleen Fisher, editor, Proceedings of ICFP'04, Snowbird, Utah, September 19-22, 2004.

Mentioned (with no link) on LtU1.

Hinze shows how to program generically in Haskell 98, making extensive use of type classes.

Those interested in generic programming should make sure they are familiar with references cited in section 5 (many of which were discussed here in the past).

A Functional Quantum Programming Language

We introduce the language QML, a functional language for quantum computations on finite types. Its design is guided by its categorical semantics: QML programs are interpreted by morphisms in the category FQC of finite quantum computations realizable as quantum gates.

Warning - it's a draft. From the Types Forum.

Description Logics in Literate Haskell

Experiments from Graham Klyne:

This file is my attempt to better understand the structure and uses
of Description Logic (DL) languages for knowledge reresentation and inference, with the ultimate aim of better understanding the capabilities and limitations of the Semantic Web ontology language OWL, whose design draws much from Description Logic languages.

See also rdfweb-dev post, "Haskell vs. Ada vs. C++ vs. Awk vs. ..., An Experiment in Software Prototyping Productivity" (PS format)

Implementing Declarative Parallel Bottom-Avoiding Choice

Implementing Declarative Parallel Bottom-Avoiding Choice. Andre Rauber Du Bois, Robert Pointon, Hans-Wolfgang Loidl, Phil Trinder. Symposium on Computer Architecture and High Performance Computing (SBAC-PAD) 2002.

Non-deterministic choice supports efficient parallel speculation, but unrestricted non-determinism destroys the referential transparency of purely-declarative languages by removing unfoldability and it bears the danger of wasting resources on unncessary computations. While numerous choice mechanisms have been proposed that preserve unfoldability, and some concurrent implementations exist, we believe that no compiled parallel implementation has previously been constructed. This paper presents the design, smantics, implementation and use of a family of bottom-avoiding choice operators for Glasgow parallel Haskell. The subtle semantic properties of our choice operations are described, including a careful classification using an existing framework, together with a discussion of operational semantics issues and the pragmatics of distributed memory implementation.

amb breaks referential transparency (e.g., think about (\x.x+x)(3 amb 5) - how many choice points are there?)

This paper presents the problems, and shows how to implementat bottom-avoiding choice operators in Galsgow parallel Haskell (GPH).

The paper is worth checking out for the references alone, which can server as a useful guide to the subject of non-determinism in functional languages. Section 3 of the paper summarizes the semantic properties of the choice operators, and can be a good place to start reading if you are familiar with the subject.

Graham Hutton: Programming in Haskell

The first five chapters of Hutton's introductory Haskell book are online.

The chapters cover fairly basic features, and wouldn't be of interest to the Haskell experts among us, except as teaching material.

However, those intrigued by all the recent references to Haskell can get a taste of what Haskell is about from this readable introduction.

Scrap more boilerplate

Scrap more boilerplate. Ralf Laemmel and Simon Peyton Jones. ICFP'04.

We extend the "scrap your boilerplate" style of generic programming in Haskell to accomplish an additional range of applications. This includes several forms of serialisation and de-serialisation, test-set generation, type validation, and type erasure. To this end, we provide a well-designed reflection API for datatypes and constructors, and we also provide more general means of extending generic functions for given monomorphic or polymorphic types. The presented approach is readily supported in the GHC implementation of Haskell.

The previous "boilerplate" paper was discussed here in the past.

This is a interesting paper and there are many reasons why I should link to it, but I'll let you guess the number 1 reason (hint: check section 10).

Morrow & First-class Labels

First-class labels for extensible rows. (draft)
Daan Leijen.
Submitted to POPL'05. (PDF, BibTeX)

Abstract: This paper describes a type system for extensible records and variants with first-class labels; labels are polymorphic and can be passed as arguments. This increases the expressiveness of conventional record calculi significantly, and we show how we can encode intersection types, closed-world overloading, type case, label selective calculi, and first-class messages. We formally motivate the need for row equality predicates to express type constraints in the presence of polymorphic labels. This naturally leads to an orthogonal treatment of unrestricted row polymorphism that can be used to express first-class patterns. Based on the theory of qualified types, we present an effective type inference algorithm and efficient compilation method. The type inference algorithm, including the discussed extensions, is fully implemented in the experimental Morrow compiler.

Always trust Daan to come up with something both elegant and practical...! However the examples involving bottom (undefined) labels left me skeptical.

XML feed