Aurora is a scripting language that is imperative, dynamically typed, and compiled. It's inspired by Rexx, Lua, and Perl.
Aurora is imperative, which means your program is described as a list of actions for the computer to carry out. Aurora is also dynamically typed, which means that variables are not bound to a certain type— but can hold any value.
sub say_hi_to name
# an action
print "Hi, " , name, "!"
end
say_hi_to "World"
# Hi, World!
It's meant for automation (think shell scripting), text processing, and general scripting applications. The language is simple enough to become fluent in within an hour, but powerful enough to replace your dusty Perl and Bash scripts. Filesystem operations, report generation, command execution— all what Aurora's designed for.
sub backup_file name
new = name + “.bak”
copy name, new
end
for file, dir()
backup_file file
print “Backed up “ , file
end
Aurora keeps simple by removing the concept of null. All variables must have a value. In Aurora, there are functions (marked 'fn') which must return a value, and subroutines (marked 'sub') which cannot return a value. Functions can be called in any context, but subroutines can only be called outside of expressions. This distinction allows Aurora to exclude the concept of null. Functions and subroutines are first-class values in Aurora, and are also closures.
fn fib n
if n < 0
return n
else
return fib(n - 1 ) + fib(n - 2 )
end
end
sub print_fib_of n
print “fib(“ , n, “) : “ , fib(n)
end
for i, to(20 )
print_fib_of n
end
Aurora has two primitive data structures: arrays and maps. Arrays are dynamic, and grow/shrink as needed. Map keys can be any value, and so can the values in the map.
my_map = {
"foo" : 13 ,
"bar" : "baz" ,
96.7 : "fahrenheit"
}
print my_map:"bar" # baz
my_list = { 1 , "foo" , { 3 , 4 }, false }
my_list:0 = 3
print my_list:0 # 3
Aurora has the basic control flow you'd expect: if-else, while loops, and for loops. It also has select (a case construct), until (inverse while), unless (inverse if), and switch (switch-case).
sub fizzbuzz i -> select
case i % 15 == 0
print “FizzBuzz “ , i
end
case i % 3 == 0
print “Fizz “ , i
end
case i % 5 == 0
print “Buzz “ , i
end
else
print i
end
end
input = false
until input
input = num(ask(“Input a number: “ ))
end
for i, to(input)
fizzbuzz i
end
You're now equipped to start writing programs in Aurora. Go forth and write your own programs!