Skip to content

radeqq007/Sunbird

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

737 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sunbird

Sunbird

GitHub go.mod Go version Build Lint Tests Coverage Go Report Card Last commit GitHub stars

Sunbird is dynamically-typed, interpreted programming language that focuses on ease of use and simplicity.

For detailed language reference, standard library docs, and guides, see the docs/ directory.

Overview

Hello world in Sunbird

import "io"

io.println("Hello world")

Defining variables and functions

// Use the := operator to declare a variable
a := 1
name := ""

// to define constants use the :: operator
x :: 20
pi :: 3.141

// Defining functions
add :: fn(a, b) {
    return a + b
}

add(a, b)

Control flow

import "io"

a := 1
b := 2

if a > b {
    io.println("a is greater than b")
} else if a < b {
    io.println("a is less than b")
} else {
    io.println("a is equal to b")
}

for i in 0..10 {
    io.println(i)
}

while a <= b {
    io.println(a)
    a += 1

    if a == 1 {
      continue
    }

    if a == 2 {
      break
    }
}

loop {
    io.println("This will run forever!")
}

try {
    c := 1 / 0
} catch e {
    io.println(e)
} finally {
    io.println("finally")
}

About

An interpreter for the Sunbird programming language.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages