Content deleted Content added
Jerryobject (talk | contribs) WP:LINKs: adds, WP:RED fix. WP:BADEMPHASIS quote marks > code tags. Small WP:EoS WP:COPYEDITs. Full term define before WP:ABBReviation. |
Jerryobject (talk | contribs) Template:Infobox software add, parameters fill. Add: WP:LINKs, Template:Official website. WP:EoS WP:COPYEDITs. WP:BADEMPHASIS MOS:BOLDs > WP:ITALICs. WP:TITLE MOS:HEAD word repeat cut. MOS:NDASH string > symbol. |
||
Line 1:
{{Infobox programming language
| name = Unlambda
| logo = <!-- (filename only) -->
| logo caption =
| screenshot = <!-- (filename only) -->
| screenshot caption =
| paradigm = Nearly [[Purely functional programming|pure]] [[Functional programming|functional]]
| family =
| designer = David Madore
| developer = David Madore
| released = {{Start date and age|1999|06|28|df=yes}}
| latest release version = 2.0.0
| latest release date = {{Start date and age|1999|12|20|df=yes}}
| latest preview version =
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes}} -->
| typing = [[Type system|Untyped]]
| scope =
| programming language = [[Scheme (programming language)|Scheme]], [[C (programming language)|C]], [[Java (programming language)|Java]]
| discontinued =
| platform =
| operating system =
| license = [[GNU General Public License|GPL]] 2.0 or later
| file ext =
| file format = <!-- or: | file formats = -->
| website = {{URL|www.madore.org/~david/programs/unlambda}}
| implementations =
| dialects =
| influenced by =
| influenced =
}}
'''Unlambda''' is a minimal, "nearly [[Purely functional language|pure]]"<ref name="chu2006">{{cite web|work=Good Math, Bad Math ''(blog)''|first=Mark C.|last=Chu-Carroll|date=2006-08-11|title=Friday Pathological Programming: Unlambda, or Programming Without Variables|url=http://scienceblogs.com/goodmath/2006/08/11/friday-pathological-programmin-3/|publisher=ScienceBlogs}}</ref> [[functional programming language]] invented by David Madore. It is based on [[combinatory logic]], a version of the [[lambda calculus]] that omits the lambda operator. It relies mainly on two built-in functions (''s'' and ''k'') and an <code>apply</code> operator (written ''`'', the [[backquote]] character). These alone make it [[Turing-complete]], but there are also some [[input/output]] (I/O) functions to enable interacting with the user, some shortcut functions, and a [[lazy evaluation]] function. Variables are unsupported.
Unlambda is [[free and open-source software]] distributed under a [[GNU General Public License]] (GPL) 2.0 or later.
==Basic principles==
As an [[esoteric programming language]], Unlambda is meant as a demonstration of very pure functional programming rather than for practical use. Its main feature is the lack of conventional operators and data types—the only kind of data in the program are one-parameter functions. Data can nevertheless be simulated with appropriate functions as in the [[lambda calculus]]. Multi-parameter functions can be represented
Unlambda is based
`r```````````.H.e.l.l.o. .w.o.r.l.di
Line 15 ⟶ 47:
Other important features provided by Unlambda include the <code>k</code> and <code>s</code> functions. <code>k</code> manufactures constant functions: the result of <code>`k''x''</code> is a function which, when invoked, returns ''x''. Thus the value of <code>``k''xy''</code> is ''x'' for any ''x'' and ''y''.
<code>s</code> is a generalized evaluation operator. <code>```s''xyz''</code> evaluates to <code>``''xz''`''yz''</code> for any ''x'', ''y'', and ''z''. It is a remarkable fact that <code>s</code> and <code>k</code> are sufficient to perform any calculation, as described in [[SKI combinator calculus]]. As a brief example,
Unlambda's one flow control
Unlambda's next built-in operator is <code>v</code>, which ignores its argument and returns <code>v</code>. This feature is not strictly necessary, since <code>v</code> could be implemented as <code>``s`k``s``s`kskk`k``s``s`kskk</code>, but it is supplied as a convenience. (This expression above is simply <code>`Yk</code>, where <code>Y</code> denotes a [[fixed point combinator]].)
==
There is also a "reprint" operator <code>|</code>. When <code>`|''x''</code> is evaluated, the function ''x'' is applied to <code>.''u''</code> if ''u'' is the current character, or to <code>v</code> if there is no current character.
Line 31 ⟶ 63:
==See also==
*[[Iota and Jot]]
*[[SKI combinator calculus]]
==References==
{{
* Felix-Hernandez Campos (1 April 2002), ''[http://www.cs.unc.edu/~stotts/144/lectures/lect28apr.pdf Lecture 28: More on functional programming]'', University of North Carolina COMP144
* {{cite book |url=https://books.google.com/books?id=LlR6__OpAxoC&pg=PA205&dq=Unlambda&cd=2#v=onepage&q=%22Unlambda%22&f=false |title=Rubyで作る奇妙なプログラミング言語 |language=Japanese |author=原 悠 (Yutaka Hara)|page=
==External links==
*
*[http://repl.it/#:languages Online Unlambda REPL]
|