https://github.com/lpeterse/koka
A function-oriented language with effect inference
https://github.com/lpeterse/koka
Last synced: 12 months ago
JSON representation
A function-oriented language with effect inference
- Host: GitHub
- URL: https://github.com/lpeterse/koka
- Owner: lpeterse
- License: other
- Created: 2014-04-14T08:09:48.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-05-22T11:55:43.000Z (about 12 years ago)
- Last Synced: 2025-04-10T22:44:05.453Z (about 1 year ago)
- Language: Haskell
- Homepage:
- Size: 1.96 MB
- Stars: 19
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
Koka: a function-oriented language with effect inference
--------------------------------------------------------
To build Koka from source you need to install:
* The [Haskell platform](http://www.haskell.org/platform) (known to work with 2013.2.0.0 or later).
* libncurses5-dev (on Linux)
* node.js (optional)
After installing the above tools, go to the Koka directory and type:
> cabal update && cabal install
This will install Koka locally for the current user.
Starting out
------------
After running `koka`, 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
Lars Petersen
Development
-----------
For development we recommend:
* The excellent [SublimeText](http://www.sublimetext.com) text editor. There is a full Koka and Haskell
language mode for SublimeText (run `jake sublime` to install the Koka mode on your system).
To generate a browsable haddock documentation run:
cabal haddock --executable --hyperlink-source