Uiua: Difference between revisions
m (Text replacement - "Category:Array languages" to "") |
mNo edit summary |
||
Line 28: | Line 28: | ||
Uiua was [[Array Cast#uiua|featured on Array Cast]] in 2023. | Uiua was [[Array Cast#uiua|featured on Array Cast]] in 2023. | ||
== Primitives == | |||
=== Function === | |||
==== Stack ==== | |||
Work with the stack | |||
{| class="wikitable" style="margin:auto" | |||
|+ Caption text | |||
|- | |||
! Glyph !! Name !! Type !! Definition | |||
|- | |||
| <code>.</code> || Duplicate || Monadic 2-output function || Duplicate the top value on the stack | |||
|- | |||
| <code>,</code> || Over || Dyadic 3-output function || Duplicate the second-to-top value to the top of the stack | |||
|- | |||
| <code>:</code> || Flip || Dyadic 2-output function || Swap the top two values on the stack | |||
|- | |||
| <code>◌(;)</code> || Pop ||Monadic 0-output function || Discard the top stack value | |||
|- | |||
| <code>?</code> || Stack || Noadic 0-output function || Debug print all stack values without popping them | |||
|- | |||
| <code>⸮</code> || Trace || Monadic function || Debug print the top value on the stack without popping it | |||
|- | |||
|} | |||
== External links == | == External links == |
Revision as of 04:28, 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
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 |
External links
- Uiua on the concatenative language wiki
APL dialects [edit] | |
---|---|
Maintained | APL+Win ∙ APL2 ∙ APL64 ∙ APL\iv ∙ Aplette ∙ April ∙ Co-dfns ∙ Dyalog APL ∙ Dyalog APL Vision ∙ dzaima/APL ∙ GNU APL ∙ Kap ∙ NARS2000 ∙ Pometo ∙ TinyAPL |
Historical | A Programming Language ∙ A+ (A) ∙ APL# ∙ APL2C ∙ APL\360 ∙ APL/700 ∙ APL\1130 ∙ APL\3000 ∙ APL.68000 ∙ APL*PLUS ∙ APL.jl ∙ APL.SV ∙ APLX ∙ Extended Dyalog APL ∙ Iverson notation ∙ IVSYS/7090 ∙ NARS ∙ ngn/apl ∙ openAPL ∙ Operators and Functions ∙ PAT ∙ Rowan ∙ SAX ∙ SHARP APL ∙ Rationalized APL ∙ VisualAPL (APLNext) ∙ VS APL ∙ York APL |
Derivatives | AHPL ∙ BQN ∙ CoSy ∙ ELI ∙ Glee ∙ I ∙ Ivy ∙ J ∙ Jelly ∙ K (Goal, Klong, Q) ∙ KamilaLisp ∙ Lang5 ∙ Lil ∙ Nial ∙ RAD ∙ Uiua |
Overviews | Comparison of APL dialects ∙ Timeline of array languages ∙ Timeline of influential array languages ∙ Family tree of array languages |