Project Description
Bird is a web-first programming language that compiles to WebAssembly, allowing code to be
executed in the browser at near-native speeds. Bird is designed to be used by web developers,
providing an option for writing high-speed browser code that works seamlessly alongside
JavaScript. The project's primary goals are to implement a highly performant and fully-featured
language, including fundamental language features, a strong type system, and garbage collection.
The project also includes a companion website featuring documentation, code samples, and a
playground environment where users can write and run Bird code and view the compiled WebAssembly
produced by the compiler.
Web developers are the primary intended user group for this project. Bird appeals to this
audience by providing near-native speeds through WebAssembly and easy interoperability with
JavaScript. Developers can seamlessly add Bird to existing projects to improve critical
operations. Bird also features syntax familiar to web developers and provides garbage collection
to allow for rapid development without memory management concerns.
The Bird Programming Language will provide basic features such as variables, loops, and
functions. It will also have an expressive type system with type aliases, aggregate types such
as arrays and structs, and generics. The language runtime will include a garbage collector.
The Bird compiler is implemented primarily in C++, utilizing Binaryen to produce compiled WASM
binary files that can be run in browser environments. The lexer and parser are written using
Flex and Bison, a parsing toolchain that produces a C++ parser from a grammar file, allowing
language syntax and grammar to be quickly iterated. Additionally, the garbage collection
algorithms are written in JavaScript and called by the compiled WebAssembly binaries. The
project is managed using CMake and built with a docker container to provide a consistent
development experience for each team member.
The Bird Programming Language is developed to be reliable. Each new feature implemented must
have an associated test suite, and no code may be pushed to the main if it does not pass the
tests. Bird is a statically typed language, meaning the compiler will not allow a developer to
perform invalid operations, making programs safe by catching errors early. Memory safety is also
a top priority. Many web developers have little experience outside of scripting languages, so
they are unfamiliar with manual memory management. We solve this issue by including a garbage
collector in the language, preventing memory leaks, and keeping programs memory-safe. We aim to
make the language as secure as possible, but we are bottlenecked by the WebAssembly runtime of
the browser. The WebAssembly is run in a sandboxed environment, separate from the host runtime,
allowing for secure programs.