| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This directory contains example programs demonstrating the features of the Bolt programming language.
# Run a simple hello world
./target/debug/bolt examples/hello.bolt -o hello
./out/debug/hello
# Run all examples at once
./run_examples.shThe classic "Hello, World!" program demonstrating:
./target/debug/bolt examples/hello.bolt -o hello
./out/debug/helloA comprehensive example showcasing:
./target/debug/bolt examples/calculator.bolt -o calculator
./out/debug/calculatorThe calculator demonstrates various operations and should output mathematical results, boolean comparisons, and complex expressions, showcasing the language's capabilities in a practical context.
A demonstration of logical operators and boolean logic featuring:
./target/debug/bolt examples/logic_demo.bolt -o logic_demo
./out/debug/logic_demoval x := 42 // Immutable integer
val name := "Bolt" // Immutable string
val numbers := [1, 2, 3] // Immutable array
var counter := 0 // Mutable integer
fun add(a: Integer, b: Integer): Integer {
return a + b
}
fun is_even(n: Integer): Bool {
return n % 2 == 0
}
val result := (x + y) * 2 - 10 // Arithmetic with precedence
val comparison := x > y && y < 100 // Boolean operations
val complex := max(add(x, 5), y) // Function composition
val logic := !false || (x >= 10 && y != 0) // Logical operators
The Bolt language prioritizes simplicity, type safety, and familiar syntax while compiling efficiently to native code through C transpilation.
| Back | FazBrowse Home | New Git URL |