Uiua: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 65: Line 65:
| <code>∞</code> || Infinity || The biggest number
| <code>∞</code> || Infinity || The biggest number
|}
|}
 
==== Monadic Pervasive ====
Operate on every element in an array
{| class="wikitable" style="margin:auto"
|+ Table of Monadic Pervasive in Uiua
! Glyph !! Name !! Definition
|-
| <code>¬</code> || Not || Logical not
|-
| <code>±</code> || Sign || Numerical sign (1, ¯1, or 0)
|-
|}
== External links ==
== External links ==
* [https://concatenative.org/wiki/view/Uiua Uiua] on the concatenative language wiki
* [https://concatenative.org/wiki/view/Uiua Uiua] on the concatenative language wiki


{{APL dialects}}[[Category:Flat array languages]][[Category:Stack-based languages]][[Category:Leading axis languages]][[Category:Languages with tacit programming]][[Category:IR compilers]]
{{APL dialects}}[[Category:Flat array languages]][[Category:Stack-based languages]][[Category:Leading axis languages]][[Category:Languages with tacit programming]][[Category:IR compilers]]

Revision as of 04:45, 27 January 2024


Uiua is a stack-based array language designed by Kai Schmidt using glyphs inspired mainly by BQN.

Overview

Uiua uses concatenative evaluation (a context-free grammar) with a right-to-left ordering as in Polish notation. The language supports tacit programming using stack manipulation primitives, and all complex functions must be defined this way as there is no explicit function form that allows local variables. Functions have a fixed number of input and output values, meaning the overloading of ambivalent functions is removed. Because of this, Uiua often splits APL primitives into two functions. Its primitives use Unicode glyphs including many not found in other languages. To avoid the need for a keyboard layout containing these, each primitive can also be spelled using a name that consists of lowercase letters (user-defined names must have at least one uppercase letter). By default, the language formats source files when run to convert these names into the corresponding glyphs.

Like the SHARP APL family, arrays are flat with a homogeneous type; however, functions in Uiua are first-class values, and instead of boxes, niladic constant-valued functions are used to provide array nesting.

Uiua was featured on Array Cast in 2023.

Primitives

Function

Stack

Work with the stack

Table of Stack function in Uiua
Glyph Name Type Definition
. Duplicate Monadic 2-output function Duplicate the top value on the stack
, Over Dyadic 3-output function Duplicate the second-to-top value to the top of the stack
: Flip Dyadic 2-output function Swap the top two values on the stack
◌(;) Pop Monadic 0-output function Discard the top stack value
? Stack Noadic 0-output function Debug print all stack values without popping them
Trace Monadic function Debug print the top value on the stack without popping it

Constants

Push a constant value onto the stack

Table of Constants in Uiua
Glyph Name Definition
η Eta The number of radians in a quarter circle
π Pi The ratio of a circle's circumference to its diameter
τ Tau The ratio of a circle's circumference to its radius
Infinity The biggest number

Monadic Pervasive

Operate on every element in an array

Table of Monadic Pervasive in Uiua
Glyph Name Definition
¬ Not Logical not
± Sign Numerical sign (1, ¯1, or 0)

External links

  • Uiua on the concatenative language wiki


APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000Pometo
Historical A Programming LanguageA+ (A) ∙ APL#APL2CAPL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXExtended Dyalog APLIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyK (Goal, Klong, Q) ∙ KamilaLispLang5LilNialRADUiua
Overviews Comparison of APL dialectsTimeline of array languagesTimeline of influential array languagesFamily tree of array languages