summaryrefslogtreecommitdiff
path: root/README.md
blob: 3b0ba9c8ef95e1a4ec71b79a4faf749bd937aa2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Myrddin
[Myrddin Website and Documentation](https://myrlang.org/)

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.

## Build

Compile with ./configure --prefix="/home/wherever/I/want" && make && make install
The result will be among other things, the binaries 6m and mbld

## Usage

Compile and execute:
`mbld -R test.myr` 

Compile into a binary:
`mbld -b binary test.myr`

## 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.Err 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
![Solid Engineering](https://myrlang.org/tacoma-narrows.jpg "Solid Engineering")


## Try It Online
The online playground is a good place to get started with little setup.

[Online Playground Environment](https://myrlang.org/playground)

## API Documentation
Myrddin ships with standard library which covers many common uses. It is becoming
more useful every day.

[API Reference](https://myrlang.org/doc/)

## Mailing List
Annoucements of major changes, questions, complaints. We also give relationship advice.

[Mailing List Archives](http://eigenstate.org/archive/myrddin-dev/)

[Subscribe Here](https://myrlang.org/list-subscribe)

## Supported Platforms
Myrddin currently runs on a number of platforms

- FreeBSD
- Linux
- NetBSD
- OSX
- OpenBSD
- Plan9front