diff options
author | andrewc <andrew_chambers@trimble.com> | 2015-12-22 11:10:38 +1300 |
---|---|---|
committer | andrewc <andrew_chambers@trimble.com> | 2015-12-22 13:36:51 +1300 |
commit | a8fcda1610863621f9df784a7eae8e72820e8d1f (patch) | |
tree | dc4a3a65ea4aef9df3b9766c5c14d70d6feaf9b2 /README.md | |
parent | 8f0dfdfa0968d20b6210f28cbb42b8f647dc0770 (diff) | |
download | mc-a8fcda1610863621f9df784a7eae8e72820e8d1f.tar.gz |
update readme
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 95 |
1 files changed, 60 insertions, 35 deletions
@@ -1,41 +1,79 @@ -A Toy With Delusions of Usefulness ----------------------------------- - - use std - const main = { - var i - for i = 0; i < 100; i++ - std.put("You're still reading?!?\n") - ;; - } - -Myrddin is a language that I put together for fun, but which has slowly become -a handly little language, and has attracted a number of contributors. The libraries -are written from the ground up, with zero external dependencies -- not even libc. +Myrddin +------- + +Myrddin is a systems language that is both powerful and fun to use. +It aims for C like low level control, a lightweight high quality implementation, +and features you may find familiar from languages like like rust and ocaml. + +This combination makes Myrddin suitable for anything ranging from desktop +applications, to embedded systems and potentially even kernel development. + +Examples +-------- + +A classic: +``` +use std + +const main = { + + for var i = 0; i < 1000; i++ + /* pattern match on a tuple */ + match (i % 3, i % 5) + | (0, 0): std.put("fizzbuzz\n") + | (0, _): std.put("fizz\n") + | (_, 0): std.put("buzz\n") + | _: + ;; + ;; +} +``` +How about regex, destructuring and algebraic data types? +``` +use regex +use std + +const main = { + var re, str + + str = "match against this!" + match regex.compile(".*") + | `std.Ok r: re = r + | `std.Fail m: std.fatal("couldn't compile regex: {}\n", m) + ;; + match regex.exec(re, str) + | `std.Some _: std.put("regex matched\n") + | `std.None: std.fatal("regex did not match\n") + ;; + regex.free(re) +} +``` + +More examples and a complete feature list can be found on the website. + +Status +------  -Introduction -------------- -If you want to read more about what Myrddin is or does, there's a website up. +Website +------- [Myrddin Homepage](http://eigenstate.org/myrddin/) Try It Online ------------- -Since installing a new language is a chore, there is a sandbox with code you can mess -around with. This is a very restrictive environment, but it's enough to get an idea -of what the language feels like. +The online playground is a good place to get started with little setup. [Online Playground Environment](http://eigenstate.org/myrddin/playground/) API Documentation ------------- -Myrddin ships with a reasonably useful standard library, which covers many common uses. As -stated before, This library is implemented from scratch. +Myrddin ships with standard library which covers many common uses. It is becoming +more useful every day. [API Reference](http://eigenstate.org/myrddin/doc/) @@ -58,16 +96,3 @@ Myrddin currently runs on a number of platforms - FreeBSD - 9front -Major Features --------------- - -- Type inference. Types are inferred across the whole program. -- Algebraic data types. -- And their friend, pattern matching. -- Generics and traits -- A package system. -- Low level control. -- (Almost) no runtime library. -- Entirely self contained. -- Simple and easy to understand implementation. - |