Skip to content
/ kesh Public

A simple little programming language that could one day compile to JavaScript.

License

Notifications You must be signed in to change notification settings

kesh-lang/kesh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kesh { }

 

heyiya-if symbol

 

A long, long time from now, in the wake of what will no longer be called JavaScript, might be going to have existed a programming language called kesh.

kesh is a simple high-level programming language. Its syntax is a superset of na.

kesh 2021

-- prototype
#person: [                                        -- type definition
    name: #text                                   -- type annotation
    age: #number
    speak(): "Hi, I'm { this.name }."             -- literal method (type inference)
]

-- instance
joe: #person [                                    -- new collection that delegates to #person
    name: 'Joe'
    age: 27
]

-- function
greet: ([name, age]: #person) -> {                -- typed function (argument unpacking)
    name: name if age > 12 else 'kid'             -- block-scoped declaration (param masking)
    "Hey, { name }!"                              -- the last evaluated expression is returned
}

joe.speak()                                       --> "Hi, I'm Joe."

greet joe                                         --> "Hey, Joe!"

Nothing is written in stone. Feedback and contributions are always welcome!

heyiya-if symbol is CC0. Original by Margaret Chodos-Irvine for Ursula Le Guin's novel about the Kesh, Always Coming Home.