b0 Logo B0

Copyright © 2000-2008, Darran Kartaschew

Introduction

The B0 language and compiler came about during an effort to create my own Operating System. The main problem faced, was the C was too high level, and coding in assembler was a pain (even though 80% of my code is pure asm, and the other 20% is PHP for work).

Being soley an assembler programmer for many years gave me a pure unrestricted environment to play in, rather than being locked down to a particular environment. Which always left a bad taste in my mouth, whenever I worked with many of the HLLs out there, (ever tried a bitwise rotate in C?). I wanted the freedom that assembler gave me, but have a HLL programming style.

I looked Randall Hyde's HLA, and while the syntax is more HLL programmer friendly, it still didn't gel with me. Plus I was limited to a particular OS (Windows or Linux), becuase of the standard library it used. (Which by the way is a great library, just doesn't suit my needs as it stands).

At first B0, may look like C, but once you get down and dirty, you quickly realise that it's not a bastardised C clone, but something else. The best way I would describe it, is a HLL designed to be machine dependent based a 64bit architecture.

A quick word on licensing: The B0 language and this implementation are released under a BSD license.

System Requirements

Code Example

//Program 'Hello World';
lib 'stdlib.b0';
proc main(){ 
    r0 = &'Hello World™\n'; 
    echo(r0); //echo() prints the string pointed to by r0 to stdout 
    exit(r0);
}; 

The always present 'Hello World™' example.

Unfortunately, this little example doesn't give away that much...

As you can see, it looks a lot like C and quite a few other languages. But the make up of each statement is very simple, and in most cases match the assembler output nearly 1:1.

Hopefully some of the other code snippets will highlight this.

What makes it different from other languages

Nothing really, except that it's very minimalist and you get to play with the CPU registers within the acutal code itself. (The code focuses around the registers).

Is it Assembler or a High Level Language, or both?

Well that depends on your view of things. It's assembler, since it provides near 1:1 correspondance to actual machine instructions, but it's HLL since the code is constructed as a HLL.

It's a debate that I don't want to get into, but you may even want to call it a HLA (High Level Assembler), but I wouldn't go that far. Personally I believe it's a hybrid, or a machine dependant HLL. On the generation scale, eg 1GL (straight hex), 2GL (assembler), 3GL (HLL), 4GL (VHLL/Natural), I would place it about 2.9GL.

What's Supported

Here is a quick list of the current programetic support:

What's NOT supported (and most likely never will)

Here is a quick list of stuff is isn't currently supported, and most likely never will be:

These are simple too high level...

Future Plans

The current future plans or to-do list include:

Documents

B0 v0.0.23 Manual: HTML

B0 v0.1.1 IDE for Windows x64 Screenshots

B0 Compiler Internals Document: HTML (Note: This covers v0.0.6 of the compiler).

B0 Version History: HTML.

B0 Tutorial: HTML.

Downloads

B0 v0.0.23 Source (tar.gz): b0-0.0.23.tar.gz

B0 v0.0.23 Source (zip): b0-v0.0.23.zip

B0 v0.1.1 IDE for Windows x64 (includes b0 v0.0.23) : b0-v0.1.1.msi

Contact Me

I am reachable via the project discussions page at: https://sourceforge.net/p/b0language/discussion/general/