2
edits
m (Remove unnecessary comment) |
Joaozin003 (talk | contribs) (General improvements) |
||
Line 8: | Line 8: | ||
| released = 2023 | | released = 2023 | ||
| developer = Kai Schmidt | | developer = Kai Schmidt | ||
| latest release version = 0. | | latest release version = 0.11.1 / 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 28: | Line 28: | ||
== Primitives == | == Primitives == | ||
=== | === Functions with unique glyphs === | ||
In | In Uiua, we can type in the name of the function or a part of it and when formatted, it will format the name to its corresponding Unicode Symbol, so that we don't have to use non-ASCII keyboards (or Alt-codes). | ||
The tables below are based on Uiua version 0.12.0, with since-removed primitives taken out. | The tables below are based on Uiua version 0.12.0, with since-removed primitives taken out. | ||
Line 36: | Line 36: | ||
Work with the stack | Work with the stack | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of Stack | |+ Table of Stack functions in Uiua | ||
|- | |- | ||
! Glyph !! Name !! Type !! Definition | ! Glyph !! Name !! Type !! Definition | ||
Line 46: | Line 46: | ||
| <code>:</code> || Flip || Dyadic 2-output function || Swap the top two values on the stack | | <code>:</code> || Flip || Dyadic 2-output function || Swap the top two values on the stack | ||
|- | |- | ||
| <code>◌ | | <code>◌</code> || Pop || Monadic 0-output function || Discard the top stack value | ||
|- | |||
| <code>⟜</code> || On || Monadic modifier || Call a function but keep its top argument on top of the stack | |||
|- | |||
| <code>⤙</code> || But || Monadic modifier || Call a function but keep its last argument on top of the stack | |||
|- | |||
| <code>⤚</code> || With || Monadic modifier || Call a function but keep its top argument below the outputs on the stack | |||
|- | |||
| <code>⊸</code> || By || Monadic modifier || Duplicate a function's last argument before calling it | |||
|- | |||
| <code>¨</code> || Backward || Monadic modifier || Call a function with its arguments reversed | |||
|- | |- | ||
| <code>?</code> || Stack || Noadic 0-output function || Debug print all stack values without popping them | | <code>?</code> || Stack || Noadic 0-output function || Debug print all stack values without popping them | ||
Line 71: | Line 81: | ||
Operate on every element in an array | Operate on every element in an array | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of Monadic Pervasive in Uiua | |+ Table of Monadic Pervasive functions in Uiua | ||
! Glyph !! Name !! Definition | ! Glyph !! Name !! Definition | ||
|- | |- | ||
Line 84: | Line 94: | ||
| <code>√</code> || [[Square Root|Sqrt]] || Take the square root of a number | | <code>√</code> || [[Square Root|Sqrt]] || Take the square root of a number | ||
|- | |- | ||
| <code> | | <code>∿</code> || Sine || Get the sine of a number | ||
|- | |- | ||
| <code>⌊</code> || [[Floor]] || Round to the nearest integer towards <code>¯∞</code> | | <code>⌊</code> || [[Floor]] || Round to the nearest integer towards <code>¯∞</code> | ||
Line 93: | Line 103: | ||
|} | |} | ||
==== Dyadic Pervasive ==== | ==== Dyadic Pervasive ==== | ||
Operate on every pair of elements in two arrays | Operate on every pair of elements in two arrays | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of | |+ Table of Dyadic Pervasive functions in Uiua | ||
! Glyph !! Name !! Definition !! Formats from: | ! Glyph !! Name !! Definition !! Formats from: | ||
|- | |- | ||
Line 135: | Line 145: | ||
Operate on a single array | Operate on a single array | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of Monadic Array in Uiua | |+ Table of Monadic Array functions in Uiua | ||
! Glyph !! Name !! Definition | ! Glyph !! Name !! Definition | ||
|- | |- | ||
Line 169: | Line 179: | ||
|- | |- | ||
| <code>□</code> || [[Box]] || Turn an array into a box | | <code>□</code> || [[Box]] || Turn an array into a box | ||
|- | |- | ||
|} | |} | ||
Line 179: | Line 185: | ||
Operate on two arrays | Operate on two arrays | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of | |+ Table of Dyadic Array functions in Uiua | ||
! Glyph !! Name !! Definition | ! Glyph !! Name !! Definition | ||
|- | |- | ||
Line 213: | Line 219: | ||
|- | |- | ||
| <code>⊗</code> || [[Index Of|Indexof]] || Find the first index of each row of one array in another | | <code>⊗</code> || [[Index Of|Indexof]] || Find the first index of each row of one array in another | ||
|- | |||
| <code>⟔</code> || Coordinate || Find the first deep index of an array in another | |||
|} | |} | ||
==== Iterating Modifiers ==== | ==== Iterating Modifiers ==== | ||
Line 221: | Line 229: | ||
|- | |- | ||
| <code>∵</code> || [[Each]] || Monadic modifier || Apply a function to each element of an array or arrays. | | <code>∵</code> || [[Each]] || Monadic modifier || Apply a function to each element of an array or arrays. | ||
|- | |- | ||
| <code>≡</code> || Rows || Monadic modifier || Apply a function to each row of an array or arrays. | | <code>≡</code> || Rows || Monadic modifier || Apply a function to each row of an array or arrays. | ||
|- | |- | ||
| <code>⊞</code> || Table || Monadic 2-argument modifier || Apply a function to each combination of rows of two arrays. | | <code>⊞</code> || [[Outer Product|Table]] || Monadic 2-argument modifier || Apply a function to each combination of rows of two arrays. | ||
|- | |- | ||
| <code>⍚</code> || Inventory || Monadic modifier || Apply a function to each unboxed row of an array and re-box the results. | | <code>⍚</code> || Inventory || Monadic modifier || Apply a function to each unboxed row of an array and re-box the results. | ||
|- | |- | ||
| <code>⍥</code> || [[Repeat]] || Monadic modifier || Repeat a function a number of times | | <code>⍥</code> || [[Repeat]] || Monadic modifier || Repeat a function a number of times | ||
Line 250: | Line 254: | ||
|- | |- | ||
| <code>⊕</code> || [[Group (BQN)|Group]] || Group elements of an array into buckets by index | | <code>⊕</code> || [[Group (BQN)|Group]] || Group elements of an array into buckets by index | ||
|- | |- | ||
| <code>⊜</code> || [[Partition]] || Group sequential sections of an array | | <code>⊜</code> || [[Partition]] || Group sequential sections of an array | ||
|- | |||
| <code>◹</code> || Triangle || Apply a function to each shrinking row of an array | |||
|} | |} | ||
Line 279: | Line 263: | ||
Work with the inverses of functions | Work with the inverses of functions | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of | |+ Table of Inversion Modifiers in Uiua | ||
! Glyph !! Name !! Type !! Definition | ! Glyph !! Name !! Type !! Definition | ||
|- | |- | ||
| <code>°</code> || [[Un]] || Monadic modifier || Invert the behavior of a function | | <code>°</code> || [[Un]] || Monadic modifier || Invert the behavior of a function | ||
|- | |- | ||
| <code>⍜</code> || [[Under]] || Dyadic modifier || Apply a function under another | | <code>⍜</code> || [[Under]] || Dyadic modifier || Apply a function under another | ||
|} | |} | ||
==== 🌎 Planet 🪐 ==== | ==== 🌎 Planet 🪐 ==== | ||
Advanced stack manipulation | Advanced stack manipulation | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of | |+ Table of Planet modifiers in Uiua | ||
! Glyph !! Name !! Type !! Definition | ! Glyph !! Name !! Type !! Definition | ||
|- | |- | ||
Line 310: | Line 283: | ||
|- | |- | ||
| <code>∩</code> || Both || Monadic 2-argument modifier || Call a function on two sets of values | | <code>∩</code> || Both || Monadic 2-argument modifier || Call a function on two sets of values | ||
|- | |- | ||
| <code>⊃</code> || [[Fork]] || Dyadic modifier || Call two functions on the same values | | <code>⊃</code> || [[Fork]] || Dyadic modifier || Call two functions on the same values | ||
|- | |- | ||
| <code>⊓</code> || Bracket || Dyadic modifier || Call two functions on two distinct sets of values | | <code>⊓</code> || Bracket || Dyadic modifier || Call two functions on two distinct sets of values | ||
|} | |} | ||
==== Other | ==== Other Modifiers ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ Table of Other Modifiers in Uiua | |+ Table of Other Modifiers in Uiua | ||
Line 326: | Line 297: | ||
|- | |- | ||
| <code>⬚</code> || Fill || Dyadic Modifier || Set the fill value for a function | | <code>⬚</code> || Fill || Dyadic Modifier || Set the fill value for a function | ||
|- | |||
<code> | | <code>⨬</code> || Switch || Dyadic modifier || Call the function at the given index | ||
|} | |} | ||
Line 334: | Line 304: | ||
* [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.arraycast.com/episodes/episode63-uiua Uiua, a Stack-based Array language] on the [[Array Cast]] | ||
* [https://www.uiua.org/docs | * [https://www.uiua.org/docs Documentation] | ||
* [https://www.uiua.org Interpreter] | * [https://www.uiua.org/pad Interpreter] | ||
* [https://www.uiua.org/ | * [https://www.uiua.org/tutorial/basic Basic tutorial] | ||
{{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]] |
edits