Skip to content

TechEverythingTikTok/zxLang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zxLang

A simple programming language I made using C++, which transpiles to C. This is still a WIP I will update occasionally, do let me know if you have any suggestions!

Compiling the language

Run make in the root of the project to compile. It uses GCC. Compile manually if you are using Clang or MSVC, link all the .cpp files

Syntax

Comments:

// This is a comment

Variables:

var x: u8 = 5;

Constants:

const x: u8 = 5;

Pointers:

var x: u8 = 5;
ptr x_ptr: u8 = &x;

Functions:

func add(var x: i32, var y: i32) - i32 {
    return x + y;
}

Conditionals:

var x: u8 = 5;

if x == 5 {
    
} elseif x == 10 {

} else {

}

While loop:

var y: u32 = 100;
while y == 100 {

}

For loop:

var x: u8 = 0;

for x = 0; x < 100; x = x + 1 {

}

Structures (no ';' needed):

structure x {
    var x: u32,
    var y: u32,
    var z: i8
}  

Importing module (.zx):

@import("module.zx");

Including header (.h):

@include("header.h");

Examples

Examples are in the folder examples/

License

License is in the file LICENSE

About

A programming language I created (precompiled binary too) - for Linux mostly

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors