Amber the programming language compiled to Bash/Ksh/Zsh
💎 Amber: The Modern Language for Shell Compilation
Amber is a contemporary, type-safe programming language specifically engineered to compile into Bash, Ksh, and Zsh. By shifting error detection to the compilation phase, it effectively eliminates common bugs before the script ever runs.
🛠️ Technical Architecture
The transformation process can be visualized as follows:
The core logic follows the principle: .
💻 See it in Action
Amber utilizes an ECMA Script-inspired syntax to make shell scripting feel like modern development. Below is an example of a function that retrieves weather data:
import { join } from std/text
fun get_weather(cities: [Text]): Null {
let temperatures = [Text]
for city in cities {
// Execute shell command via $
const result = $ curl -s https://wttr.in/{city}?format=1
$failed {
echo "Error: Failed to get weather for {city}"
continue
}
temperatures += [result]
}
return temperatures
}
// Execution trigger
get_weather([])
Note: You can trigger the function by clicking
get_weather([])in the interactive documentation.
🚀 Key Advantages
| Feature | Traditional Shell | Amber |
|---|---|---|
| Type Safety | ❌ | ✅ |
| Compile-time Errors | ❌ | ✅ |
| Modern Syntax | ❌ | ✅ |
| Standard Library | Limited | Extensive |
Why choose Amber?
- Runtime Reliability: Amber mandates that you explicitly handle every potential failure point.
- Developer Experience:
Manual debugging of runtime crashesInstant feedback via compiler. - Built-in Power: Comes with a comprehensive standard library packed with utility functions.
Feature Checklist:
- Type-safe variable declarations
- Modern
importsystem - Integrated shell command execution
- Robust error handling blocks
🏆 Recognition & Origin
"The best Engineering Project in Technology at Wrocław University" — #1 Award Winning Project of 2024
Founder: Paweł Karaś
Experience the evolution of automation. Discover the joy of shell scripting with Amber.
© 2024 Amber | [View telemetry data] | show_docs