To build Koka from source you need to install:
- The latest Haskell platform (version 7.4 or later).
- The latest NodeJS runtime (version 0.10 or later).
After installing the above tools, go to the Koka directory and type:
> npm install
which will install any prerequisites. Now build and run Koka by typing:
> jake
To see more build options, type:
> jake help
After running jake
, the Koka interpreter will start:
__ _
| | | |
| | __ ___ | | __ __ _
| |/ // _ | |/ // ` | welcome to the koka interpreter
| <| () | <| (| | version 0.5.0-dev (debug), Apr 8 2013
||_\/||_\,_| type :? for help
loading: std/core
Now you can test some expressions:
> println("hi koka")
hi koka
> :t "hi"
string
> :t println("hi")
console ()
Or load a demo:
> :l demo/collatz
compile: lib/demo/collatz.kk
check : demo/collatz
modules:
demo/collatz
> main()
Collatz(27) took 111 steps.
Or a browser based demo:
> :l demo/dom/starfield
loading: demo/dom/starfield
loading: sys/dom
loading: sys/dom/types
loading: sys/dom/document
loading: sys/dom/html/window
loading: sys/dom/html/htmlElement
loading: sys/dom/html/htmlCanvasElement
loading: sys/dom/html/canvasRenderingContext2d
loading: sys/dom/css/cssStyleDeclaration
loading: demo/dom/microsoftLogo
loading: sys/dom/html/htmlTableElement
loading: sys/dom/html/htmlTableRowElement
loading: sys/dom/html/htmlTableDataCellElement
modules:
demo/dom/starfield
> main()
And quit the interpreter:
> :q
Before the effect one believes in different causes than one does after the effect.
-- Friedrich Nietzsche
Have fun! Daan Leijen
For development we recommend:
-
The TortoisHg distribution for mercurial source control.
-
The excellent SublimeText text editor. There is a full Koka and Haskell language mode for SublimeText (run
jake sublime
to install the Koka mode on your system).