This document describes the programming language Squl. Squl is a logic-based declarative programming language. It is quite similar to Prolog, but with a more verbose syntax.


Squl is a declarative programming language intended to be used for research into various AI techniques.

  • The Squl language is, hopefully, “expressively complete”. This means that the language can store and manipulate any concept a human can express.
  • A Squl interpreter should be able to accept any syntactically valid Squl statement without having issues with infinite loops. This allows for experimentation with randomly generated statements.
  • A Squl implementation is ideally implemented using persistence. Any generated data will survive a restart of the interpreter without requiring any exporting to files.

“Faish” is the implementation of the “Squl” language. “Faish”, the name, is inspired by an AI fish (available from the “execute” menu - it was an experiment with automatic code generation that is not yet completed). “Squl”, the name, was inspired from a “school of fish”. Better naming suggestions are welcome.

Faish is written using Smalltalk and currently is a slow, interpreted, single threaded, in-memory implementation of Squl. Future plans include making it fast, compiled, multi-threaded, distributed and persistent, but for now we have what we have.

“Squl” is not related to SQL.

Differences from Prolog

Squl derives many of its characteristics from the Prolog programming language. The syntax is quite different; Squl is more descriptive and lacks the conciseness of Prolog.

Whereas Prolog’s execution semantics are based on a depth-first search, Squl’s execution semantics are not defined explicitly, other than an informal approach of “trying not to be useless”. Prolog requires that the programmer understand the execution semantics and uses them to his/her advantage by introducing cuts and recursion into specific places of a statement, both to aid efficient execution and to avoid infinite recursion. In comparison, Squl does not have a cut operator, and a Squl implementation is free to investigate clauses in whatever order it finds useful. This comes with a (massive) performance penalty as dead ends are investigated, but allows much more flexibility with the implementation and a more pure approach to logic programming. Squl has been designed for experimentation rather than for speed.

Prolog implements negation by failure. This is also available in Squl, but is an optional extra should the programmer want to define negation in this way.

Prolog allows custom pre-fix, post-fix or infix operators to be defined. These are not available in Squl. Squl does, however, have custom literal definitions which can achieve some of the same functionality.

Prolog does input and output in an impure manner, by relying on execution semantics. Squl, instead, does input and output by inverting control. Rather than a module requesting input and output, the environment asks the module what it wants to input and output, and when it wants to do this. The module can include certain statements which inform the execution environment to enable various input and output devices.

Table Of Contents

Previous topic

Welcome to Squl’s documentation!

Next topic

Faish Tutorial

This Page