Storm

Storm is a programming language platform with a strong focus on extensibility. Storm itself is mostly a framework for creating languages rather than a complete compiler. The framework is designed to make easy to implement languages that can be extended with new syntax and semantics. Of course, Storm comes bundled with a few languages (most importantly Basic Storm), but these are separate from the core and could be implemented as libraries in the future. Since these languages are implemented in Storm, they allow users to create their own syntax extensions as separate libraries. Furthermore, Storm allows languages to interact with each other freely and mostly seamlessly.

Aside from extensibility, Storm is implemented as an interactive compiler. This means that Storm is designed to be executed in the background while programs are being developed. As the compiler is running in the background, it is able to provide information about the program being developed to help the developer, much like an IDE. Currently, it is possible to run Storm as a language server that provides syntax highlighting for all supported languages and language extensions to an editor, such as Emacs. In the future, the language server should be able to provide more semantic information as well. More information on the language server can be found here.

The example below illustrates the capabilities of Storm:

use sql;

// Database declaration of a database for storing
// authors and their books.
DATABASE ExampleDB {
    TABLE authors(
        id INTEGER PRIMARY KEY,
        name TEXT
    );

    TABLE books(
        id INTEGER PRIMARY KEY,
        author INTEGER,
        title TEXT
    );
}

Str[] getBooksBy(ExampleDB db, Str authorName) {
    Str[] result;
    WITH db {
        // Query the database:
        var query = SELECT books.title FROM books
            JOIN authors ON authors.id == books.author
            WHERE authors.name == authorName;
        // Extract the result:
        for (row in query) {
            result.push(row.books.title);
        }
    }
    return result;
}

The example uses the SQL library, which provides a syntax extension to Basic Storm that allows treating SQL queries as expressions. Together with the database declaration at the top of the example, this allows the SQL library to type-check queries. The type information is also used to make it possible to extract the results in a convenient and type-safe way. Furthermore, since the extension knows which parameters originate from variables in the code, it is able to automatically use prepared statements to avoid problems with SQL injection.

Getting Started

If you are interested in Storm and want to learn more, the getting started page is a good place to start. Apart from the getting started section, this page also contains the manual for Storm among other things.

Contact

If you have any questions or requests regarding Storm, please contact me at [email protected].