Skip to content
/ barn Public

Barn is a simple programming language written in C that is compiled to C.

License

Notifications You must be signed in to change notification settings

barn-lang/barn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Barn Programming Language

About

Barn is a simple and efficient programming language designed for beginners and experienced programmers alike. It is compiled to C, making it fast and portable. Barn has a clean and easy-to-read syntax, making it a great choice for learning programming. It also has a growing community of users and contributors.

This repository includes the whole BarnC which is basically Barn compiler written in C, lot's of example programs in Barn and also extensions for well known editors like Vim, Visual Studio Code, Emacs

Get started with Barn

Welcome to the exciting world of Barn programming! For a seamless introduction to the language, we highly recommend exploring our documentation, which is available online. Dive into the details and unleash your creativity by visiting our documentation page.

If you don't have time to read our documentation check out everything underneath. To get started with Barn you have to install our compiler, to do it correctly put these commands into your (Linux/MacOS) terminal (Windows is not supported right now):

terminal

git clone https://github.com/barn-lang/barn && cd barn
make CC=gcc # Set the compiler you will use
make install
barn --version

After that let's dive into some programming. We will start with the most basic program we can write in any programming language yeah i mean a Hello World.

main.ba

@import "std.ba"

fun main() -> i32 {
    println("Hello, World!")
    return 0
}

That's all, after compiling this program by using this command barn ./main.ba and running it with ./a.out you should see a beautiful Hello, World! pop up in your terminal window! That is the most basic thing in Barn. We would also recommend to check out some examples in Barn right here

Finding & reporting bugs

Barn is a dynamic and evolving programming language, your feedback is crucial in ensuring its stability and performance. If you encounter any bugs or unexpected behavior, we encourage you to report them as fast as possible. If you find a bug please create a new github issue on this repository, please include code and terminal output.