Skip to content

A modern programming language with a modern syntax; For those of us too lazy to use C, and to good for python

License

Notifications You must be signed in to change notification settings

LueWasHere/BlueBird

Repository files navigation

BlueBird Logo

🕊️ BlueBird Language

BlueBird is a modern, lightweight programming language focused on clarity, speed, and expressive syntax.
It blends the elegance of high-level scripting with the precision and structure of systems programming.

"No macros. No magic. Just flight."


✨ Features

  • Simple, readable syntax — indentation and explicit keywords make code natural to write and easy to read.
  • No macros — BlueBird favors keywords (panic, throw, guard) over hidden metaprogramming.
  • Strong typing with flexible inference and explicit conversions.
  • Graceful error handling with exceptions and panics as first-class citizens.
  • Multi-paradigm — write imperative, object-oriented, or functional code freely.
  • Portable runtime — designed for small, efficient binaries.

🧩 Example

"Clean" Example

fn fib_naive( nth: Uint8 ) -> Uint64 | !ValuePanic {
    guard ( nth > 93 ) { panic ValuePanic("Fibonacci overflow beyond 93rd term."); }

    if (nth == 0) { return 0; }

    mut a: Uint64 = 0;
    mut b: Uint64 = 1;

    for ( i: int64 in 0..nth ) {
        a, b = b, a + b;
    }

    return a;
}

Idiomatic Syntax Example

fn fib_idiomatic(nth: Uint8) -> Uint64 | !ValuePanic
    guard nth <= 93 else
        panic ValuePanic("nth > 93 overflows Uint64")

    mut a: Uint64 = 0
    mut b: Uint64 = 1

    for _ in 0..nth
        a, b = b, a + b

    return a

Program Speeds

Currently, with hand compiled byte code, BlueBird is acheiving a speed twice as fast as python, and 2x slower than C. This is also unoptimized and not a good representation of BlueBird 1.0's final performance

# Ultra idiomatic example
a = 0
b = 1

for _ in 0..47
    a, b = b, a + b

print(a)
#include <stdio.h>

int main() {
    unsigned int b = 1;
    unsigned int a = 0;

    for (int i = 0; i < 47; i++) {
        b = a + b;
        a = b - a;
    }

    printf("%u\n", a);
}
a = 0
b = 1

for i in range(0, 47):
    a, b = b, a + b

print(a)

Program speed bar graph


🛠️ Build & Run

Prerequisites

  • Make ≥ 4.3
  • A C++17 (or higher) compiler

Building

git clone https://github.com/LueWasHere/BlueBird.git
cd BlueBird
mkdir build && cd build
make all

Upon running make all, the executable will be contained in ./build/bluebird

Running

./<path-to-bluebird>/bluebird <path-to-source-file>.bb

📜 Philosophy

BlueBird rejects the trend of hidden abstraction layers and cryptic macro magic. It aims for explicitness, intentional design, and error transparency. Every construct should say what it means - no more, no less.


🧠 Design Principles

Principle Description
Readability First Code should read like a statement of intent, not an incantation.
No Hidden Behavior No automatic memory juggling, no implicit conversions.
Native Safety You can touch memory, but you’ll know when you do.
Keywords over Macros panic, throw, guard - simple, clear, and visible.

🧰 Project Structure

.
├── 
├── src/                # Compiler and runtime source
├── bluebird/           # BlueBird files
|   ├─── std/           # Standard library modules
|   └─── examples/      # Example BlueBird programs
└── docs/               # Language documentation

🐦 Roadmap

☑ Syntax and language design

☐ Core compiler and lexer

☐ Bytecode interpreter

☐ Standard library

☐ Package manager (bbpkg)

☐ IDE syntax highlighting + LSP


🤝 Contributing

Pull requests are welcome! For major changes, open an issue first to discuss what you'd like to change. Make sure to update tests as appropriate.


⚖️ License

MIT License © 2025 Adam S. Duncan


🧭 Motto

“Let your programs fly free as a bluebird”

About

A modern programming language with a modern syntax; For those of us too lazy to use C, and to good for python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published