Jump to content

Qalb (programming language)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 50.252.6.105 (talk) at 21:34, 12 April 2023 (Fixed the explanation of Qalb being a recursive acronym so it's more understandable/accurate.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

قلب
ParadigmFunctional
Designed byRamsey Nasser
First appeared2012
Websiteqlb-repl.herokuapp.com
Influenced by
Scheme

قلب (Levantine Arabic: [ʔalb]), transliterated Qalb, Qlb and Alb, is a functional programming language allowing a programmer to write programs completely in Arabic.[1] Its name means heart and is a recursive acronym in Arabic meaning Qalb: A Language for Programming (قلب: لغة برمجة, Qlb: Lughat Barmajah). It was developed in 2012 by Ramsey Nasser, a computer scientist at the Eyebeam Art + Technology Center in New York City, as both an artistic endeavor and as a response to the Anglophone bias in the vast majority of programming languages, which express their fundamental concepts using English words.

The syntax is like that of Lisp or Scheme, consisting of parenthesized lists. All keywords are appropriate Arabic terms, and program text is laid out right-to-left, like all Arabic text. Specifically, the Arabic used is Lebanese Arabic, as is evident by the use of قول instead of the Modern Standard Arabic قل.[2] The language provides a minimal set of primitives for defining functions, conditionals, looping, list manipulation, and basic arithmetic expressions. It is Turing-complete, and the Fibonacci sequence and Conway's Game of Life have been implemented.

Because all program text is written in Arabic, and the connecting strokes between characters in the Arabic script can be extended to any length, it is possible to align the source code in artistic patterns, in the tradition of Arabic calligraphy.

A JavaScript-based interpreter is currently hosted on herokuapp and the project can be forked on GitHub.[3]

Hello world

(قول "مرحبا يا عالم"‏)
(قول "Hello, world‎")

References

  1. ^ "Meet قلب, the programming language that uses Arabic script". Retrieved 2013-02-06.
  2. ^ Nasser, Ramsey. "an Arabic typo · Issue #8 · nasser/--- · GitHub". The current version is in Lebanese Arabic by design, future versions will be in Standard and قول will be changed to قل.
  3. ^ قلب: لغة برمجة on GitHub

Further reading