Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

b

> 编程语言
Open source

Compiler for the B Programming Language implemented in Crust

710 stars0 likes0 views
WebsiteGitHub

About

Compiler for the B Programming Language implemented in Crust

B Programming Language

[!WARNING] The Compiler is not fully implemented yet. Plus on its own it's probably not useful for any serious Software Development. It is fun for Recreational Programming though.

Logo by Strawberry

Compiler for the B Programming Language implemented in Crust.

Quick Start

$ make
$ ./build/b -run ./examples/hello_world.b

Also check out more examples at ./examples/. Find the project documentation at ./docs/.

Dependencies

Generally, to write programs for the three major contemporary platforms (Linux, Windows, Darwin) you need only these things:

  • Rust - the compiler is written in it;
  • GCC or Clang or mingw-w64 (whatever serves as the cc on your POSIX platform) - the x86_64 and aarch64 targets generate assembly and pass it to cc to assemble and link.

If you feel like playing with our "spicy" targets, you will need to setup few additional things.

uxn

Uxn is a pretty cool small virtual machine designed to be simple and portable.

This compiler toolchain expects the uxnemu and uxncli executables to be available in the $PATH environment variable. We recommend to build them from the source code available at https://git.sr.ht/~rabbits/uxn. Follow their build instructions and then copy the contents of the bin/ folder somewhere were the $PATH points at.

6502-posix

MOS Technology 6502 is a legendary processor that was used in such systems as the Atari 2600, Atari 8-bit computers, Apple II, Nintendo Entertainment System, Commodore 64, Atari Lynx, BBC Micro and others.

Since "targeting 6502" doesn't really mean anything, given the diverse array of hardware, we created a special target called posix6502. It's a simple 6502 emulator that exposes some POSIX functionality to programs running on the 6502 processor, allowing them to operate in a POSIX environment. We use it as a testing and playground target for 6502 codegen. In the future, we may add more 6502-related targets.

It consist of a single posix6502 executable which is expected to be available to the compiler toolchain via the $PATH environment variable. We recommend to build it from the source code:

$ git clone https://github.com/bext-lang/posix6502 && cd posix6502
$ cc -o nob nob.c
$ ./nob

Copy the build/posix6502 executable somewhere were the $PATH points at.

Thirdparty Codegens in the Wild

  • .NET/Mono Bext Codegen
  • SH4AL-DSP (Casio Prizm/fx-CG50)
  • Basm target for bext-lang/b
  • Custom Bext Bytecode
  • MSVC Bext Codegen

Submit a PR to add yours to the list above here

References

  • https://en.wikipedia.org/wiki/B_(programming_language)
  • https://www.nokia.com/bell-labs/about/dennis-m-ritchie/kbman.html
  • https://www.nokia.com/bell-labs/about/dennis-m-ritchie/bref.html
  • https://www.nokia.com/bell-labs/about/dennis-m-ritchie/btut.html

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言