4 releases (2 breaking)
Uses new Rust 2024
| 0.12.1 | Jan 17, 2026 |
|---|---|
| 0.11.0 | Jan 15, 2026 |
| 0.10.1 | Jan 9, 2026 |
| 0.10.0 | Jan 8, 2026 |
#718 in Command line utilities
40KB
831 lines
BEE_HIVE
HIVE (stands for Hive handles Integration, Validation, & Execution) is a compiler and a CLI that transforms programs
from custom programming language called Bee (stands for Brainf**k Extension Language) into brainf**k-like language
called NJ (stands for No Joke) with future plans for compiling directly to brainf**k.
Why
Why? Why the hell not? Isn't it hype when you put down readable code and get a valid code that is just like R2-D2 noises?
Also, it's mostly for educational purposes (of myself), so I feel like it's valid and if someone can find a reason to use it - I'd be impressed so just go for it if you need it.
You can also check out this devlog as well other ones
Features
- Ability to write text to the console
- That's it for now... 🥲
Installation
Portable
You can download portable executables from the Releases tab
Using Cargo
This CLI was uploaded to crates.io. You can download it using this commend:
cargo install bee_hive
Run Locally
Clone the project
git clone https://github.com/ak47andrew/bee_hive.git
Go to the project directory
cd hive
Build the app
cargo build --release
Use cargo run
cargo run --release
...or access executable directly
./target/release/bee_hive
Usage/Examples
CLI's help command looks something like this: hive <PATH> [--debug]
- <PATH> - path to the source code of your program, often ending at
*.bee - [--debug] - flag that allows to show extra information during compilation process which can be useful for debugging.
Behaves pretty much like
--verbose/-vflag at most CLIs
Resulting code is outputted to the stdout, so you might use output redirection to write it to file like this:
hive code.bee > output.nj
Example program at BEE language (to output x = 1) looks something like this:
var x = 10;
put("x=");
print(x);
Resulting code will look like this:
>!< // SET_POINTER { index: 1 }
++++++++++< // LOAD_IMMEDIATE_INTEGER { value: 10 }
>!< // SET_POINTER { index: 1 }
[-+!#]>!>>>>>>#![+-!] // STORE_VARIABLE { cell: 6 }
>!< // SET_POINTER { index: 1 }
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++< // LOAD_IMMEDIATE_STRING { value: "=x" }
>!<< // SET_POINTER { index: 2 }
[-+!#]>!>#![+-!].[-] // OUTPUT { value_type: Char }
>!< // SET_POINTER { index: 1 }
[-+!#]>!>#![+-!].[-] // OUTPUT { value_type: Char }
>!>>>>>> // SET_POINTER { index: 6 }
[-+!#]>!<#![+-!] // LOAD_VARIABLE { cell: 1 }
>!< // SET_POINTER { index: 1 }
[-+!#]>!>#![+-!]>>+<<.[-]>>- // OUTPUT { value_type: Integer }
>!< // SET_POINTER { index: 1 }
++++++++++< // LOAD_IMMEDIATE_STRING { value: "\n" }
>!< // SET_POINTER { index: 1 }
[-+!#]>!>#![+-!].[-] // OUTPUT { value_type: Char }
Info about BEE programming language and NJ target can be found in GitHub wiki
Known Issues
Check Changelog and GitHub issues
Roadmap
- IR optimization
- Some math
- Ability to write and run code at Arduino and push code directly from this CLI
- If-else statements
- For and while loops
- Ability for multi-cell variables and immediates
- 1.0 Release! Hopefully...
Contributing
Contributions are always welcome!
Feels free to suggest your pull requests with any bug fixes and ideas
Also feel free to write your own devlogs! I created a
Developerfield specifically for it
If you encounter any errors, please report them on GitHub
Discussions available for ideas, brainstorming (pun intended), use-cases "in the wild" and your creations
License
Dependencies
~3–4.5MB
~86K SLoC