diff --git a/Cargo.lock b/Cargo.lock index 755c24d7e..170016667 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3948,7 +3948,7 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uiua" -version = "0.12.2" +version = "0.12.3" dependencies = [ "arboard", "bitflags 2.5.0", diff --git a/Cargo.toml b/Cargo.toml index 129032108..0252f5a6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ name = "uiua" readme = "readme.md" repository = "https://github.com/uiua-lang/uiua" rust-version = "1.78" -version = "0.12.2" +version = "0.12.3" [dependencies] # Core dependencies diff --git a/changelog.md b/changelog.md index 9c7b7b03f..25f92a8a1 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,11 @@ Uiua is not yet stable. +## 0.12.3 - 2024-08-17 +### Language +- Rename `imen`, `gifen`, and `auden` to [`img`](https://uiua.org/docs/img), [`gif`](https://uiua.org/docs/gif), and [`audio`](https://uiua.org/docs/audio) to match the naming convention of other functions + - The existing names will continue to work and will be formatted to the new names + ## 0.12.2 - 2024-08-16 ### Interpreter - Fix a bug in formatting `¯0` @@ -18,7 +23,7 @@ You can find the release announcement [here](https://uiua.org/blog/uiua-0.12.0). - **Breaking Change** - [`&runs`](https://uiua.org/docs/&runs) now returns 3 handles rather than 1 - This gives more precise control over stdin, stdout, and stderr - **Breaking Change** - [`un °`](https://uiua.org/docs/un) [`select ⊏`](https://uiua.org/docs/select) is now equivalent to [`range ⇡`](https://uiua.org/docs/range) [`length ⧻`](https://uiua.org/docs/length) [`duplicate .`](https://uiua.org/docs/duplicate) -- **Breaking Change** - [`auden`](https://uiua.org/docs/auden) now takes a sample rate argument, and [`un °`](https://uiua.org/docs/un)[`auden`](https://uiua.org/docs/auden) now returns the sample rate +- **Breaking Change** - [`auden`](https://uiua.org/docs/audio) now takes a sample rate argument, and [`un °`](https://uiua.org/docs/un)[`auden`](https://uiua.org/docs/audio) now returns the sample rate - This allows you to work with audio that is not at Uiua's default sample rate - **Breaking Change** - [`fill ⬚`](https://uiua.org/docs/fill) no longer fills the shapes of inputs to [`rows ≡`](https://uiua.org/docs/rows) - It could leader to some unexpected behavior when trying to fill the shapes of outputs @@ -29,7 +34,7 @@ You can find the release announcement [here](https://uiua.org/blog/uiua-0.12.0). - [`member ∊`](https://uiua.org/docs/member) almost always required flipping the arguments - [`memberof ∈`](https://uiua.org/docs/memberof) is the same, but with the arguments flipped - In the future, [`member ∊`](https://uiua.org/docs/member) will be removed, and [`memberof ∈`](https://uiua.org/docs/memberof)'s glyph will be changed and format to `∊` -- Rename media en/decoding system functions `&ime`, `&gife`, and `&ae` to non-system functions [`imen`](https://uiua.org/docs/imen), [`gifen`](https://uiua.org/docs/gifen), and [`auden`](https://uiua.org/docs/auden) +- Rename media en/decoding system functions `&ime`, `&gife`, and `&ae` to non-system functions [`imen`](https://uiua.org/docs/img), [`gifen`](https://uiua.org/docs/gif), and [`auden`](https://uiua.org/docs/audio) - Their implementation is not actually system-dependent - Existing `&*e` will format to the new names - The previously deprecated `&*d` decoding functions have been removed (use [`un °`](https://uiua.org/docs/un) on the encoding function) @@ -173,7 +178,7 @@ You can find the release announcement [here](https://uiua.org/blog/uiua-0.11.0). - [`&tlsc`](https://uiua.org/docs/&tlsc) replaces [`&httpsw`](https://uiua.org/docs/&httpsw), which is now deprecated - [`&tlsl`](https://uiua.org/docs/&tlsl) is currently experimental and mostly untested - [`&rs`](https://uiua.org/docs/&rs) will now attempt to read additional bytes to resolve a UTF-8 character -- [`&gife`](https://uiua.org/docs/gifen) and [`&gifs`](https://uiua.org/docs/&gifs) now support binary transparency +- [`&gife`](https://uiua.org/docs/gif) and [`&gifs`](https://uiua.org/docs/&gifs) now support binary transparency - Signatures can now be specified in stack array notation immediately after a `[` or `{` - Change how long decimal numbers are formatted - Sequences of repeated digits are now replaced with `…` @@ -376,7 +381,7 @@ You can find the release announcement [here](https://uiua.org/blog/uiua-0.10.0). - **Breaking Change** - [`reshape ↯`](https://uiua.org/docs/reshape) with a shape with negative dimensions now reverses that axis rather than acting as a "fill" value - The "fill" behavior can still be achieved by setting an axis to [`infinity ∞`](https://uiua.org/docs/infinity) - **Breaking Change** - [`&ad`](https://uiua.org/docs/&ad) and [`&imd`](https://uiua.org/docs/&imd) now return an encoding format as a string in addition to the media data - - They are also now deprecated in favor of using [`un °`](https://uiua.org/docs/un) with [`&ae`](https://uiua.org/docs/auden) or [`&ime`](https://uiua.org/docs/imen) + - They are also now deprecated in favor of using [`un °`](https://uiua.org/docs/un) with [`&ae`](https://uiua.org/docs/audio) or [`&ime`](https://uiua.org/docs/img) - Overhaul the module system - Details can be found in the updated [Modules](https://uiua.org/tutorial/modules) tutorial - Deprecate [`&i`](https://uiua.org/docs/&i), as it is no longer necessary @@ -492,7 +497,7 @@ You can find the release announcement [here](https://uiua.org/blog/uiua-0.10.0). - This introduces some non-tacitness to the language ### Interpreter - The internal byte array type is now used in more places, which should improve performance a bit -- [`&ime`](https://uiua.org/docs/imen) and [`&imd`](https://uiua.org/docs/&imd) now support the QOI image format +- [`&ime`](https://uiua.org/docs/img) and [`&imd`](https://uiua.org/docs/&imd) now support the QOI image format - Lots of bug and crash fixes ### Website - Add a new tutorial: [Thinking With Arrays](https://uiua.org/tutorial/thinkingwitharrays) @@ -834,7 +839,7 @@ You can find the release announcement [here](https://uiua.org/blog/uiua-0.10.0). ## 0.0.17 - 2023-10-07 ### Language -- Add GIF encoding with [`&gife`](https://uiua.org/docs/gifen) +- Add GIF encoding with [`&gife`](https://uiua.org/docs/gif) - Rename `constant` to [`box □`](https://uiua.org/docs/box). - Add `unbox ⊔`, which unboxes a boxed array - **Major Change:** Some uses of `call !` will no longer compile without declaring a stack signature. When unboxing [`box □`](https://uiua.org/docs/box)ed arrays, you can use `unbox ⊔` instead, which has a well-defined signature. diff --git a/examples/n-body.ua b/examples/n-body.ua index 250d6398c..07dc79e57 100644 --- a/examples/n-body.ua +++ b/examples/n-body.ua @@ -20,5 +20,5 @@ Step ← ( ⬚0≡(°⊚) # Plot ≡(⍜(☇2)≡(/↥/↥) ◫3_3) # Upscale -&fwa "n-body.gif" gifen 16 +&fwa "n-body.gif" gif 16 &p "Wrote gif to n-body.gif" diff --git a/site/primitives.json b/site/primitives.json index be6be6fd2..bba174ea1 100644 --- a/site/primitives.json +++ b/site/primitives.json @@ -354,7 +354,7 @@ "class": "DyadicPervasive", "description": "Take the arctangent of two numbers" }, - "auden": { + "audio": { "args": 3, "outputs": 1, "class": "Encoding", @@ -679,7 +679,7 @@ "class": "Map", "description": "Get the value corresponding to a key in a map array" }, - "gifen": { + "gif": { "args": 2, "outputs": 1, "class": "Encoding", @@ -721,7 +721,7 @@ "class": "Planet", "description": "Do nothing with one value" }, - "imen": { + "img": { "args": 2, "outputs": 1, "class": "Encoding", diff --git a/src/primitive/defs.rs b/src/primitive/defs.rs index 628fa62c8..85334e9d0 100644 --- a/src/primitive/defs.rs +++ b/src/primitive/defs.rs @@ -2896,22 +2896,22 @@ primitive!( /// A length 3 last axis is an RGB image. /// A length 4 last axis is an RGB image with an alpha channel. /// - /// You can decode a byte array into an image with [un][imen]. + /// You can decode a byte array into an image with [un][img]. /// /// Supported formats are `jpg`, `png`, `bmp`, `gif`, `ico`, and `qoi`. /// /// See also: [&ims] - (2, ImageEncode, Encoding, "imen"), + (2, ImageEncode, Encoding, "img"), /// Encode a gif into a byte array /// /// The first argument is a framerate in seconds. /// The second argument is the gif data and must be a rank 3 or 4 numeric array. - /// The rows of the array are the frames of the gif, and their format must conform to that of [imen]. + /// The rows of the array are the frames of the gif, and their format must conform to that of [img]. /// - /// You can decode a byte array into a gif with [un][gifen]. + /// You can decode a byte array into a gif with [un][gif]. /// /// See also: [&gifs] - (2, GifEncode, Encoding, "gifen"), + (2, GifEncode, Encoding, "gif"), /// Encode audio into a byte array /// /// The first argument is the format, the second is the audio sample rate, and the third is the audio samples. @@ -2926,16 +2926,16 @@ primitive!( /// The samples must be between -1 and 1. /// The sample rate is [&asr]. /// - /// You can decode a byte array into audio with [un][auden]. + /// You can decode a byte array into audio with [un][audio]. /// This returns the audio format as a string, the audio sample rate, and an array representing the audio samples. /// /// Currently, only the `wav` format is supported. /// /// This simple example will load an audio file, halve its sample rate, and re-encode it. - /// ex: ⍜(°auden &frab "test.wav")⊙⊓(⌊÷2|▽0.5) + /// ex: ⍜(°audio &frab "test.wav")⊙⊓(⌊÷2|▽0.5) /// /// See also: [&ap] - (3, AudioEncode, Encoding, "auden"), + (3, AudioEncode, Encoding, "audio"), ); macro_rules! impl_primitive { diff --git a/src/primitive/mod.rs b/src/primitive/mod.rs index a70229a08..a51a9937a 100644 --- a/src/primitive/mod.rs +++ b/src/primitive/mod.rs @@ -427,9 +427,9 @@ impl Primitive { "dup" => return Some(Primitive::Dup), "utf" | "utf__8" => return Some(Primitive::Utf8), "chunk" => return Some(Primitive::Chunks), - "&ime" => return Some(Primitive::ImageEncode), - "&gife" => return Some(Primitive::GifEncode), - "&ae" => return Some(Primitive::AudioEncode), + "&ime" | "imen" => return Some(Primitive::ImageEncode), + "&gife" | "gifen" => return Some(Primitive::GifEncode), + "&ae" | "auden" => return Some(Primitive::AudioEncode), _ => {} } if let Some(prim) = Primitive::non_deprecated().find(|p| p.name() == name) { diff --git a/src/sys.rs b/src/sys.rs index b66d5dda5..10410ca5a 100644 --- a/src/sys.rs +++ b/src/sys.rs @@ -372,15 +372,15 @@ sys_op! { /// A length 3 last axis is an RGB image. /// A length 4 last axis is an RGB image with an alpha channel. /// - /// See also: [imen] + /// See also: [img] (1(0), ImShow, Media, "&ims", "image - show", Mutating), /// Show a gif /// /// The first argument is a framerate in seconds. /// The second argument is the gif data and must be a rank 3 or 4 numeric array. - /// The rows of the array are the frames of the gif, and their format must conform to that of [imen]. + /// The rows of the array are the frames of the gif, and their format must conform to that of [img]. /// - /// See also: [gifen] + /// See also: [gif] (2(0), GifShow, Media, "&gifs", "gif - show", Mutating), /// Play some audio /// @@ -392,7 +392,7 @@ sys_op! { /// The samples must be between -1 and 1. /// The sample rate is [&asr]. /// - /// See also: [auden] + /// See also: [audio] (1(0), AudioPlay, Media, "&ap", "audio - play", Mutating), /// Get the sample rate of the audio output backend /// diff --git a/tests/under.ua b/tests/under.ua index ea9a750a8..00e13b8be 100644 --- a/tests/under.ua +++ b/tests/under.ua @@ -64,7 +64,7 @@ ⍤⟜≍: {6 5} [⍜∩°□:□5 □6] ⍤⟜≍: [9 9 5] ⍜⊡(⍜∩×↥,) 2 [⍥9]3 ¯1 5 ⍤⟜≍: [3 2] ⍜∩▽◌⟜: [1 0] [1 2] [3 4] -⍤⟜≍: 0 ⧻ {⍜(∩(|1 ◌ °imen &frab))∩∘ ."site/favicon.ico"} +⍤⟜≍: 0 ⧻ {⍜(∩(|1 ◌ °img &frab))∩∘ ."site/favicon.ico"} ⍤⟜≍: [.4] [⍜∩(◌setinv(⊓⌊⌈.÷2|+)): 3 5] # On