ELI - A System for Programming with Arrays

 Contents

Home
Download
Documents
Contact Us

ELI is an array programming language system based on APL but uses ascii-character set. ELI has most of functionalities of ISO APL standard, i.e. all flat array operations, but it also has facilities not prescribed there such as lists for non-homogeneous data, complex numbers, symbols, temporal data, control structures and scripting files. ELI is succinct, easy to learn and versatile. Compared with MATLAB, ELI encourages a dataflow style of programming where the output of one operation feeds the input of another that result in greater productivity and clarity of code.

ELI is freely available on Windows, Linux and Mac OS; see Download for versions and update information. An introductory paper and a Primer are available in Documents. We give a sample here to illustrate the flavor of the language. People already familiar with APL can jump directly to examine the APL/ELI Symbol Comparison Table. A line of ELI executes from right to left as a chain of operations, and what to the right of ¡®//¡¯ is a comment.

!10//give the vector 1..10
1 2 3 4 5 6 7 8 9 10

100*!10//multiply that vector by 100
100 200 300 400 500 600 700 800 900 1000

3 4#!10//reshape the vector 1..10 into a 3x4 matrix
1  2 3 4
5  6 7 8
9 10 1 2

&.3 4#!10//flip the above matrix
1 5  9
2 6 10
3 7  1
4 8  2

+/3 4#!10//sum each row of the 3x4 matrix
10 26 22

2*0,!10//append 0 in front of 1..10, and double it
0 2 4 6 8 10 12 14 16 18 20

2*.0,!10//2 to the power of 0..10
1 2 4 8 16 32 64 128 256 512 1024

%1 2 3 5 10//1 divided by 1 2 3 5 10
1 0.5 0.3333333333 0.2 0.1

1024*.%1 2 3 5 10//1024 takes 1 root, square root, cube root, ¡­
1024 32 10.0793684 4 2

1-2//1 minus 2
_1

_1*.0.5//square root of minus 1
0j1

@1//pi
3.141592654

*.0j1*@1//e = -1
_1

2012.12.25+!7//7 days following Christmas of 2012
2012.12.26 2012.12.27 2012.12.28 2012.12.29 2012.12.30 2012.12.31 2013.01.01

w<-10?.100//get 10 random numbers from 1..100
    w
14 76 46 54 22 5 68 94 39 52

(w<50)/w//get those in w which is less than 50
14 46 22 5 39

y<-12+2*!7
y
14 16 18 20 22 24 26

(~w?y)/w//get those in w which are not in y
76 46 54 5 68 94 39 52

+/(~w?y)/w//get total sum of those left
434

$_5+!15//reverse of _5 adds to 1..15
10 9 8 7 6 5 4 3 2 1 0 _1 _2 _3 _4

32+1.8*c<-$_5+!15//Fahrenheit correspond to Celsius above
50 48.2 46.4 44.6 42.8 41 39.2 37.4 35.6 33.8 32 30.2 28.4 26.6 24.8

c,[1.5]32+1.8*c<-$_5+!15  //a table of temperature conversion
10 50  
 9 48.2
 8 46.4
 7 44.6
 6 42.8
 5 41  
 4 39.2
 3 37.4
 2 35.6
 1 33.8
 0 32  
_1 30.2
_2 28.4
_3 26.6
_4 24.8


APL keyboard

APL/ELI Symbol Comparison

UP

 ©2013 by chf