Lux is a dynamically-typed, interpreted scripting language with a clean C-like syntax. It supports first-class functions, closures, objects, lists, dicts, and error handling.
- Syntax Reference — Variables, control flow, functions, operators
- Types & Methods — Numbers, strings, lists, dicts, objects
- Built-in Functions —
print,range,import,getType, etc. - Error Handling —
try,catch,throw - Modules —
importand namespaces - Embedding in C# — Using the DLL from C# code
// Hello, World!
print("Hello, World!")
// Variables
let name = "Alice"
let age = 30
print("Name: " + name + ", Age: " + str(age))
// Function
fun greet(person) {
return "Hello, " + person + "!"
}
print(greet("World"))
// List + for loop
let fruits = ["apple", "banana", "cherry"]
for fruit in fruits {
print(fruit)
}
dotnet run -- path/to/script.lux