Automatic type inference via partial evaluation

Automatic type inference via partial evaluation. Aaron Tomb, Cormac Flanagan. PPDP’05.

Type checking and type inference are fundamentally similar problems. However, the algorithms for performing the two operations, on the same type system, often differ significantly. The type checker is typically a straightforward encoding of the original type rules. For many systems, type inference is performed using a two-phase, constraint-based algorithm.We present an approach that, given the original type rules written as clauses in a logic programming language, automatically generates an efficient, two-phase, constraint-based type inference algorithm. Our approach works by partially evaluating the type checking rules with respect to the target program to yield a set of constraints suitable for input to an external constraint solver. This approach avoids the need to manually develop and verify a separate type inference algorithm, and is ideal for experimentation with and rapid prototyping of novel type systems.

Also somewhat relevant to the discussions here about type checking as abstract interpretation.

A Plan for Pugs

Anyway. So, I ordered a bunch of books online including TaPL and ATTaPL so I could learn more about mysterious things like Category Theory and Type Inference and Curry-Howard Correspondence.

A rather amusing interview about Pugs, the Perl 6 implementation written in Haskell.

Termite: a Lisp for Distributed Computing

(via Patrick)

In short: take Scheme, remove mutations, add isolated processes with mailboxes, add message sending and receiving operations and an addressing mechanism.

Termite is a Lisp for distributed computing (PDF paper and PDF presentation), providing an Erlang like model on top of Scheme.

As the presentation says, the powerful abstraction facilities provided by Scheme made impelementing Termite rather easy and the implementation doesn't require much code.

[Edit: here's a working link for the PDF paper]

General Purpose Cellular Automata Programming

In this thesis, a new cellular automata simulation environment, jTrend, is introduced. jTrend was developed on the Java platform for cellular automata exploratory research. With a built-in high-level programming language and an easy-to-use graphical user interface, jTrend has become one of the most powerful cellular automata simulators, and can be used for most one- and two-dimensional cellular automata simulations.

My queries about DSLs for cellular automata didn't get many responses, so perhaps this master thesis would be of interest.

The language design isn't very radical, and the language is quite easy to grasp. The integration between the language and the simulation environment is a bit unusal (e.g., the cells neighborhood isn't defined in the code).

SISCweb

SISCweb is a framework to facilitate writing stateful Scheme web applications in a J2EE environment.

SISCweb sports an interactive, REPL-based web application development style...

Through the use of continuations, SISCweb does away with the page-centric execution model typical of web applications. Every time a response is sent to the browser, the program execution flow is suspended, to be then resumed from that exact point when the browser submits a request.

Could it be that SISCweb was never mentioned here before? I found no previous discussions, so if you've got something to say about this project, now is your chance...

Static Typing Where Possible, Dynamic Typing When Needed

Instead of hammering on the differences between
dynamically and statically typed languages, we should
instead strive for a peaceful integration of static and dynamic
aspect in the same language. Static typing where possible, dynamic
typing when needed!

Static Typing Where Possible, Dynamic Typing When Needed pdf

Classic LISP books online

Two more classic Lisp books are now online at the Computer History Museum:

  • John McCarthy, Paul W. Abrahams, Daniel J. Edwards, Timothy P. Hart and Michael I. Levin. LISP 1.5 Programmer’s Manual. The M.I.T. Press, 1962, second edition. PDF
  • Berkeley and Bobrow, editors. The Programming Language LISP: Its Operation and Applications. Information International, Inc., March 1964 and The MIT Press, April 1966. PDF

ILC 2005 Slides and Audio

(via lemonodor)

Slides and audio from some of presentations at the International Lisp Conference are now available online.

Some presentations are of general interest, so take a look even if you aren't into Lisp...

ESL Design

Languages, architectures, and algorithms describes how many of the current DSP designs are done in Matlab and then have to be hand-coded in C type languages. Perhaps it's wishful thinking, but the hope is to have a direct mapping between the higher level design and the RTL.

the EDA industry as a whole is poised to leap to new levels of design abstraction. Commonly referred to as electronic system-level (ESL) design, this design method encompasses both the languages used to represent designs at a very high level of abstraction and the appropriate synthesis technology that can transform these representations into their implementation-level counterparts.
(Somewhat reminiscent of the UML designers who'd like to bypass hand-coding in C++ and Java).

Parrot 0.2.2 Released

Parrot 0.2.2 has been released! Parrot is a versatile virtual machine for dynamic languages. Though originally designed for Perl 6, it's power and flexibility has generated a lot of interest in the language development community. Parrot is distributed with a number of sample compiler implementations at varying stages of completion, including partial compilers for common languages like lisp, scheme, tcl and python.

The latest release features grammar and rule support in PGE, the Parrot Grammar Engine. Parrot also comes with utilties that convert PIR (Parrot Intermediate Representation) and PASM (Parrot Assembly) into PBC (Parrot bytecode).

Those who are interested in learning how to implement languages for Parrot should start with the documentation. You may also be interested in my own (extremely feeble) attempt at implementing PIR generators in Haskell and Ocaml.