3,056
edits
m (→Monadic Array) |
(Various updates, and more description of overall primitive design) |
||
Line 1: | Line 1: | ||
{{Infobox array language | {{Infobox array language | ||
| logo = [[File:Uiua logo.png]] | | logo = [[File:Uiua logo.png]] | ||
| array model = [[flat array model|flat]] with | | array model = [[flat array model|flat]] with [[boxes]] | ||
| index origin = 0 | | index origin = 0 | ||
| function styles = stack-based [[tacit]] | | function styles = stack-based [[tacit]] | ||
Line 8: | Line 8: | ||
| released = 2023 | | released = 2023 | ||
| developer = Kai Schmidt | | developer = Kai Schmidt | ||
| latest release version = 2024 | | latest release version = 0.8.0 / 2024 | ||
| implementation languages = [[wikipedia:Rust (programming language)|Rust]] | | implementation languages = [[wikipedia:Rust (programming language)|Rust]] | ||
| source = [https://github.com/uiua-lang/uiua GitHub] | | source = [https://github.com/uiua-lang/uiua GitHub] | ||
Line 16: | Line 16: | ||
| file ext = .ua | | file ext = .ua | ||
| documentation = [https://www.uiua.org/docs Documentation] | | documentation = [https://www.uiua.org/docs Documentation] | ||
| influenced by = [[wikipedia:Forth (programming language)|Forth]], [[BQN]] | | influenced by = [[wikipedia:Forth (programming language)|Forth]], [[BQN]], [[J]] | ||
| run online = [https://www.uiua.org/pad Pad] | | run online = [https://www.uiua.org/pad Pad] | ||
}} | }} | ||
'''Uiua''' is a stack-based array language designed by Kai Schmidt | '''Uiua''' is a stack-based array language emphasizing [[tacit]] programming, designed by Kai Schmidt. Initially influenced strongly by [[BQN]], Uiua has added original stack-based features and [[glyphs]] and moved to the [[Array model#boxes|boxed array model]] of [[SHARP APL]] and [[J]]. It also makes functions second-class rather than first-class to facilitate features that depend on the number of arguments functions take. | ||
== Overview == | == Overview == | ||
Uiua uses concatenative evaluation (a [[wikipedia:context-free grammar|context-free grammar]]) with a right-to-left ordering as in [[wikipedia:Polish notation|Polish notation]]. The language supports [[tacit programming]] using stack manipulation [[primitive]]s, and all complex functions must be defined this way as there is no explicit function form that allows local variables. [[Function]]s have a fixed number of input and output values, meaning the overloading of [[ambivalent function]]s 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 [[Typing glyphs|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. | Uiua uses concatenative evaluation (a [[wikipedia:context-free grammar|context-free grammar]]) with a right-to-left ordering as in [[wikipedia:Polish notation|Polish notation]]. The language supports [[tacit programming]] using stack manipulation [[primitive]]s, and all complex functions must be defined this way as there is no explicit function form that allows local variables. [[Function]]s have a fixed number of input and output values, meaning the overloading of [[ambivalent function]]s 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 [[Typing glyphs|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, [[Array_model#Flat_array_theory|arrays | Like the [[SHARP APL]] family, Uiua supports only [[Array_model#Flat_array_theory|flat arrays]] with a homogeneous [[type]], and has a dedicated [[box]] type for [[Nested array|array nesting]]. However, arithmetic is [[pervasion|pervasive]] as in the nested array model. Arithmetic also follows [[leading axis agreement]], extended so that a length-1 axis is matched with an axis of any length by replicating along it (like the broadcasting system of [[wikipedia:Julia (programming language)|Julia]] and [[wikipedia:NumPy|NumPy]]). It supports character arithmetic as in [[BQN]], as well as other primitives characteristic of BQN such as [[structural Under]], [[Classify]], and a [[Transpose]] that rotates the axes of its argument by one. | ||
== Primitives == | == Primitives == | ||
=== Function === | === Function === | ||
In the web version of Uiua, we can type in the name of the function or a part of it and when run, the interpreter will format the name to Unicode Symbol, so that we don't need use of non-ASCII keyboards. | In the web version of Uiua, we can type in the name of the function or a part of it and when run, the interpreter will format the name to Unicode Symbol, so that we don't need use of non-ASCII keyboards. | ||
All table below are | |||
All table below are based on Uiua version 0.8.0. | |||
==== Stack ==== | ==== Stack ==== | ||
Work with the stack | Work with the stack | ||
Line 211: | Line 211: | ||
== 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 | ||
* [https://www.arraycast.com/episodes/episode63-uiua Uiua, a Stack based Array language] on the [[Array Cast]] | |||
* [https://www.uiua.org/docs Doc] for the Documentation | * [https://www.uiua.org/docs Doc] for the Documentation | ||
* [https://www.uiua.org Interpreter] for the interpreter | * [https://www.uiua.org Interpreter] for the interpreter |