Content deleted Content added
m Dating maintenance tags: {{Primary}} |
Thank Dbachmann for pointing out the problem of examples from ELI official website. I add several new ELI code snippets and more resource reference. |
||
Line 1:
{{Infobox programming language
|name = ELI<ref name="vector">
Line 9 ⟶ 8:
|developer = Rapidsoft<ref name="fastarray">[http://fastarray.appspot.com/default.html ELI - official site]
"ELI is freely available on Windows, Linux and Mac OS; see Download for versions and update information. An introductory paper, a tutorial on Programming with Arrarys , a Primer and a Compiler User’s Guide are available in Documents. We give a sample here to illustrate the flavor of the language."
"© 2015 by chf"</ref>
(Hanfeng Chen<ref name="mirror">[http://cs.queensu.ca/~chenh/eli/ ELI - mirror site at Queen's University]</ref>) |latest release version = 0.2
|latest release date = November 30, 2013
|typing = [[dynamic typing|dynamic]]
|implementations = C++
|operating_system = [[Cross-platform]]
|file_ext = .esf .eli
|website = {{url|http://fastarray.appspot.com/}}
|dialects =
|influenced_by = [[APL (programming language)|APL]], [[Q (programming language from Kx Systems)|Q]]
}}
'''ELI''' is an interactive [[Array_programming | array programming language]] system based on [[APL (programming language) | APL]]. It has the most of functionalities of ISO APL standard. In addition to classical APL, ELI features list for non-homogeneous or non-rectangular data, complex numbers, symbols, temporal data, and control structures. A scripting file facility helps a user to easily organize programs in a fashion similar to using #include in C, which also provides convenient data input/output. Moreover, ELI has dictionaries, tables and a basic set of [[SQL | SQL-like statements]]. For performance, ELI offers a compiler restricted to flat array programs.
By replacing each APL character with one or two [[ASCII]] characters, ELI retains APL’s succinct and expressive way of doing array programming, i.e. compared with [[MATLAB]] or [[Python_(programming_language) | Python]], ELI encourages a dataflow style of [[Dataflow_programming | programming]] where the output of one operation feeds the input of another that results in greater productivity and clarity of code.
ELI is free and available on Windows, Linux and Mac OS.
== Example Code ==
A line of ELI executes from right to left as a chain of operations; anything to the right of ‘//’ is a comment.
<pre>
!10
1 2 3 4 5 6 7 8 9 10
</pre>
Exclamation point (!) is an '''interval''' function. It can generate a vector of n integer from 1 to n.
<pre>
5 * 2 + 10 // from right to left, 5 * (2 + 10)
60
</pre>
The execution order of ELI is from right to left and all primitive functions have '''equal precedence'''.
<pre>
{add: x+y} // short function form
add
1 add 2 // 1+2
3
1 add !10 // 1+(1..10)
2 3 4 5 6 7 8 9 10 11
</pre>
First, a function <code>add</code> is declared in a short function form. Then, the arguments of the function can take either a scalar or a vector.
<pre>
$!10 // rotation
10 9 8 7 6 5 4 3 2 1
</pre>
The rotation operator returns the reverse order of a vector.
<pre>
2 3#!6 // 2 dimension array (matrix)
1 2 3
4 5 6
</pre>
A 2-by-3 matrix (or higher dimension array, e.g. <code>2 3 4#!24</code>) can be generated by <code>#</code> with left argument <code>2 3</code>.
<pre>
x <- !20 // 1..20
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
(1 = 2|x) / x // get odd numbers from x
1 3 5 7 9 11 13 15 17 19
</pre>
The <code>x</code> is assigned with a vector from 1 to 20. <code>1 = 2|x</code> returns odd number <code>True</code> and even number <code>False</code>. The <code>/</code> is a primitive function for reduction that can '''pick up''' the value in <code>x</code> based on the <code>True</code> value in its left argument.
==References==
|