Algae (programming language)

From Wikipedia, the free encyclopedia

Algae is an interpreted programming language for numerical analysis, a branch of mathematics. Its interactive interpreter is available under GPL. The language and its implementation were designed by Scott Hunziker and Mike Brennan starting in 1994.

Contents

[edit] Syntax and semantics

The syntax of Algae is largely drawn from C. The semantics, however, are more similar to a dynamic programming language such as Perl or an interactive technical-computing language such as MATLAB. Built-in data types for matrices and operators for matrix arithmetic are provided.

[edit] Examples of Algae code

These examples are from the official Algae manual (reference: [1]):

# Print temperature conversions
fahr = sort (0:300:20, 32, 212);
Celsius = (5/9)*(fahr-32);
[fahr;Celsius]'?

# Read and sum some numbers
sum = 0;
$read = 1;
while ($read) { sum += readnum(); }
sum?

Both the question mark and semicolon are statement terminators. When ? is used, the return value of the statement is printed to the user's console.

[edit] Advantages of Algae

  • Algae is a very fast language
  • Variables take up very little memory

[edit] The algae interpreter

The CLI interpreter by Hunziker and Brennan is the single implementation of Algae. It is licensed under the GNU General Public License. It is compatible with Unix-based operating systems. It has not been ported to non-Unix operating system such as Microsoft Windows. The interpreter is designed to used interactively. As of 2007 the Algae interpreter appears to be unmaintained, with the source code and distribution web site last updated in 2004.

[edit] External links