From d894dc1381a6e24e7fdd5c6d598665fb59a2c6d0 Mon Sep 17 00:00:00 2001 From: aelred Date: Fri, 17 Apr 2015 21:01:59 +0100 Subject: [PATCH] Create README.md --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7495e25 --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# starling + +A pure and lazy functional language. + +## Getting started ## + +To install, run: + + $ python setup.py install + +You can start the starling interpreter with the command: + + $ starling + +## Examples ## + +You can do basic arithmetic (but no operator precedence yet): + + >>> ((1 + 2) * 8) pow 2 + 576 + >>> (702 / 2) mod 8 + 7 + +Curried functions and list operations: + + >>> map (*2) (range 0 10) + [0, 2, 4, 6, 8, 10, 12, 14, 16, 18] + >>> sort [3, 1, 10] + [1, 3, 10] + +Infinite lists, nested scopes and functions/lambdas: + + >>> let is_odd = (x -> (x mod 2) != 0) in take 5 >> (filter is_odd) nats + [1, 3, 5, 7, 9] + +Concise, JSON-esque object definitions: + + >>> shopping_list = [{name="eggs", price=2}, {name="milk", price=3}] + >>> eggs = shopping_list@0 + >>> eggs.price + 2 + >>> eggs.name + eggs + >>> map (.name) shopping_list + ["eggs", "milk"] + +Importing modules: + + >>> re = import regex + >>> re.match "(mur)+" "murmurmurmur" + {match=True, rem=[], str="murmurmurmur"} + +## What's next? ## + + - Compilation to LLVM + - Bootstrapping the compiler in Starling itself + - Introduce type inference + - Operator precedence + - Support for I/O and impure behaviour