Skip to content
Myrddin Compiler
C JavaScript Shell Assembly Yacc Roff Other
Branch: master
Clone or download

Latest commit

oridb add OSX recvfrom, fix UDP announce (thanks Int21h)
system call to libsys for OS X and also made a minor
edit to announcesock so it would work with UDP.
Latest commit 5528238 May 12, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
6
bench fixed macos build, "improved" vim syntax highlighting (improved mode … Jan 13, 2020
doc
examples
lib
mbld
mi
mk
muse
parse
rt
support
test
util
.gitattributes Fix handling '\r\n' with libbio. Oct 4, 2015
.gitignore
LICENSE
Makefile
README.md
bld.proj
bld.tags
configure
genbootstrap.sh
mbldwrap.sh
mkfile
rebootstrap.sh

README.md

Myrddin

Myrddin Website and Documentation

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

If you are building from development then issue make bootstrap after the call to ./configure.

  • ./configure
  • 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

Try It Online

The online playground is a good place to get started with little setup.

Online Playground Environment

API Documentation

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

API Reference

Mailing List

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

Mailing List Archives

Subscribe Here

Supported Platforms

Myrddin currently runs on a number of platforms

  • FreeBSD
  • Linux
  • NetBSD
  • OSX
  • OpenBSD
  • Plan9front
You can’t perform that action at this time.