ELI (programming language): Difference between revisions

Content deleted Content added
No edit summary
m File extensions: <syntaxhighlight lang="q">
 
(17 intermediate revisions by 10 users not shown)
Line 1:
{{multipleMultiple issues|
{{COI|date=April 2017}}
{{notabilityNotability|date=April 2017}}
{{primaryPrimary sources|date=April 2017}}
}}
{{Infobox programming language
Line 8:
[http://archive.vector.org.uk/art10501180 ELI: a simple system for array programming]</ref>
|logo =
|paradigm = [[arrayArray programming|array]]
|year = 2011
|designer = Wai-Mee Ching
|developer = Hanfeng Chen<ref name="mirror">[http://www.sable.mcgill.ca/~hanfeng.c/eli/ ELI - mirror site in the Sable lab at McGill University]</ref> (Rapidsoft)
|released = {{Start date and age|2011}}
|latest release version = 0.3
|latest release date = August{{Start 10,date and age|2015|08|10}}
|typing = [[dynamic typing|dynamic]]
|implementationsprogramming language = [[C++]], [[Qt (software)|Qt]]
|operating_systemplatform = [[CrossIA-platform32]], [[x86-64]]
|operating system = [[Cross-platform]]: [[Windows]], [[Linux]], [[macOS]]
|file_ext = .esf .eli
|license = [[Freeware]]
|file_extfile ext = .esf .eli
|website = {{URL|fastarray.appspot.com}}
|implementations =
|dialects =
|influenced_byinfluenced by = [[APL (programming language)|APL]], [[Q (programming language from Kx Systems)|Q]]
}}
 
'''ELI'''<ref name="website">[http{{cite web |url=https://fastarray.appspot.com/ |title=ELI: -A officialSystem site]for HostedProgramming onwith GoogleArrays App Engine|website=Disqus}}</ref> is an interactive [[Array_programming | array programming language]] language system based on the [[programming language]] [[APL (programming language) | APL]]. It has the most of functionalitiesthe functions of ISOthe APL[[International standard.Organization Infor additionStandardization]] to classical(ISO) APL standard ''ISO/IEC 13751:2001'', ELIand featuresalso list for non-homogeneous or non-rectangular data, complex numbers, symbols, temporal data, and control structures. A scripting file facility helpsis a useravailable to easily organize programs in a fashion similar to using <code>#include</code> in [[C (programming language)|C]], which also provides convenient data [[input/output]]. Moreover, ELI has dictionaries, tables, and a basic set of [[SQL | SQL]]-like statements]]. For performance, ELIit offershas a [[compiler]] restricted to flat array programs.
 
By replacing each [[APL syntax and symbols|APL character]] with one or two [[ASCII]] characters, ELI retains APL’sAPL's succinct and expressive way of doing array programming, i.e. compared with [[MATLAB]] or [[Python_Python (programming_language)programming language)| Python]], ELI encourages a dataflow style of [[Dataflow_programming |dataflow programming]] style, where the output of one operation feeds the input of another that results in greater productivity and clarity of code.
 
ELI is freeavailable andwithout availablecharge, as [[freeware]], on [[Windows]], [[Linux]], and Mac OS[[macOS]].
 
==Version 0.3==
ELI version 0.3, hasdescribed as a stable release, beenwas released on August 10, 2015. It integrates with a cross-platform IDE, ELI Studio., The ELI Studiowhich provides a code editor with specialized functionalitiesfunctions to easily write/ and load ELI code. Three Moreover, three additionaladded 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>
[http://fastarray.appspot.com/releasenote/Eli-v0.3.html '''New features:''']
* Like: string match
* Match
Line 39 ⟶ 42:
* []: standard input
* Date and time attributes
* File Handlehandle: []open, []close, []write, and []get
* Semi ColonSemicolon (;)
 
==Example Codecode==
'''New medias:'''
* [http://fastarray.appspot.com/docs/index.html Online documentation]
* [https://www.youtube.com/channel/UCpq4XRc7A1YNbEnBRx9-jzw YouTube channel]
 
==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.
<sourcesyntaxhighlight lang="text">
!10
1 2 3 4 5 6 7 8 9 10
</syntaxhighlight>
</source>
The execution order of ELI is from right to left, and all primitive functions have '''equal precedence'''.
<sourcesyntaxhighlight lang="textq">
5 * 2 + 10 // from right to left, 5 * (2 + 10)
60
</syntaxhighlight>
</source>
In the next example a function <code>add</code> is declared in a short function form. Then, theThe arguments of the function can takebe either a scalar or a vector.
<sourcesyntaxhighlight lang="textq">
{add: x+y} // short function form
add
Line 67 ⟶ 66:
1 add !10 // 1+(1..10)
2 3 4 5 6 7 8 9 10 11
</syntaxhighlight>
</source>
The <code>$</code> rotation operator returns the reverse order of a vector.
<sourcesyntaxhighlight lang="textq">
$!10 // reverse
10 9 8 7 6 5 4 3 2 1
</syntaxhighlight>
</source>
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>.
<sourcesyntaxhighlight lang="textq">
2 3#!6 // 2 dimension array (matrix)
1 2 3
4 5 6
</syntaxhighlight>
</source>
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.
<sourcesyntaxhighlight lang="textq">
x <- !20 // 1..20
x
Line 86 ⟶ 85:
(1 = 2|x) / x // get odd numbers from x
1 3 5 7 9 11 13 15 17 19
</syntaxhighlight>
</source>
 
==File extensions==
 
ThereTwo file extensions are twoused kindsin ofELI filefor extensionsexchanging inand sharing ELIcode for different purposes: <code>.esf</code> and <code>.eli</code>. Both are designed for exchanging and sharing code based on different purposes.
 
An ELI file ends with extension <code>.esf</code> is an ELIa 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 withoutwith anyno debugging/ or error information left is requiredneeded before you can output a script file can be created. Later, the command <code>)fload</code> iscan ablebe used to loadreload the script file back.
 
<sourcesyntaxhighlight lang="text">
)out MyScript
)lib
Line 100 ⟶ 99:
)fload MyScript
saved 2017.02.17 10:23:55 (gmt-5)
</syntaxhighlight>
</source>
 
An ELI file ends with extension <code>.eli</code> is an ELI workspace file which contains everything in a workspace. <code>save</code> and <code>load</code> are two commands designed for workspace files.
 
<sourcesyntaxhighlight lang="textq">
)save MyWorkspace
)load MyWorkspace
saved 2017.02.17 10:57:19 (gmt-5)
</syntaxhighlight>
</source>
 
==Development notes==
 
* (Dec. 2016) ELI began to actively maintain its online language reference manual which can be found at [http://fastarray.appspot.com/docs/EliReference.html fastarray/docs]
* (Dec. 2016) The latest ELI primer was released
 
==See also==
* [[APL (programming language)|APL]], the first array programming language
* [[J (programming language)|J]], another APL-inspired language
* [[Q (programming language from Kx Systems)|Q]], programming language from Kx Systems
 
==References==
{{Reflist}}
 
==External links==
* {{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]]