~yvan-sraka/bee-lang

Root repository of the Bee toy programming language
~yvan-sraka/bee-lang

New hg repository added

2 months ago

#Bee programming language

A small language that is easy to learn and that helps you wrote bug-free programs.

The project was introduced at FOSDEM 2024, you can find the slides here.

// A quick taste of the Bee syntax:
{ Flower = type ("🌸" | "🌺" | "🌼")
  { fmt = args => "${args.animal} is ${args.mood}!"
    return x => fmt { animal = "🐝"; mood = if Flower x "happy" else "sad" }
  } (read "/dev/stdin") |> print
}

Check out the examples folder, for more code snippets.

Bee currently compile to JavaScript but aims to suitable for system programming!

One core design idea to keep the language small is to define most of construct in the standard library.

#Usage

Get a Rust toolchain working on your computer, and then cargo install --git https://git.sr.ht/~yvan-sraka/bee-lang to build from source.

Check out the Syntax Highlighting Guide to set-up your code editor. You can also find an example on how to set-up Webpack to work with Bee.

#Roadmap

#What Has Been Implemented...

  • Funny Bugs! 🐛
  • Syntax grammar.js with TreeSitter;
  • Semantics (destructuring, spread operator, implicit function arguments, operator overloading, etc.);
  • Prelude (minimal standard library);
  • CLI (that works without node in your PATH);
  • Build targets (e.g., @debug, @release or user-defined);
  • Build cache (file-based);
  • Basic editor support (syntax highlighting);

#What's Left to Do...

  • Pattern matching (in lambda definition, let-bindings and branches of a match keyword);
  • Constrained mutability (e.g. needed for while loops);
  • Subtyping (keeping track of the partial order of Types declared within a scope).
  • A Language Server Protocol (LSP) and Debug Adapter Protocol (DAP);
  • A native backend (C, WASM or LLVM);
  • An incremental typing algorithm;
  • A language package manager.

#Mailing-lists