C+ is a language that compiles directly to C. It maintains C's power while making it easier to understand and read. With one-to-one line translation, experienced C developers can translate their code into C+ with ease. The compiler, written in Python, has helpful and descriptive error messages to help the average developer. C+ is designed to get new people into C without the headaches, but with the power. Let's see what you can make!
import stdio
fn main() {
let hello: string = "Hello"
let name: string = "Bob"
print(hello + ", " + name + "!")
}
#include <stdio.h>
void main() {
char hello[] = "Hello";
char name[] = "Bob";
printf("%s, %s!\n", hello, name);
}- Compiled Directly to C
- Has one-to-one translation with C
- Does not require semicolons
- Pointers declared with "let*"
- Use "let [varname]: [var type]" instead of "int" or "char"
- Uses the GCC Compiler to compile the C
- If/Else statements do not require parentheses
- Void functions declared with "fn"
- Functions that return have a "-> [var type]" after the arguments
- Use "import [libray name]"
- Supports unsigned, long, short, or long long variables with the following syntax "let x: int; [unsigned]; [long, short, long long]"
- Uses "print" instead of "printf"
You can set up the compiler by navigating to setup.exe and running it. Make sure you run it as an admin on Windows. Then you can run the compiler by:
cpx [filename].cpx [Flags: -r -d -c -v]NOTE: The subdir /setup is the decompiled source code for setup.exe
NOTE: If you are on MacOS/Linux, you must compile it for your host system with the cargo command.
This project is licensed under the Bean Pringles Compiler License (BPC License) v1.0
To check out future features, go to here.
Things with a row of "-" underneath them are completed and added to the main repository
- 100 Commits!
- Reached a 7/10 linter score
