Aetherc

From Esolang
Jump to navigation Jump to search

Aetherc

The official Aether website

Purpose

Aetherc is a programming language to solve issues like bad syntax and the slowness of interpreted languages. Aether is a general purpose language like C or Lua.

Examples of Aether:

const var1 = "Hello"
const var2 = "World!"

print(var1..var2) -- Concatenates var1 and var2

The resulting llvm ir code is:

@str = private unnamed_addr constant [12 x i8] c"HelloWorld!\00", align 1
declare i32 @printf(i8*, ...)

define void @main() {
entry:
    call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i32 0, i32 0))
    ret void
}

As you can see, since these are constants, they never change so they are precomputed.

const N = 10

function fibb(n)
    local fib = [0, 1]
    for i = 2, n - 1
        fib[i] = fib[i - 1] + fib[i - 2]
    end
    return fib
end

local fibo = fibb(N)
print("fibo = ", fibo)