Citrine (programming language): Difference between revisions

Content deleted Content added
top: false implication that Citrine did not support natural languages other than English, omitting the relevant fact that its form had been exclusively English-like and later was more flexible
Syntax: grammatical number; notation
 
(8 intermediate revisions by the same user not shown)
Line 22:
'''Citrine''' is a general-purpose [[programming language]] for [[Cross-platform|various operating systems]]. It focuses on readability and maintainability. Readability is achieved by syntactic and conceptual minimalism. The language is heavily inspired by [[Smalltalk]] and [[Self (programming language)|Self]] but has some very distinctive features. Like Smalltalk, Citrine treats everything as an object and focuses on sending messages to these objects. However, unlike Smalltalk, Citrine lacks the concept of a class. In this regard, Citrine is more like Self and [[JavaScript]] because it uses [[Prototype-based programming|prototypes]]. The combination of Smalltalk-like messages and prototypes is what makes Citrine unique.
 
Since version 0.7, Citrine has focused on using forms based on various natural languages instead of just English, toimproving helpusability peoplefor reduceusers theof numberother oflanguages, bugsthereby becausereducing ofprogramming confusioneffort and misunderstandingincidence dueof to language barriersbugs. As such, Citrine 0.7 and higherlater featureinclude a translatorfeature to translatetransform code between humannatural languages.
 
==Syntax==
Citrine has a very limited syntax and it's very closely related to Smalltalk. Everything in Citrine is an ''object'',. thereThere are 5 literals:
 
* {{code|Nil}}
Line 33:
* <code>{ ...params.. ...block of code... }</code>
 
The code block literal uses a ''pipe'' symbol ⟨|⟩ to separate the parameters from the logic '|'; if there are no
parameters, the backslash should be used instead.
 
Citrine only supports full-line comments, which start with a '#'.
 
A Citrine program is basically a sequence of messages sent to objects. For instance, to determine whether 5 is an even number, the message 'even?' is sent to the number 5.