Cuneiform (programming language): Difference between revisions

Content deleted Content added
Canimayi (talk | contribs)
Link suggestions feature: 3 links added.
 
(19 intermediate revisions by 13 users not shown)
Line 1:
{{Short Infoboxdescription|Open-source programmingworkflow language}}
{{Infobox programming language
| name = Cuneiform
| logo = G18225.png
Line 12 ⟶ 13:
| latest preview version =
| latest preview date =
| typing = [[Static typing|static]], simple types
| implementations =
| dialects =
| influenced_by = [[Swift (parallel scripting language)|Swift]]
| influenced =
| operating system = [[Linux]], [[Mac OSMacOS]]
| programming language = [[Erlang (programming language)|Erlang]]
| license = [[Apache License]] 2.0
| website = {{URL|httpshttp://cuneiform-lang.org/}}
| file_ext = .cfl
| year = 2013
Line 26 ⟶ 27:
 
'''Cuneiform''' is an [[open source software|open-source]] [[Scientific workflow system|workflow language]]
for large-scale scientific data analysis.<ref>{{Cite web|url=https://github.com/joergen7/cuneiform|title = Joergen7/Cuneiform|website = [[GitHub]]|date = 14 October 2021}}</ref><ref>{{Cite journal
| last1 = Brandt | first1 = Jörgen
| last2 = Bux | first2 = Marc N.
Line 113 ⟶ 114:
| pages = 42–50
| year = 2010
| doi = 10.1016/j.ecoinf.2009.08.008 | s2cid = 16392118 | url = https://escholarship.org/content/qt2q46n1tp/qt2q46n1tp.pdf?t=nivnuu
}}
</ref>
Line 138 ⟶ 139:
 
Currently supported foreign programming languages are:
{{div col}}
* [[Bash (Unix shell)|Bash]]
* [[Elixir (programming language)|Elixir]]
Line 149 ⟶ 151:
* [[R (programming language)|R]]
* [[Racket (programming language)|Racket]]
{{div col end}}
 
Foreign language support for [[AWK]] and [[gnuplot]] are planned additions.
 
==Type Systemsystem==
 
Cuneiform provides a simple, statically checked type system.<ref>
Line 160 ⟶ 162:
| last2 = Reisig | first2 = Wolfgang
| last3 = Leser | first3 = Ulf
| journal = [[Journal of Functional Programming]]
| volume = 27
| year = 2017
| doi = 10.1017/S0956796817000119 | s2cid = 6128299 }}
</ref> While Cuneiform provides lists as [[compound data type]]s it omits traditional list accessors (head and tail) to avoid the possibility of runtime errors which might arise when accessing the empty list. Instead lists are accessed in an all-or-nothing fashion by only mapping or folding over them. Additionally, Cuneiform omits (at the organizational level) arithmetics which excludes the possibility of division by zero. The omission of any partially defined operation allows to guarantee that runtime errors can arise exclusively in foreign code.
 
Line 230 ⟶ 232:
For example, the following Cuneiform program allows the applications of <code>f</code> and <code>g</code> to run in parallel while <code>h</code> is dependent and can be started only when both <code>f</code> and <code>g</code> are finished.
 
<{{pre>|1=
let output-of-f : File = f();
let output-of-g : File = g();
 
h( f = output-of-f, g = output-of-g );
}}
</pre>
 
The following Cuneiform program creates three parallel applications of the function <code>f</code> by mapping <code>f</code> over a three-element list:
 
<{{pre>|1=
let xs : [File] =
['a.txt', 'b.txt', 'c.txt' : File];
Line 247 ⟶ 249:
: File
end;
}}
</pre>
 
Similarly, the applications of <code>f</code> and <code>g</code> are independent in the construction of the record <code>r</code> and can, thus, be run in parallel:
 
{{sxhl|lang=erlang|1=
<pre>
let r : <a : File, b : File> =
<nowiki><a = f(), b = g()></nowiki>;
}}
</pre>
 
==Examples==
Line 319 ⟶ 321:
===Version 1===
 
In its first draft published in May 2014, Cuneiform was closely related to [[Make (software)|Make]] in that it constructed a static [[data dependency]] graph which the interpreter traversed during execution. The major difference to later versions was the lack of conditionals, recursion, or static type checking. Files were distinguished from strings by juxtaposing single-quoted string values with a tilde <code>~</code>. The script's query expression was introduced with the <code>target</code> keyword. Bash was the default foreign language. [[Function application]] had to be performed using an <code>apply</code> form that took <code>task</code> as its first keyword argument. One year later, this surface syntax was replaced by a streamlined but similar version.
 
The following example script downloads a reference genome from an FTP server.
Line 371 ⟶ 373:
===Version 3===
 
The current version of Cuneiform's surface syntax, in comparison to earlier drafts, is an attempt to close the gap to mainstream functional programming languages. It features a simple, statically checked typesystemtype system and introduces records in addition to lists as a second type of compound [[data structure]]. Booleans are a separate base data type.
 
The following script untars a file resulting in a file list.