Introduction

Which is the best programming language in the world? Scala, D or perhaps the good old C? How about the the best data description format? JSON or maybe XML?

The question is somewhat naive as to a degree the question is merely of a personal preference and - even further - of the specific needs. JavaScript and C are hardly comparable. The syntax, semantics and the end results must fit the specific purpose and we may accept that there is no single ideal language for the generic cause.

Still, the idea of 'universal' language is tempting. What if - there would be only one language - but to fit a diverse and dynamic problem domain the language would be diverse and dynamic itself?

Meet FreeForm

FreeForm is not a traditional programming or data description language, but more of a runtime and a framework, which allows you define languages inline and take them into use inline. Syntax can be defined and taken into use like any utility or library. Even further - with FreeForm - a multithreading library could ship with multithreading syntax, SQL library with SQL syntax and RPC library with RPC syntax. The vision is that a library can provide syntax most convenient for the domain as an addition to functionality needed by domain. Even further, the dream is for the language to adopt any shape, form or function, that fit best the task at hand.

While FreeForm is not mature enought to act as a full programming environment, it does provide the basic mechanism for defining languages and language extensions inline and for taking the syntax into use inline. While language is dynamic in its essense, it ships with a some utilities and a 'standard language' that can be used for defining and organizing new language and functionality packages. Standard language is extremely minimalistic consisting only of 5 different directives that are:

pkg - for structuring code in packages

exp - for defining new expressions

use - for taking packages and expressions into use

name - for naming or aliasing objects

<X> - for using expression X at the spot

FreeForm core ships with three different packages meant to form the very core of FreeForm runtime and framework. The basic language and functionality packages are:

ff.std - the standard language package

ff.exp - standard expression package

ff.func - standard functional language package

The CoreForm project extends FreeForm with some additional utility functionality and syntax:

ff.control - if-operation, bool type and basic comparison operations

ff.prim - utilities for ints, strings, lists, objects etc.

ff.sys - printing, loading and exiting

ff.math - basic math package with plus, minus etc.

ff.form - for converting objects to text.

ff.script - more user friendly functional language with if, ==, a+b, scopes etc. supported

The FreeForm demo package introduces examples, and also extendable and minimalistic Lisp dialect (lisp.lang). While the Lisp dialect allows defining functions and expressions, it doesn't support defining generic expressions that are possible with the standard language.

Status

Right now, FreeForm is more of an idea than a practical high performing tool. FreeForm is a toy and may remain as such, but it is a curious, powerful and interesting toy with an approach to languages - that I believe - has not been tried before.

Try FreeForm:

If you wish to contribute to the project, please contact the author at arau at iki dot fi.

About Author

Antti Rauhala works as a senior software designer / developer at Futurice. The specialities are systems engineering, information retrieval and machine learning.