3.0.1 • Published 4 months ago

bro-lang v3.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

bro-lang

bro-lang is an interpreted programming language made for a discord bot called Dora

bro-lang-logo

getting started

to compile bro code you can use:

npm install -g bro-lang
bro filename.bro

or

npx bro filename.bro

syntax

bro-lang is made for fun so I made its syntax look like a lot of programming language but bro-langs syntax is similar to javascript

your_favorite_language = "python"

if (your_favorite_language == "python"){
    say("try me bro")
}fi if(your_favorite_language == "bro"){
    say("your better ,stonger, faster")
}

and you can replace { with do and } with end also () are optional

variables

you can declare a variable with the var keyword

var i = 0;

or you can just remove the var keyword

i = 0;

Data Structures

there are 6 main data structures:

  • string
  • number
  • bool
  • objects
  • arrays
  • null

took me days to make

i = "string" # string
i = 0        # number
i = true     # bool
i = null     # null
i = {}       # object
i = []       # array

they all work the same as they work in js

statements

  • if statements:

    you can define if statements like this
    i = 1
    if (i > 0)do 
        say("its a positive number")
    end fi if( i == 0 ){ # remember there is no else its fi
        say("the number is 0")
    }fi{
        say("its a negative number")
    }
  • loops:

    you can define if statements like this
      i = 1
        loop(i < 100){
            say(i)
            i = i + 1
            if (i % 15 == 0) {
                say("fizzbuzz")
            }fi if(i % 3 == 0) {
                say("fizz")
            }fi if(i % 5 == 0) {
                say("buzz")
            }fi {say(i)}
        }
  • functions:

    fun sum(a,b){
        a + b
    }
    say(sum(1,1))
    anonymous function:
        sum = _(a,b){ return a + b }
        say("sum")

new features coming soon 😉

Credits

Please give me a star ⭐

Created by hsn-bro-coder aka Hasan ☠

3.0.1

4 months ago

2.9.0

4 months ago

3.0.0

5 months ago

2.8.1

5 months ago

2.8.0

5 months ago

2.7.0

5 months ago

2.6.0

5 months ago

2.5.0

5 months ago

2.2.0

6 months ago

2.1.0

6 months ago

2.0.0

6 months ago

1.5.0

6 months ago

1.4.3

6 months ago

1.4.2

6 months ago

1.4.1

6 months ago

1.4.0

6 months ago

1.3.0

6 months ago

1.2.2

6 months ago

1.2.1

6 months ago

1.2.0

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago