Ѧ simple laחguagέ
ഽor ƩveЯyone

Citrine is a universal programming language that can be written in and translated to any human language.

☞ f := Reeks ← 0 ; 1.

   ☞ a := f laatste.
   ☞ b := f een-na-laatste.   
   ☞ som := a + b.
   ✎ schrijf: som.

   f toevoegen: som.

} * 12.
Download Citrine 0.8.0 download citrine

How to translate?

To translate a Citrine program from one language into another:

ctr -t en2nl.dict myprogram.ctr

Dictionaries have the following format:


Use t for tokens and s for strings.
To generate a dictionary from 2 versions of Citrine in different languages:

ctr -g /nl/dictionary.h /en/dictionary.h

In Citrine, everything is an object. You write a program by making these objects talk to each other, by sending messages.

The basics

There are 5 literal objects: Nil, Booleans (True,False), Numbers (i.e. 1,2,3.5,100 and so on), Strings (any text between 'single quotes') and code Blocks: { :parameter1 :parameter2 ...code... }. Every line ends with a dot (.). Assign a value to variable using :=.

☞ x := 3.6 round.
☞ x := 3.6 round even?.

Here we send the message 'round' to 3.6, the resulting value (4) gets assigned to x (we use the hand for that). On the second line we chain two messages (round and even?), resulting in x = True. A keyword message is a message with arguments. The following code snippet shows how to draw a random number between 1 and 10 by sending the message between:and: to Number.

☞ x := Number between: 1 and: 10.

A message that is just one single symbol (+-/*) is a binary message and always has exactly one argument; the object that follows.

☞ x := 2 + 3.

You can chain keyword messages using a comma (,):

✎ write: 'hello ', write: 'world'.
hello world

Control Flow

To execute block of code several times multiply the block:

{ :i
  (i = 3) break.
  ✎ write: i.
} * 5.

This will run the block of code 5 times. However, because of the break message it will stop during the third iteration.

You can create conditional code blocks like this:

(⛁ ≥ price) true: {
	✎ write: 'Buy'.
}, else: {
	✎ write: 'Too expensive'.

You can catch errors by attaching a catch block to your code:

{  2 / 0. } catch:
{ :error ✎ write: error. }, run.
Division by zero.

You can give a block of code a name:

☞ echo := { :x ↲ (x + x). }.
✎ write: (echo apply: 'hi').

Citrine uses dynamic scoping, for instance, the following example prints '2':

☞ f := { q := 2. }.
{ ☞ q := 1. f run. ✎ write: q. } run.


To create your own object and make it respond to messages:

Cat := Object new.
Cat on: 'name:' do: { :n ⚿ name := n. }.
Cat on: 'name' do: { ↲ ⚿ name. }. 

This creates a cat object that responds to 'name:' to change its name and 'name' to tell its name. The object stores its name in a property 'name'. To access a property, use :

cat := Cat new.
cat name: 'Diva'.
✎ write: cat name.

If you want to reuse old code, base your object on a previously crafted one (this is called prototypal inheritance):

RoyalCat := Cat new.
RoyalCat on: 'name' do: { :n
	↲ 'your royal highness ' + ( ⛏ `name ).

Here, we override the behaviour for message 'name' with a new response. The symbol 'plays' back another response from the same object. To reference an overridden one, prefix the message with a backtick (`).

✎ write: ((RoyalCat new name: 'Diva') name).
your royal highness Diva

You can make objects respond to arbitrary messages (generic responses) as well:

echo := Object new.
echo on: 'respond:' do: { :s ↲ 2 × :s }.
echo ho!.


Can I change built-in object?

You can modify existing objects (malleable objects), for instance, to make numbers respond to × :

Number on: '×' do: { :b ⛏ times: b. }.
7 × { :i ✎ write: i. }.

Why does Citrine use icons in the language?

Citrine simply makes use of the possibilities of UTF-8. Icons are more descriptive than abbreviations like 'var', they are quicker to type (once you configured your editor), language agnostic (can be used in Dutch source code as well) and allow more natural looking texts (in case of the thin space vs camelCase).

What's up with the languages?

Citrine can be compiled in different languages. This means the core messages can be English, Dutch, French or Icelandic. This allows Citrine to be used by a wider audience (i.e. schools). At time of writing, only English and Dutch versions are available. If you like to translate Citrine into your language, please contact me! While some language distributions are available on the download page, this site does not cover all different language versions (that would be too much work). The idea is that a Citrine ambassador will create and maintain a separate website for a language-specific distribution of Citrine.

Where can I find translation tables?

Here are the translation tables:

- Translation CSV English-Dutch (out-of-date, new version available soon!)

Can I fork Citrine?

Yes, find us on Github. Feel free to fork the source code on Github.

Can I use Citrine to teach programming?

Yes, because Citrine can be compiled in your native language. Citrine takes away language barriers and makes software development accessible to a wider audience. Citrine can also be tailored to suit the needs of a specific course and audience. Contact me for details!

Why has Citrine no built-in functionality X?

Citrine is a minimalist language. The Citrine project focuses on producing a better language. You can add new functionality by using a plugin. Plugins are automatically loaded as soon as you start talking to the object. Put your plugins here:


In line with the UNIX philosophy you can also invoke other programs to perform certain tasks using the shell:

✎ write: (Program  shell: 'ls -la').

This will print the contents of the current working directory on the screen.

How can I use a variable in a string?

Send an arbitrary message to a string:

✎ write: ('the answer is: this' this: 42).
the answer is 42

How can I use the icons in the examples?

Install 'Citrine.ttf' and configure your editor (I use Geany and Geany Macros, a macro package for Geany is included ):

cp ~/.config/geany/plugins/Geany_Macros/settings.conf ~/.config/geany/plugins/Geany_Macros/settings_backup.conf

cp macros.ini ~/.config/geany/plugins/Geany_Macros/settings.conf

icon code keys
2009ALT; (thin space)

Can I use Citrine to write webapps?

Yes, Citrine ships with a CCGILIB-based HTTP plugin (mods/request/libctrrequest.so) that allows you to deal with GET and POST requests. you can use the Request object like this:

get  := Request get: 'search'.
list := Request getArray: 'orders[]'.
post := Request post: 'message'.
list := Request postArray: 'orders[]'.
file := Request file: 'avatar'.

Storm Server is a CCGILib based SCGI server for Citrine for hi-traffic web applications, to start an instance of Storm we put the following code in storm.ctr:

host: 'localhost' 
listen: 4000
pid:'/var/run/storm.pid' callback: {
	✎ write: 'Content-type: text/html\n\n'.
	☞ fname := Command env: 'DOCUMENT_URI'.
	☞ script := File new: '/var/www/htdocs' + fname.
	script include.


Can I serve Citrine applications with NGINX?

Sure, add the following configuration lines to: /etc/nginx/nginx.conf:

location ~ \.ctr$ {
        try_files $uri $uri/ =404;
        include   scgi_params;


What platforms are supported? How do I distribute Citrine?

Citrine runs on 64-bit X86 Linux and 64-bit X86 OpenBSD. There is a 64 bit X86 Windows port available as well. Community versions for FreeBSD and macOS are available as well (but I don't know where, please contact the community members).
If you want to use Citrine as your main programming language for a certain project, I recommend using one of the versions available on the download page. If you want to teach programming using the Citrine programming language, I recommend providing your students with a Virtual Machine.

What makes Citrine interesting?

If Citrine respects all languages, why is this website in English?

As a developer, entrepeneur or scientist, you need to be able to read English texts. Citrine does not try to change that. However writing complex programs in a foreign language is a different story. The Citrine project aims to reduce the number of mistakes in software by allowing everyone the language they know best. The manuals will still be mainly in English although translations in other languages may appear in the future or maybe summaries. The Citrine project also encourages ambassadors to host language specific implementations of Citrine along with translated manuals.

Is Citrine meant for non-programmers?

This is a common misunderstanding. Citrine is not meant for non-programmers. Citrine is and always will be a real general purpose programming language. However even for professionals programming in your native language reduces the number of mistakes. Citrine does try to make code as readable and maintainable as possible and helps to lower the barriers to programming for students and schools. However, Citrine is not an educational tool or a game to learn programming. In the end, Citrine is a full fledged, powerful programming language that can be used for business purposes.

What is the roadmap for Citrine?

For some reason, Citrine feels a bit.. weird.

New things always are a bit weird and quirky. This website helps to amplify that feeling hopefully ;)

Have another question?
Visit Citrine Programming Language Forum!
There you can talk to other Citrine community members, ask questions, discuss new features, issues, bug reports and so on.

gaborsoftware GaborSoftware offers various support contracts for the Citrine Programming Language. Benefits of a support contract include: priority status on github, a sponsor logo on the partner page and access to proprietary plugins (like GTK plugin) when available. With a Citrine Support Contract Light you also show your support for this project to the rest of the Citrine community. You can get a Citrine Support Contract Light for just € 39,- a year.

The Citrine Programming Language is a product of GaborSoftware © copyright 2018 all rights reserved. Citrine Programming Language created by Gabor de Mooij and the Citrine community. In-language (citrine.ttf) icons from the ionicons project (MIT licensed), FontAwesome (SIL OFL 1.1) by Dave Gandy - http://fontawesome.io and Typicons by S. Hutchings (SIL Open Font Licence).
Website and photography by Gabor de Mooij. 'Citrine in a box' icon created by Gabor de Mooij using multiple assets from the WikiMedia Commons Project.
Contact me:

Founder & Original Author: Gabor de Mooij
Windows version of Citrine: Twiggler
Foundation work Json & Curl plugins: MadcapJake
Special thanks to: DennisCGc, Takano32, LeoTindall, Janus, Shinriyo, Marianne.
Citrine Community

Citrine respects your privacy and does not use cookies. For details read the Citrine Privacy Statement.
17830 visits since 3 March 2018