Skip to content

Spydr06/BCause

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BCause - B compiler for modern systems

BCause is a compiler for the B programming language, developed by Ken Thompson and Dennis Ritchie at Bell Labs in 1969, later getting replaced by C. BCause is written in C99 and relies on a minimal set of dependencies, namely libc and the GNU binutils.

This repository also includes a libb.a implementation, B's standard library. It requires zero dependencies, not even libc.

BCause is implemented as a small single-pass compiler in ~2000 lines of pure C99 code. Therefore, it features small compile times with a very low memory footprint.

Current Status

  • global variables
  • functions
  • auto & extrn variables
  • control flow statements
  • expressions
  • libb.a standard library
  • optimization
  • nicer error messages

Compatibility

Due to BCause's simplicity, only gnu-linux-x86_64-systems are supported.

  • If your system can run GNU-make, GNU-ld and GNU-as, BCause itself should be able to work.
  • Because of the reliance on system-calls libb.a has to be implemented for each system separately.

Note Feel free to submit pull requests to provide more OS support and fix bugs.

Installation

To install BCause, first clone this repository:

$ git clone https://github.com/spydr06/bcause.git
$ cd ./bcause

Then, build the project:

$ make

To install BCause on your computer globally, use:

# make install

Warning this requires root privileges and modifies system files

Usage

To compile a B source file (.b), use:

$ bcause <your file>

To get help, type:

$ bcause --help

Licensing

BCause is licensed under the MIT License. See LICENSE in this repository for further information.

References

Releases

No releases published

Packages

No packages published