Euphoria: A tiny but very fast script language

- A tiny script language with amazing speed.
- Interpreter is offered as public domain.
- Compiler is offered as commercial product.
- Example: Merge sort.
#!/usr/bin/env exu -- Merge sort example in Euphoria function merge_sort(sequence x) integer n, mid sequence merged, a, b n = length(x) if n <= 1 then return x end if mid = floor(n/2) a = merge_sort(x[1..mid]) b = merge_sort(x[mid+1..n]) merged = {} while length(a) > 0 and length(b) > 0 do if compare(a[1], b[1]) < 0 then merged = append(merged, a[1]) a = a[2..length(a)] else merged = append(merged, b[1]) b = b[2..length(b)] end if end while return merged & a & b end function constant Nitems = 100 constant DataMAX = 300 constant Nrep = 1 procedure main() sequence list, sorted_list list = rand(repeat(DataMAX, Nitems)) ? list sorted_list = merge_sort(list) ? sorted_list end procedure for i = 1 to Nrep do main() end for