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:

(def (swap lst a b)
    (def aval (get lst a))
    (def bval (get lst b))
    (set lst a bval)
    (set lst b aval))
(def (sort lst)
    (loop n (length lst)
        (loop m (length lst)
            (if (greater
                (get lst m)
                (get lst (+ m 1))))
                (swap lst m (+ m 1)))))))

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:

(def (swap lst a b)
    (def aval (get lst a))
    (def bval (get lst b))
    (set lst a bval)
    (set lst b aval))
(def (sort lst)
    (loop n (length lst)
        (loop m (length lst)
            (if (greater
                (get lst m)
                (get lst (+ m 1))))
                (swap lst m (+ m 1)))))))

11 months ago. 2 notes.