Birb

About

Birb is a programming language. It is designed and implemented by Vivian Huang (vivianh) and Ariel Davis (azdavis). Its source code is available on GitHub.

Features

Compile-time effects checking

A function must statically declare all of the effects that it may use. If a caller calls a function that uses effects that the caller itself does not have access to, the compiler rejects the code before it runs.

Contracts

Pre-conditions and post-conditions can be added to a function with requires and ensures, respectively. These contracts are checked dynamically at runtime, and execution is halted if they are not satisfied.

Unified function call syntax

Birb permits writing function calls like f(x) or g(a, b, c). But Birb also supports a "method call" syntactic sugar. Thus the following are exactly equivalent:

  • x.f() and f(x)
  • a.g(b, c) and g(a, b, c)

And so on.

Rich type system

Birb has some built-in types. Nat is the type of natural numbers, and Str is the type of strings.

Birb allows for user-definable structs (product types) and enums (sum types). It also has tuples (anonymous products types).

Birb supports generic types and functions via parametric polymorphism.