Skip to content
/ obi Public

Obi is a programming language inspired by koka and lua.

Notifications You must be signed in to change notification settings

mtso/obi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎗 Obi

Obi is an experimental programming language.

Some of the things it currently implements:

  • trailing lambdas
  • match expressions for control flow
  • classes and dynamic property access

Install

curl -fsSL https://raw.githubusercontent.com/mtso/obi/main/install.sh | sh

Usage

obi [path to obi file]

A Taste of Obi

fun Markup() {
    _buf := "";
    return [
        head = fun(children) {
            _buf = _buf + "<head>";
            children();
            _buf = _buf + "</head>";
        },
        body = fun(children) {
            _buf = _buf + "<body>";
            children();
            _buf = _buf + "</body>";
        },
        text = fun(string) {
            _buf = _buf + "<text>" + string + "</text>";
        },
        render = fun() {
            return _buf;
        },
    ];
}

m := Markup();
head := m.head;
body := m.body;
text := m.text;

head() {
    body() {
        text("hi");
        text("bye");
    };
};

print(m.render());
// expect: "<head><body><text>hi</text><text>bye</text></body></head>"

See the tests/ folder for more examples.

About

Obi is a programming language inspired by koka and lua.

Resources

Stars

Watchers

Forks

Packages

No packages published