Content deleted Content added
No edit summary |
m →File extensions: <syntaxhighlight lang="q"> |
||
(43 intermediate revisions by 21 users not shown) | |||
Line 1:
{{Multiple issues|
{{COI|date=April 2017}}
{{Notability|date=April 2017}}
{{Primary sources|date=April 2017}}
}}
{{Infobox programming language
|name = ELI<ref name="vector">
[http://archive.vector.org.uk/art10501180 ELI: a simple system for array programming]</ref>
|logo =
|paradigm = [[
|designer = Wai-Mee Ching
|developer =
|released = {{Start date and age|2011}}
|latest release
|latest release date = {{Start date and age|2015|08|10}}
|typing = [[dynamic typing|dynamic]]
|programming language = [[C++]], [[Qt (software)|Qt]]
|platform = [[IA-32]], [[x86-64]]
|operating system = [[Cross-platform]]: [[Windows]], [[Linux]], [[macOS]]
|license = [[Freeware]]
|file ext = .esf .eli
|website = {{URL|fastarray.appspot.com}}
|implementations =
|dialects =
|influenced by = [[APL (programming language)|APL]], [[Q (programming language from Kx Systems)|Q]]
}}
'''ELI'''<ref name="website">{{cite web |url=https://fastarray.appspot.com/ |title=ELI: A System for Programming with Arrays |website=Disqus}}</ref> is an interactive [[array programming]] language system based on the [[programming language]] [[APL (programming language)|APL]]. It has
By replacing each [[APL syntax and symbols|APL character]] with one or two [[ASCII]] characters, ELI retains
ELI is
==
ELI version 0.3, described as a stable release, was released on August 10, 2015. It integrates with a cross-platform IDE, ELI Studio, which provides a code editor with specialized functions to write and load ELI code. Three added widgets are used to monitor functions, variables, libraries and command history.
Version 0.3 adds several new features.<ref>{{cite web |url=https://fastarray.appspot.com/releasenote/Eli-v0.3.html |title=Overview |last=Chen |first=Hanfeng |date=2015 |website=ELI, a System for Programming with Arrays |publisher=Fastarray.appspot.com |access-date=26 February 2018}}</ref>
* Like: string match
* Match
* []PP: printing precision control
* )time: performance measure
* []: standard input
* Date and time attributes
* File handle: []open, []close, []write, and []get
* Semicolon (;)
==Example code==
A line of ELI executes from right to left as a chain of operations; anything to the right of ‘//’ is a comment.
Exclamation point (!) is an interval function. It can generate a vector of n integer from 1 to n.
<syntaxhighlight lang="text">
!10
1 2 3 4 5 6 7 8 9 10
</syntaxhighlight>
The execution order of ELI is from right to left, and all primitive functions have equal precedence.
<syntaxhighlight lang="q">
5 * 2 + 10 // from right to left, 5 * (2 + 10)
60
</syntaxhighlight>
In the next example a function <code>add</code> is declared in a short function form. The arguments of the function can be either a scalar or a vector.
<syntaxhighlight lang="q">
{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
</syntaxhighlight>
The <code>$</code> rotation operator returns the reverse order of a vector.
<syntaxhighlight lang="q">
10 9 8 7
</syntaxhighlight>
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>.
<syntaxhighlight lang="q">
2 3#!6 // 2 dimension array (matrix)
1 2 3
4 5 6
</syntaxhighlight>
In first line below the <code>x</code> is assigned with a vector from 1 to 20. Then, <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 compression which '''picks up''' the value in <code>x</code> corresponding to the <code>True</code> values in its left argument.
<syntaxhighlight lang="q">
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
</syntaxhighlight>
==File extensions==
Two file extensions are used in ELI for exchanging and sharing code for different purposes: <code>.esf</code> and <code>.eli</code>.
An ELI file with extension <code>.esf</code> is a script file which contains all methods and data. A simple way to create a script file is using the command <code>)out</code>. However, a clean workspace with no debugging or error information left is needed before a script file can be created. Later the command <code>)fload</code> can be used to reload the script file.
<syntaxhighlight lang="text">
)out MyScript
)lib
MyScript.esf
)fload MyScript
saved 2017.02.17 10:23:55 (gmt-5)
</syntaxhighlight>
An ELI file with extension <code>.eli</code> is an ELI workspace file which contains everything in a workspace. <code>save</code> and <code>load</code> are commands for workspace files.
<syntaxhighlight lang="q">
)save MyWorkspace
)load MyWorkspace
saved 2017.02.17 10:57:19 (gmt-5)
</syntaxhighlight>
==References==
{{
==
* {{Official website|fastarray.appspot.com}}
* [https://fastarray.appspot.com/docs/ Online documentation]{{Dead link|date=December 2019 |bot=InternetArchiveBot |fix-attempted=yes}}
* [https://www.youtube.com/channel/UCpq4XRc7A1YNbEnBRx9-jzw YouTube channel]
{{APL programming language}}
[[Category:APL programming language family]]
[[Category:Array programming languages]]
|