language design

Thumbnail
An interactive قلب session showing the Fibonacci algorithm

قلب is a programming language exploring the role of human culture in coding. Code is written entirely in Arabic, highlighting cultural biases of computer science and challenging the assumptions we make about programming. It is implemented as a tree-walking language interpreter in JavsScript.

All modern programming tools are based on the ASCII character set, which encodes Latin Characters and was originally based on the English Language. As a result, programming has become tied to a single written culture. It carries with it a cultural bias that favors those who grew up reading and writing in that cultural. قلب explores and challenges that by presenting a language that deviates almost entirely from ASCII.

The Fibonacci Algorithm

Project Created: 
January 2013
 

Second prototype of قلب’s code calligraphy. This one says مرحبا يا عالم (hello world), which isn’t executable code, but code-related and fun anyway.

 

First prototype of قلب’s code calligraphy, done in square kufic with glass tiles. It says “لكل ن” (for each n) and matches the bottom-right part of the bubble sort calligraphy prototype on the language’s site.

In preparation for Eyebeam’s Open Studios later this week.

 

Mockup of قلب’s new Scheme inspired syntax. I’ve been trying to arrive at a syntax that translates better into calligraphy than the first mockup, and with the parentheses removed, this syntax is nothing but words and numbers.

The parentheses are needed for the code to run correctly, but there is a precedent in leaving off dots, vowel markings, and punctuation in calligraphy, sacrificing readability for elegance.

The Scheme-like syntax is also easier to write an interpreter for.

The code was typed into TextMate, so it is unhighlighted and left-aligned. The English equivalent would be:

 

http://languagecanvas.herokuapp.com/:

My Language Canvas is live!

It uses a lightweight syntax to specify its highlighting, local storage to save your work seamlessly, and of course its completely live. It still has a bunch of issues, but it works well enough that I’ve been using it every day.

Head over, check it out, let me know what you think of it. Code will be on GitHub soon.

 

I’m putting together this language design tool that lets you specify basic syntax highlighting for a fictional language as you develop it. It helps avoid staring at unhighlighted code during a language’s initial sketches. It is built on CodeMirror.

The top pane is where you sketch in your language. Write whatever you want there. The lower pane is where you specify the syntax highlighting as pattern, token pairs.

 
Syndicate content