Citrine Programming Language

Citrine is a very simple, localized general purpose programming language. With Citrine you can easily create applications and games. Citrine can be used in English but you can also use your own native language if you like.

Download Citrine Support me on Patreon


 

How does it work?

1. Sentences:
Citrine reads programs from top to bottom, from the beginning of a sentence to the end. Each sentence ends with a period.

2. Variables:
This is how you declare a variable in Citrine:

>> abc := 123.

3. Messages:
You create a program by sending messages to objects (numbers, texts, booleans, sequences, etc.). The general notation is:

<object> <message>.

If the message has arguments, you mix them with the message as follows:

<object> <a>: <argument 1> <b>: <argument 2>

Here, a and b are both part of the same message. If a message consists of just a single character and there is also just one single argument (like with '+ 3') you may omit the colon.

4. Commas:
You can chain multiple messages together. If a message has arguments, you must add a comma (,) if you want to send a follow-up message.

5. Tasks:
You can group instructions by surrounding them with { and }. This creates a task. You can also send messages to tasks. For example you can send the message '* 3' to repeat a task 3 times.

{ :i ... } * 3.

At the beginning of the task you can add parameters (:i). With <- you return a response from a task. You can extend any object with new tasks by connecting them to a spefic message:

Number on: ['double'] do: {
    <- self * 2.
}.
Out write: 3 double, stop.


Explore Citrine in ALL LANGUAGES
That's the basics. The best way to get to know Citrine better is to explore it playfully. Discover for yourself what objects and messages exist... You can find all messages for all objects in the object explorer, in all available Citrine languages!

Object Explorer

 



Build Service
Finished building your own game or app? Good! If you become a member I can help you to export your own creation as a standalone executable to PC or as app to your phone or game console. Support for macos, iOS and web is also coming!


Export your own creation to Android, iOS, Windows, Linux, macOS, Steamdeck, Nintendo, Playstation, Xbox, Web/HTML5 and more!

 


Become an Ambassador

Citrine currently supports around 110 human languages, with each language edition created through the efforts of volunteers or translation tools. I believe that every language edition should be treated as its own distinct project, complete with its own website. Since I don't speak all of these languages myself, I encourage you to take the initiative if you're interested in coding in your native language. Feel free to fork Citrine, adapt it to your language, and host it on your own local Citrine website.

Please note that your edition does not need to be compatible with the Dutch or English versions. Every language is unique, and Citrine should reflect that. You have full freedom to create a language edition that suits your needs. Of course, you can always start with one of the existing language editions as a foundation. Additionally, any improvements to the current dictionary files are always appreciated.

Credits & Special thanks

Donate XMR