The Cyan Programming Language

A prototype example

package program 

private object Box
    private Int n = 0 
    fun get -> Int { 
        ^ self.n 
    fun set: Int n { 
        self.n = n 

object Program 
    public fun run {
        var s = Box clone; 
        var Int a; 
        a = In readInt; 
        s set: a; 
        Out writeln: (s get); 

Java-like Interfaces

interface Printable 
    fun print 

object Manager extends Person 
       implements Printable 
        // what he/she does 
    public var String profession 
    public fun print {

Hello World

package main

object Program
    public fun run {
        Out println: "Hello World"

Creating new objects

var Person person; 
    // the same as "person = new Person()" in Java 
person = Person new; 
    // cloning the Person object 
person = Person clone;
person = Person();