Localized Programming Language
Citrine Programming Language
Citrine is a flexible, general purpose, localized scripting language, designed
to allow people to write code in their mother tongue.
Hopefully, by doing so, we can get more readable and maintainable code,
lower barriers to programming, reach new audiences and democratize software.
Citrine can be used as a stand-alone programming language, an embedded scripting language, DSL
or as a transpiler.
Learn Citrine in a minute.
Latest News
French homepage! (thanks Mario Périard)
Translation Kit Update
Citrine 0.9.5 Sorghvliet released!
More »
☞ greeting ≔ ‘Hello country!’. greeting country: ‘Great Britain’. ✎ write: greeting.
☞ groet ≔ “Hallo land!”. groet land: “Nederland”. ✎ schrijf: groet.
☞ salut ≔ ‘Bună țară!’. salut țară: ‘România’. ✎ scrie: salut.
☞ sveikinimas ≔ ‘Sveika šalis!’. sveikinimo šalis: ‘Lietuva’. ✎ atspausdinti: sveikinimas.
☞ приветствовать ≔ «Здравствуй, страна!». приветствовать страна: «Россия». ✎ написать: приветствовать.
Features
Localized
Allows everyone to code in their native language. Making code more accessible and expressive.
Pure Objects
True, Smalltalkish, Object Oriented Programming: the way it was meant to be.
Simple Grammar
Very simple, minimalistic grammar. Easy to learn and remember.
Prototypes
Flexible prototypal inheritance, just like JavaScript but without the quirkiness.
Dynamic Scope
Extremely powerful dynamic scoping, just like good old BASIC and some LISPs.
Translate
International teams? Automatically Translate code from one language into another.
Manual
Citrine is very easy to learn, you create a program by
sending messages to objects. There are 3 types of messages:
unary (no arguments), binary (one argument) and
keyword messages (one or more arguments),
here's how:
☞ x ≔ ‘Hello’ length. ☞ x ≔ 3 + 7. ☞ x ≔ Number between: 0 and: 10.
We use ☞ to declare a new variable. In the second example we send a message +7 to 3, the resulting object will be 10. There is no need for if, while or for statements, to execute code conditionally send true: to a boolean, to run code in a loop, multiply the task by sending ×:
(x ≥ y) true: { ✎ write: ‘buy!’. }. { :i ✎ write: i. } × 3. { x add: 1. } while: { ↲ x < 9. }.
You can write Citrine in your native language, so, for instance, in Dutch, the third example looks like this:
{ x optellen: 1. } zolang: { ↲ x < 9. }.
There is no special syntax needed for string interpolation, just send a non-defined message to a string to replace the word specified by the message with the argument:
‘Hola señor!’ señor: ‘Don Quijote’.
To create your own object, send new to the main Object, you can also use other objects as a prototype. You can add new logic to all objects with on:do:, even existing ones. There are no classes.
☞ y ≔ Number new. y on: ‘double’ do: { ↲ ⛏ × 2. }.
Note that ⛏ refers to the object itself. To store a value as an object property use: ⚿, properties are only accessible from within the object itself and its derivatives.
cat on: ‘name:’ do: { :me ⚿ name ≔ me. }.
Apart from a few details, that's basically all there is to
it! Now you know Citrine!
For more examples, open the learn-by-example manual, which is available
for all languages supported by Citrine!
* Translated manual available
EXAMPLES (ALL LANGUAGES)
Citrine is a localized scripting language.
For some languages, we have to rely on machine translations
because we haven't found translators yet.
We appreciate any help!
All natural languages are welcome**, even if they are not very common (EGIDS-status 6).
** Artificial languages, fantasy languages, private languages and other
non-natural languages will not be included but you are free to fork the project of course.
Improve Translations
Products
Citrine is open source (licensed BSD) and the source
code is available for free.
DOWNLOAD CITRINE (FREE)
GET SOURCE CODE (FREE)
TRY ONLINE DEMO (FREE)
Download CitriNET Server Demo, a free DEMO and
proof of concept demonstrating how to use the
Citrine Programming Language as an embedded scripting language
within your SAAS-product or enterprise web application.
If you don't like to compile the source yourself
(and there is no binary available for your platform yet), I can
create a binary for your platform and language of choice for
a small fee (Citrine contributors and translators get it for free, of course).
ORDER CUSTOM BUILD
Do you want development support for Citrine? Do you want to
integrate the Citrine Programming Language into your cloud service,
online platform or business application?
ENTERPRISE SUPPORT
The Citrine Project is actively looking for investors. Citrine technology can help your SAAS/FAAS-platform (ERP,CRM, Asset management etc...) to facilitate power users with a localized scripting language or reach new audiences by providing ordinary users with an extremely powerful scripting tool in their native language. Allow your users to break free from the limited capabilities of graphical user interfaces.
Free Extra Tools & Language Supplements
Download extra software, tools and language supplements for
the Citrine Programming Language.
FAQ
Why Citrine?
Citrine is simple, minimalist, localized programming language following the Kayan philosophy1, for developers who prefer to write code in their native language without having English keywords in the mix. Citrine has been engineered specifically to play well with any natural human language. Citrine features a very limited yet flexible (and language agnostic) grammar and lacks unnecessary complex concepts like classes, string interpolation syntax and data-types (everything is an object), making it easy to learn and remember. Citrine also features localized numbers, dates and punctuation. Localization can be seen as the final step in producing a more readable and maintainable programming language. Coding and studying in your own language has been proven to have a positive impact on learning outcomes2 and quality3,4. Citrine can also translate code. Citrine is referenced in relevant scientific literature5. 1. After the Philosophy of American Computer Scientist Dr. Alan Kay (regarded as inventor of Object Oriented Programming) 2. Learning to Code in Localized Programming Languages (MIT) 3. Effects of localization on Exceptions in Java 4. Engelstaligonderwijs slecht voor studie (PDF) 5. Scientific Paper India (PDF)
What is the purpose of Citrine?
The Citrine Project aims to create (in order of importance) an extremely simple, minimalist, pure object oriented, localized programming language to improve the maintainability of code and lower barriers. Please consider these fundamental principles if you consider to contribute code.
Why is this page in English?
As a developer, you have to know some English. Nobody is going to change that anytime soon. Writing complex logic in a foreign language is something different though. Citrine allows you to put your thoughts into the words of the language you know best: your mother tongue. That being said, if you want to translate a manual page, feel free to help!
Who are the users?
Citrine can be used as a general purpose programming language by developers who wish to improve maintainability and readability by writing minimalist, pure object code in their native language. Citrine also allows you to discuss and explain critical business logic with your customers, thus allowing them to verify its correctness. Also, Citrine can be embedded into serverless cloud or FAAS* platforms as a localized scripting language. Another option is to embed Citrine as localized DSL** for power users in a SAAS-solution***, to lower adoption barriers and reach new audiences. Furthermore, Citrine can be used to teach programming in a language agnostic way at schools and universities. Finally, Citrine is a research project to analyse the impact of localization on programming. *FAAS: Function as a Service **DSL: Domain specific language ***SAAS: Software as a service
Can I contribute?
Sure, Citrine is open source (Licensed BSD1,2) and we can share code using e-mail or Github or other systems. See the plug-in wishlist for a start! Citrine is written in C. The Citrine Project is apolitical. 1. BSD License explained 2. Citrine Programming Language License on website
Other questions?
Consult the Extended Technical FAQ >.
Why icons in the language?
Abstract, yet frequently used concepts are represented as icons in Citrine. For example, to declare a new variable in a Citrine program you use a pointing finger (☞). The inspiration for this approach comes from Smalltalk-701. Apart from pictograms, Citrine also allows the use of thin space to separate words in object names and message parts to avoid CaMelCase and snake_case. You can use the icons in your code by installing the Citrine font (Citrine.ttf, part of the download package) and using the unicode codes (Linux: CTRL + SHIFT + u), the Berlian IDE or a Geany Macro package, see Extended Techical FAQ. 1. Smalltalk-72 Manual
What type of scoping does Citrine use?
Citrine uses dynamic scoping, for instance, the following example prints '2':
☞ f ≔ { q ≔ 2. }. {☞ q ≔ 1. f run. ✎ write: q.} run.
Can I use inheritance?
Yes. Assuming we have a Cat object that can print its name, here, we override the behaviour for message 'name' with a new response. The ⛏ symbol 'plays' back another response from the same object. Sending the same message invokes the overridden behaviour. If you really want recursion (i.e. invoke the code you're currently running) prefix your message with the word 'recursive'.
RoyalCat ≔ Cat new. RoyalCat on: 'name' do: { ↲ ‘your royal highness ’ + ( ⛏ name ). }. ✎ write: ((RoyalCat new name: ‘Diva’) name).
What happens if a message is not understood?
If an object does not understand a message, the message will be ignored (Null Pattern). You can intercept those messages though, similar to PHP's magic methods:
echo ≔ Object new. echo on: ‘respond:’ do: { :s ↲ s + s }. echo ho!.
About us
Gabor de Mooij
Core language design & Linux/BSD implementations.
Software developer from the Netherlands.
Aavesh Jilani
Hindi & Marathi translations (Citrine/HI and Citrine/MR).
Windows, iOS, Android/ARM platform support.
Software developer from India.
The creator of Dragon (programming language)
and Suasive (search engine).
Roman Litwinow
Russian Translations for Citrine/RU,
Russian Language Supplements,
Russian Citrine Website.
Software developer & Language Consultant from Russia.
Special thanks to:
Marek Majkowski (SipHash; Licensed MIT),
Stephen C. Losen (CCGILib; Licensed LGPL),
Dave Gandy (Font Awesome; Licensed SIL OFL 1.1),
JadedCtrl (Haiku Support),
John Calistro (Brazil-Portugese Support),
Tirifto (Czech Support),
Jan Wicijowski (Polish Support),
Twiggler (Windows Support),
Jake Russo (Plugins, CURL Lib Support),
DennisCGc (Bug fixes & improvements),
Takano32 (Various),
Leonora Tindall (Bug fixes & improvements),
Janus (Bug fixes & improvements),
Shinriyo (MacOSX Support),
Sean Eshbaugh (MacOSX Binaries),
Georgel Preput (Romanian Support),
Lina Dapkute (Lithuanian Support),
Mario Périard (French language support, regional homepage),
& Marianne (Editor, Language Consultant).
contact: gabordemooij at gaborsoftware dot nl