READ MORE HERE Old Go compiler is in barngo repository
Barn is a simple programming language written in C and compiled to C. Syntax is very simple, and Barn can call C/C++ functions natively so creating new bindings should be easy. Barn was written with the goal of being as fast and easy to use as possible. Barn is just a little project with which I can chill and just code.
You can find barn documentation at /documentation
fun main() {
println("Hello World\n")
}
14-function-arguments-variable.ba
fun example_function(int i1, string str1, bool b1, char c1, float f1) {
println(str1)
println("\n")
}
fun main() {
let i1: int = 1
let str1: string = "str"
let b1: bool = true
let c1: char = 'A'
let f1: float = 1.0
example_function(i1, str1, b1, c1, f1)
}
@import "std.ba"
fun main() {
for let i: int = 0; i != 1000; i++ {
if (i % 15) == 0 {
println("FizzBuzz\t")
} elif (i % 3) == 0 {
println("Fizz\t")
} elif (i % 5) == 0 {
println("Buzz\t")
} else {
printnum(i)
println("\t")
}
}
}
fun main() {
let age: int = 13
if (age == 13) {
println("Age is 13\n")
} elif (age == 14) {
println("Age is 14\n")
} else {
println("Age isn't 13\n")
}
}
@import "std.ba"
fun main() {
println("What's your name: ")
let user_name: string = input()
println("Welcome ")
println(user_name)
}
Here!, copy barn-lang folder to where you installed visual studio code (usually $HOME/.vscode/extensions/)
Here! move barn.vim into .vim/syntax/ and add the following line to ~/.vimrc autocmd BufRead,BufNewFile *.barn set filetype=barn
If you found a bug immediately call me about it, you can create Github Issue, write to me on Discord Solindek#9808 or on my website contact page