Gisp

A Graphic oriented Lisp-like interpreter to generate SVG and PNG images, written in C.

2021-02-24

My journey to find the perfect setup for digital generative art is pretty long, but now it may have come to an end with Gisp, the tool I made and I'm using at the moment. Gisp is a Lisp dialect I made 100% focused on giving the right tools to generate procedurally images.

The core program is written in C and it consists in a custom lisp interpreter that reads a .gisp code file and execute it.

For the core interpreter structure I used Lisp in less than 200 lines of Cas a great reference that explain everything you need to create your own little interpreter. It's very minimalist and not too advanced, but perfect to learn the major concepts and it gives me freedom to improve it by myself in any way I want.

The Idea

Gisp inherits most of the functions and syntax rules from Clojure, but is built for a much more specific and smaller scope.

It wants to be a simple and fast interpreter capable of parsing gisp file and generate SVG images through the Cairo library.

Gisp provides an extensive graphic library full of useful functions to create, manipulate, and draw basic points, lines, and shapes.

Future Steps

Right now the project is stable enough to generate images, but this doesn't mean that is prefect. It still lacks of:

  • Proper error checking system to be able to give you insights when something in your code is wrong.

  • A REPL to continuously evaluate code and interact live with it.

  • More advance graphics primitive.

  • Extended Gisp core library.

The Editor

The project also has a companion project called Gisp Editor which, as the name implies, is a tool to edit and run gisp code without having to manually run from the terminal. Ideally, I'd like to try make it in pure C too, but to simplify this process at the time being I made a first prototype with Electron since it gave me an already powerful base editor to extend and customize.

Gisp Documentation

This project has a documentation and API reference which is automatically generated using Docu, my custom docstring documentation generator, which you can find here > https://elkiwy.com/projects/docu/gisp_documentation.html <

External Links

- Lisp in less than 200 lines of C: https://carld.github.io/2017/06/20/lisp-in-less-than-200-lines-of-c.html
- Cairo Lib: https://www.cairographics.org
- Gisp Repository: https://github.com/elkiwy/gisp
- Gisp-Editor Repository: https://github.com/elkiwy/gisp-editor