- Installing
- Hello World
- Spaces
- Identation
- Basics
- Comments
- Output
- ++ method
- Assignments and types
- Operator Precedence
- String interpolation
- Input
- Simple arithmetic
- Multiline strings
- Assert
- Arrays and literal arrays
- Literal intervals
- If, for, while and repeat-until
- Message sends
- Conversion between basic type values
- Anonymous functions
- Evaluating an anonymous function
- Functions with method foreach
- Prototypes
- Packages
- Gradual typing
- Generic prototypes
- Important metaobjects
- The CyanInterpreter prototype
Hello World in Cyan!
The starting point of all languages, a Hello World program can be achieved just by creating a prototype Program
with a method that prints the salutation.
package main object Program func run { “Hello world” println } end
The package main (as any package) is a collection of prototypes and interfaces that can be used in the source file that imports it. In every source file with extension .cyan, only one prototype or interface declaration should exist (Program
, in the example).