Table of contents
Getting Started
Installation
Usage
What's new
Migration Guide
Basic Syntax
Data Types
Expressions
Variables
Conditions
Commands
Arrays
Loops
Functions
Importing
Advanced Syntax
As Cast
Builtins
Type Condition
Compiler Flags
Standard Library
Array
Date
Environment
FileSystem
HTTP
Math
Text
Contributing
How to
Guide
Compiler structure
Amber by Example
Backup Rotator
ShellCheck tester
Ubuntu Updater
Bot Detector
LSP Installer
Basic Syntax
This documentation assumes a foundational understanding of programming concepts.
Since Amber is designed with a syntax inspired by ECMAScript, some aspects of the programming language may appear familiar.
We suggest to take a look on the examples we provide to see real use cases written in Amber.
Here, we may notice an echo built-in function, which performs the same operation as Bash’s echo command.
Here is a code snippet that illustrates certain features of Amber. We will provide detailed explanations for each of these features and cover additional content in the forthcoming chapters.
// Define variables
let name = "John"
let age = 30
// Display a greeting
echo "Hello, my name is {name}"
// Perform conditional checks
if age < 18 {
echo "I'm not an adult yet"
} else {
echo "I'm an adult"
}
// Loop through an array
let fruits = ["apple", "banana", "cherry", "date"]
echo "My favorite fruits are:"
for fruit in fruits {
echo fruit
}
Table of contents
Getting Started
Installation
Usage
What's new
Migration Guide
Basic Syntax
Data Types
Expressions
Variables
Conditions
Commands
Arrays
Loops
Functions
Importing
Advanced Syntax
As Cast
Builtins
Type Condition
Compiler Flags
Standard Library
Array
Date
Environment
FileSystem
HTTP
Math
Text
Contributing
How to
Guide
Compiler structure
Amber by Example
Backup Rotator
ShellCheck tester
Ubuntu Updater
Bot Detector
LSP Installer