Category Archives: Computer Science

CAL and Tapestry 5, Part 2: Algebraic Types and Forms

In my previous post I described how to use a CAL function as part of the implementation of a Java class.

This post looks at interfacing CAL to Tapestry 5 using the ‘Java Bean’ conventions of getter and setter methods for the fields in an object.

Tapestry 5 provides a BeanEditForm component which simplifies providing CRUD operations [...]

Simplifying Code

In the course of trying to adapt an ANTLR lexer to be used in an Intellij IDEA language plugin, I found that I’d written this:

token = lexer.nextToken(); if (token != null) { tokenStart = findCharPos(token.getLine(), token.getColumn());

if (token.getText() == null) { [...]

CAL and the Tapestry 5 Tutorial

The technique described in my previous post can be used to create Tapestry 5 pages which call CAL functions. Tapestry also uses Javassist to enhance pages, so adding CAL integration requires that Tapestry is reconfigured to apply the CAL transformations in addition to its own — I wasn’t able to find a way to transparently [...]

Javassist and Annotations for Interfacing Java to CAL

In order for CAL to interoperate with Java frameworks we need to provide a Java class which delegates method calls to CAL functions. The framework sees only the Java class, and is unaware of the delegation which is taking place.

How we do this depends on a number of factors:

How easy it is to hook into [...]

Quote of the day, Tyler Cowen on Google

“Everyone is smart and beautiful, and I didn’t want to leave.”

Interfacing CAL to Java Frameworks — Part 1

This article discusses the differences between CAL as a client of Java libraries and CAL modules as clients of Java frameworks.

CAL is a functional programming language which runs on the JVM. One of the advantages of a language which compiles to Java bytecode is that it is simple to call any of the many available [...]

I’ll miss you, SCO

Perhaps not many people will miss SCO, given their desperate intellectual property shenanigans, but I only remember the good times.

My second job out of university was at an investment bank, Dominguez Barry Samuel Montagu, as the co-developer of an equities options trading system. We had a brand new Compaq 80386, running at 16MHz. I don’t [...]

Escape from Zurg

This Lambda the Ultimate post links to a paper which compares writing a search algorithm in Prolog and Haskell, and notes that Haskell’s strong typing makes the task easier. While the paper mentions several embeddings of logic programming into functional languages it doesn’t mention Mercury.

I was able to easily create successor and goal predicates for [...]

A Generic ’solve’ Predicate

The examples of state space searching described previously have all been tailored to a particular problem — the algorithms have been general, but the implementation has included type signatures specific to the problem, e.g.:

:- type block —> a; b; c. :- type stack == list(block). :- type situation == list(stack). :- type solution == list(situation). :- pred solve(situation::in, solution::out) [...]

Breadth First Search

One disadvantage of the depth first search with iterative deepening is that it regenerates all the search paths from the start node every iteration. A true breadth first search, as described by Bratko on pages 250-252 doesn’t need to do that — it can start with a short search path (just the start node in [...]