About

This page gives you a small overview of the language.

Functions

Asha has support for functions and function applications.

F x y = 2*x^2 + y^3

Equations

You can string equations together.

0 < F x < G x < H x = x^2 

Descriptive "Freedom"

You can describe functions in the context that you choose, so you don't have to start a line with function name - applications   =   expression like in many functional programming languages.

F x + 3*x = 6*G x - 16

Progressions

By the use of generics (a variable starting with a lowercase) it is possible to describe progressions. These can serve as hints for the interpreter, so you can help him "unwind the spine of your expressions" further by using these abstract declarations.

0 = a - b -> b = a

Nondeterminism

There can be more than one different result of an expression. This leads to multiple answers when you try to evaluate a portion of the code which uses an OR operator.

F x = 3*x | -3*x

Inverse functions

You can describe inverse functions (idea borrowed from the functional programming language Tina), which can be used in advanced pattern matching, or can aid the interpreter in solving an expression.

F x = 3*x
F' x = (1/3) * x
G (F x) = 3 * 6*x

# when you evaluate G 9 you get: 54

Conditions

With conditions you can make exceptions for a portion of code. You can use pattern matching or if-statements.

F 3 = 16
F x = 16, if x=3

# Both descriptions of the function F will result in 16 
# when applied to the number 3.
#
# They might seem the same, but in the backend 
# they're interpreted differently.

Recursion

Asha supports recursion.

Fib 0 = 0
Fib 1 = 1
Fib n = Fib (n-1) + Fib (n-2)