diff --git a/.gitignore b/.gitignore index 128ebf4d..1a7fe984 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ .vscode .idea /target -/docs -/site/blog/*.html site/dist /uiua-modules diff --git a/Cargo.toml b/Cargo.toml index 98e6f8d9..4914c1fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -147,3 +147,6 @@ members = ["site", "tests_ffi"] [profile.dev] incremental = true + +[profile.release] +opt-level = 's' diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 00000000..d28c08aa --- /dev/null +++ b/docs/404.html @@ -0,0 +1,43 @@ + + + + + + Uiua + + + + + + + \ No newline at end of file diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 00000000..f1fbd587 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +www.uiua.org \ No newline at end of file diff --git a/docs/DejaVuSansMono.ttf b/docs/DejaVuSansMono.ttf new file mode 100644 index 00000000..22e14bf9 Binary files /dev/null and b/docs/DejaVuSansMono.ttf differ diff --git a/docs/Uiua386.ttf b/docs/Uiua386.ttf new file mode 100644 index 00000000..7925a335 Binary files /dev/null and b/docs/Uiua386.ttf differ diff --git a/docs/assets/ooh-ee-ooh-ah.mp3 b/docs/assets/ooh-ee-ooh-ah.mp3 new file mode 100644 index 00000000..bb99dd47 Binary files /dev/null and b/docs/assets/ooh-ee-ooh-ah.mp3 differ diff --git a/docs/assets/uiua-crayon.jpg b/docs/assets/uiua-crayon.jpg new file mode 100644 index 00000000..4e6831de Binary files /dev/null and b/docs/assets/uiua-crayon.jpg differ diff --git a/docs/assets/uiua-logo-pride.png b/docs/assets/uiua-logo-pride.png new file mode 100644 index 00000000..33df89ef Binary files /dev/null and b/docs/assets/uiua-logo-pride.png differ diff --git a/docs/assets/uiua-logo-scrambledine.png b/docs/assets/uiua-logo-scrambledine.png new file mode 100644 index 00000000..5437dce8 Binary files /dev/null and b/docs/assets/uiua-logo-scrambledine.png differ diff --git a/docs/assets/uiua-logo.png b/docs/assets/uiua-logo.png new file mode 100644 index 00000000..e9771bdd Binary files /dev/null and b/docs/assets/uiua-logo.png differ diff --git a/docs/assets/uiua-logo.svg b/docs/assets/uiua-logo.svg new file mode 100644 index 00000000..5b072543 --- /dev/null +++ b/docs/assets/uiua-logo.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/assets/wee-wah.mp3 b/docs/assets/wee-wah.mp3 new file mode 100644 index 00000000..032870f7 Binary files /dev/null and b/docs/assets/wee-wah.mp3 differ diff --git a/docs/assets/wee-wuh.mp3 b/docs/assets/wee-wuh.mp3 new file mode 100644 index 00000000..d74651f3 Binary files /dev/null and b/docs/assets/wee-wuh.mp3 differ diff --git a/docs/assets/you-dont.png b/docs/assets/you-dont.png new file mode 100644 index 00000000..80141dbd Binary files /dev/null and b/docs/assets/you-dont.png differ diff --git a/docs/blog/second-class-functions-html.html b/docs/blog/second-class-functions-html.html new file mode 100644 index 00000000..3e30b29c --- /dev/null +++ b/docs/blog/second-class-functions-html.html @@ -0,0 +1,11 @@ + + + + +

Uiua

Blog Home

Why doesn't Uiua have first-class functions?

You can read this post with full editor features here.

2023-12-15


People often ask why Uiua doesn't have first-class functions. That is, functions that can be put on the stack and in arrays.

In the beginning, functions were normal array elements. Modifiers popped their functions from the stack like regular values. Functions could be put in arrays, and lists of functions even had some special uses. There was a ! call function which called the top function on the stack. Boxes were not even a dedicated type. They were just functions that took no arguments and returned a single value.

However, as Uiua's development continued, the language began to rely more and more on stack signatures being well-defined. This property catches errors early, enables some optimizations, and allows modifiers to behave differently depending on their function's siganture. That last point lets us avoid having multiple modifiers that work the same way but on different numbers of arguments. For example, Factor has the words bi, 2bi, 3bi, tri, 2tri, and 3tri. Uiua can express all of these and more with just + fork + .

Unfortunately, having first-class functions was at odds with this design. Because functions could be put into arrays and (conditionally) moved around on the stack, the compiler was not able to determine the signature of a function that called a function value. This meant that anywhere the ! call function was used needed a signature annotation nearby, which you better hope was correct, or the code would break somewhere else. It also incurred additional interpreter overhead to get the functions from arrays and made certain types of optimizations impossible.

Other than these design and implementation concerns, the ability to move functions around on the stack made code much harder to read when it was used. You had to keep in your mind not only the values, but the functions that worked on them as well. They were another value you had to deal with, and the related stack manipulation could get quite messy.

And so I settled on a different approach. Functions were removed as an element type and were put elsewhere in the interpreter. Boxes became a type in their own right. The ! call function was removed, and ! was repurposed to be part of defining custom modifiers. Custom modifiers capture the primary use case of first-class functions: injecting some variable code into a function. While they are technically more limited, their uniform structure makes them easier to both read and write. This change also massively simplified the interpreter, as well as the complexity of the language itself.

Despite the downgrading of functions to second-class status, it should be noted that I do like functional programming languages. I just don't think that first-class functions are a good fit for Uiua. In practice, first-class functions are mostly unnecessary if you have higher-order functions, which array languages have had for decades. APL's operators, J's adverbs and conjunctions, and BQN and Uiua's modifiers are all versions of higher-order functions. They allow the mapping, reduction, and general transformation of data in the same way that first-class functions do in other languages.

Now if only I could find a way to get rid of boxes...

\ No newline at end of file diff --git a/docs/blog/second-class-functions-text.md b/docs/blog/second-class-functions-text.md new file mode 100644 index 00000000..38a7f254 --- /dev/null +++ b/docs/blog/second-class-functions-text.md @@ -0,0 +1,21 @@ +# Why doesn't Uiua have first-class functions? + +2023-12-15 + +--- + +People often ask why Uiua doesn't have first-class functions. That is, functions that can be put on the stack and in arrays. + +In the beginning, functions *were* normal array elements. Modifiers popped their functions from the stack like regular values. Functions could be put in arrays, and lists of functions even had some special uses. There was a `! call` function which called the top function on the stack. Boxes were not even a dedicated type. They were just functions that took no arguments and returned a single value. + +However, as Uiua's development continued, the language began to rely more and more on stack signatures being well-defined. This property catches errors early, enables some optimizations, and allows modifiers to behave differently depending on their function's siganture. That last point lets us avoid having multiple modifiers that work the same way but on different numbers of arguments. For example, [Factor](https://factorcode.org/) has the words `bi`, `2bi`, `3bi`, `tri`, `2tri`, and `3tri`. Uiua can express all of these and more with just [fork](). + +Unfortunately, having first-class functions was at odds with this design. Because functions could be put into arrays and (conditionally) moved around on the stack, the compiler was not able to determine the signature of a function that called a function value. This meant that anywhere the `! call` function was used needed a signature annotation nearby, which you better hope was correct, or the code would break somewhere else. It also incurred additional interpreter overhead to get the functions from arrays and made certain types of optimizations impossible. + +Other than these design and implementation concerns, the ability to move functions around on the stack made code much harder to read when it was used. You had to keep in your mind not only the values, but the functions that worked on them as well. They were another value you had to deal with, and the related stack manipulation could get quite messy. + +And so I settled on a different approach. Functions were removed as an element type and were put elsewhere in the interpreter. Boxes became a type in their own right. The `! call` function was removed, and `!` was repurposed to be part of defining custom modifiers. [Custom modifiers](/docs/custommodifiers) capture the primary use case of first-class functions: injecting some variable code into a function. While they are technically more limited, their uniform structure makes them easier to both read and write. This change also massively simplified the interpreter, as well as the complexity of the language itself. + +Despite the downgrading of functions to second-class status, it should be noted that I do like functional programming languages. I just don't think that first-class functions are a good fit for Uiua. In practice, first-class functions are mostly unnecessary if you have higher-order functions, which array languages have had for decades. APL's operators, J's adverbs and conjunctions, and BQN and Uiua's modifiers are all versions of higher-order functions. They allow the mapping, reduction, and general transformation of data in the same way that first-class functions do in other languages. + +Now if only I could find a way to get rid of boxes... \ No newline at end of file diff --git a/docs/blog/uiua-0.10.0-html.html b/docs/blog/uiua-0.10.0-html.html new file mode 100644 index 00000000..3983afcd --- /dev/null +++ b/docs/blog/uiua-0.10.0-html.html @@ -0,0 +1,78 @@ + + + + +

Uiua

Blog Home

Announcing Uiua 0.10.0

You can read this post with full editor features here.

2024-04-04


Uiua 0.10.0 is now available!

You can find the full changelog here.

This release contains so many changes, improvements, and new features that I thought it deserved a blog post.From here on, major releases will be announced in this way.

While there are many changes, I want to highlight a few of them here.

Pattern Matching

Using + ° un + on a constant value will now match a pattern. When used with + try + , this can be used to conditionally match, extract, and process values.

F ← ⍣( + ×10 °[1⊙3] # Extract and multiply.. +| °(⊂5) # ..or remove leading 5.. +| ⇌ # ..else reverse +) +F [1 2 3] +F [5 6 7] +F "cool!"

You can read more in the Pattern Matching tutorial.

Array Macros

Array macros are a powerful new feature that allow full compile-time metaprogramming.

They allow Uiua code to directly manipulate other Uiua code, enabling a wide range of new possibilities.

F! ←^ ≡$"_ ← _\n" "ABC" +F!(1|2|3) +[A B C B B] # [1 2 3 2 2]

You can read more in the updated Macros tutorial.

Git Modules

You can now prefix a module path with git: to import a git repository from a URL.

~ "git: github.com/uiua-lang/example-module" ~ Upscale +Upscale 3 [1_2 3_4]

In the native interpreter, this automatically creates a Git submodule.

On the web, it fetches a lib.ua file from the repository.

You can read more in the updated Modules tutorial.

+ mask +

+ mask + is a new function that is similar to + find + , but it returns full masks of matches rather than just the first positions.

⦷ " - " "Hey - how-are - you" # [0 0 0 1 1 1 0 0 0 0 0 0 0 2 2 2 0 0 0 0]⊜□¬⦷⊙. " - " "Hey - how-are - you" # {"Hey" "how-are" " you"}

This simplifies a lot of string-processing code in particular. A new strings tutorial has been added as well.

Other Changes

Switch functions now format to use ⟨⟩ brackets. This makes them easier to distinguish from function packs.

F ← (×10|↥2)<2. # This..# 1:5: Function packs are not allowed without a modifier +F ← ⟨×10|↥2⟩<2. # Formats to this +F 0 # 2 +F 5 # 50

+ map + and related functions are no longer experimental! See the + map + docs for an overview.

map 1_2_3 4_5_6 + +# ╭─ +# 1 → 4 +# 2 → 5 +# 3 → 6 +# ╯

The new + &clget + and + &clset + functions provide access to the clipboard.

The interpreter's built-in language server now supports many more features.

There are a ton more! Again, you can read the full changelog here.

💖

As always, I'd like to thank everyone who contributed to this release, whether by directly contributing code, reporting bugs, or just using Uiua and providing feedback.

Uiua is in many ways a novel and unique language, and I think it is only through our collective effort that we can properly explore its design space.

With your help, I hope to continue to improve Uiua to the point of stability.

\ No newline at end of file diff --git a/docs/blog/uiua-0.10.0-text.md b/docs/blog/uiua-0.10.0-text.md new file mode 100644 index 00000000..20fd8431 --- /dev/null +++ b/docs/blog/uiua-0.10.0-text.md @@ -0,0 +1,99 @@ +# Announcing Uiua 0.10.0 + +2024-04-04 + +--- + +Uiua 0.10.0 is now available! + +You can find the full changelog [here](https://uiua.org/docs/changelog#0.10.0---2024-04-04). + +This release contains so many changes, improvements, and new features that I thought it deserved a blog post. +From here on, major releases will be announced in this way. + +While there are many changes, I want to highlight a few of them here. + +## Pattern Matching + +Using [`un`](https://uiua.org/docs/un) on a constant value will now match a pattern. When used with [`try`](https://uiua.org/docs/try), this can be used to conditionally match, extract, and process values. + +```uiua +F ← ⍣( + ×10 °[1⊙3] # Extract and multiply.. +| °(⊂5) # ..or remove leading 5.. +| ⇌ # ..else reverse +) +F [1 2 3] +F [5 6 7] +F "cool!" +``` +You can read more in the [Pattern Matching](https://uiua.org/tutorial/patternmatching) tutorial. + +## Array Macros + +Array macros are a powerful new feature that allow full compile-time metaprogramming. + +They allow Uiua code to directly manipulate other Uiua code, enabling a wide range of new possibilities. + +```uiua +F! ←^ ≡$"_ ← _\n" "ABC" +F!(1|2|3) +[A B C B B] +``` + +You can read more in the updated [Macros](https://uiua.org/tutorial/macros) tutorial. + +## Git Modules + +You can now prefix a module path with `git:` to import a git repository from a URL. +```uiua +~ "git: github.com/uiua-lang/example-module" ~ Upscale +Upscale 3 [1_2 3_4] +``` +In the native interpreter, this automatically creates a Git submodule. + +On the web, it fetches a `lib.ua` file from the repository. + +You can read more in the updated [Modules](https://uiua.org/tutorial/modules) tutorial. + +## [`mask`](https://uiua.org/docs/mask) + +[`mask`](https://uiua.org/docs/mask) is a new function that is similar to [`find`](https://uiua.org/docs/find), but it returns full masks of matches rather than just the first positions. + +```uiua +⦷ " - " "Hey - how-are - you" +``` +```uiua +⊜□¬⦷⊙. " - " "Hey - how-are - you" +``` + +This simplifies a lot of string-processing code in particular. A new [strings](https://uiua.org/tutorial/strings) tutorial has been added as well. + +## Other Changes + +Switch functions now format to use `⟨⟩` brackets. This makes them easier to distinguish from function packs. +```uiua +F ← (×10|↥2)<2. # This.. +F ← ⟨×10|↥2⟩<2. # Formats to this +F 0 +F 5 +``` + +[`map`](https://uiua.org/docs/map) and related functions are no longer experimental! See the [`map`](https://uiua.org/docs/map) docs for an overview. +```uiua +map 1_2_3 4_5_6 +``` + +The new [`&clget`](https://uiua.org/docs/&clget) and [`&clset`](https://uiua.org/docs/&clset) functions provide access to the clipboard. + +The interpreter's built-in language server now supports [many more features](https://marketplace.visualstudio.com/items?itemName=uiua-lang.uiua-vscode). + +There are a ton more! Again, you can read the full changelog [here](https://uiua.org/docs/changelog#0.10.0---2024-04-04). + +## 💖 + +As always, I'd like to thank everyone who contributed to this release, whether by directly contributing code, reporting bugs, or just using Uiua and providing feedback. + +Uiua is in many ways a novel and unique language, and I think it is only through our collective effort that we can properly explore its design space. + +With your help, I hope to continue to improve Uiua to the point of stability. \ No newline at end of file diff --git a/docs/blog/uiua-0.11.0-html.html b/docs/blog/uiua-0.11.0-html.html new file mode 100644 index 00000000..0fb3f434 --- /dev/null +++ b/docs/blog/uiua-0.11.0-html.html @@ -0,0 +1,189 @@ + + + + +

Uiua

Blog Home

Announcing Uiua 0.11.0

You can read this post with full editor features here.

2024-06-02


Uiua 0.11.0 is now available!

You can find the full changelog here.

Uiua is a general purpose, stack-based, array-oriented programming language with a focus on tacit code.

While this release does not have any major new features, it extends the functionality of many primitives, optimizes many common patterns, and fixes a number of bugs.

Here are some of the highlights:

Multi-argument + / reduce +

+ / reduce + takes a dyadic function and applies it "between" all rows of an array.

/+ [1 2 3 4 5] # 15

+ / reduce + can now take multiple arguments if its function takes more than two arguments. Additional arguments are interspersed between the rows and are passed above the main array on the stack.

/(⊂⊂) 0 [1 2 3 4] # [1 0 2 0 3 0 4]

This is particularly useful when used with + content + and + join + to intersperse a delimiter between a list of strings.

/◇(⊂⊂) @, {"cat" "dog" "bird" "fish"} # "cat,dog,bird,fish"

+ json + and + xlsx +

The + json + and + xlsx + functions allow the encoding and decoding of JSON and XLSX data respectively.

json converts an array to a JSON string.

json [1 2 3 4] # "[1,2,3,4]"

It works with maps as well.

json map {"name" "age"} {"Dan" 31} # "{"age":31,"name":"Dan"}"

+ ° un + json decodes a JSON string.

°json $ {"type": "requires", "content": "json", "ids": [38, 22, 5]} + +# ╭─ +# ⌜content⌟ → ⌜json⌟ +# ⌜ids⌟ → ⟦38 22 5⟧ +# ⌜type⌟ → ⌜requires⌟ +# ╯

xlsx is similar, but is works with binary data rather than strings.

+ take + / + drop + + infinity +

+ take + and + drop + isolate part of an array.

↙ 3 [1 2 3 4 5] # [1 2 3] +↘ 3 [1 2 3 4 5] # [4 5]

Multidimensional indices have always been supported.

↙2_2 . ↯3_4⇡12 + +# ╭─ +# ╷ 0 1 2 3 +# 4 5 6 7 +# 8 9 10 11 +# ╯ +# ╭─ +# ╷ 0 1 +# 4 5 +# ╯

You can now provide + infinity + as one or more of the indices to + take + or + drop + that entire axis.

↙∞_2 . ↯3_4⇡12 + +# ╭─ +# ╷ 0 1 2 3 +# 4 5 6 7 +# 8 9 10 11 +# ╯ +# ╭─ +# ╷ 0 1 +# 4 5 +# 8 9 +# ╯↙1_∞_2 . ↯2_3_4⇡24 + +# ╭─ +# ╷ 0 1 2 3 +# ╷ 4 5 6 7 +# 8 9 10 11 +# +# 12 13 14 15 +# 16 17 18 19 +# 20 21 22 23 +# ╯ +# ╭─ +# ╷ 0 1 +# ╷ 4 5 +# 8 9 +# ╯

Swizzles

Swizzles are a new experimental feature that allow concise manipulation of the stack and extraction from arrays.

Stack swizzles are written with a λ followed by some letters. The stack will be rearranged accordingly. λ formats from ' when followed by letters.

# Experimental! +[λccab 1 2 3] # [3 3 1 2]

Capital letters will + ¤ fix + the corresponding array. This is useful with complex + rows + operations.

# Experimental! +≡(⊂⊂) ? λaBC 1_2 3_4 5_6 + +# ╭─ +# ╷ 1 3 4 5 6 +# 2 3 4 5 6 +# ╯

Array swizzles are written with a followed by some letters. Rows from the array that correspond to the letters will be put on the stack. formats from '' when followed by letters.

# Experimental! +⋊beef [1 2 3 4 5 6] # 2 5 5 6

Capital letters will + ° un + + box + the corresponding row.

# Experimental! +⋊aCB {"Dave" 31 [38 22 5]} # ⌜Dave⌟ [38 22 5] 31

Swizzles are experimental and may change in future versions as their place in the language is explored.

The New Pad

Much of the code for the Uiua website pad has been rewritten. This new pad uses less custom behavior and should work better in more browsers.

If you are reading this on the Uiua website (with full editor features), then all the examples above use this new pad!

💗

Thank you as always to everyone who uses Uiua and helps with its development! Your enthusiasm for the language gives me life.

A special thanks to all of Uiua's sponsors for their continued support 🥰

Again, you can find the full changelog for this release here.

You can join the Uiua Discord to chat about the language, ask questions, or get help.

\ No newline at end of file diff --git a/docs/blog/uiua-0.11.0-text.md b/docs/blog/uiua-0.11.0-text.md new file mode 100644 index 00000000..304776c9 --- /dev/null +++ b/docs/blog/uiua-0.11.0-text.md @@ -0,0 +1,134 @@ +# Announcing Uiua 0.11.0 + +2024-06-02 + +--- + +Uiua 0.11.0 is now available! + +You can find the full changelog [here](https://uiua.org/docs/changelog#0.11.0---2024-06-02). + +Uiua is a general purpose, stack-based, array-oriented programming language with a focus on tacit code. + +While this release does not have any major new features, it extends the functionality of many primitives, optimizes many common patterns, and fixes a number of bugs. + +Here are some of the highlights: + +## Multi-argument [`reduce /`](https://uiua.org/docs/reduce) + +[`reduce /`](https://uiua.org/docs/reduce) takes a dyadic function and applies it "between" all rows of an array. + +```uiua +/+ [1 2 3 4 5] +``` + +[`reduce /`](https://uiua.org/docs/reduce) can now take multiple arguments if its function takes more than two arguments. Additional arguments are interspersed between the rows and are passed above the main array on the stack. + +```uiua +/(⊂⊂) 0 [1 2 3 4] +``` + +This is particularly useful when used with [`content `](https://uiua.org/docs/content) and [`join ⊂`](https://uiua.org/docs/join) to intersperse a delimiter between a list of strings. + +```uiua +/◇(⊂⊂) @, {"cat" "dog" "bird" "fish"} +``` + +## [`json`](https://uiua.org/docs/json) and [`xlsx`](https://uiua.org/docs/xlsx) + +The [`json`](https://uiua.org/docs/json) and [`xlsx`](https://uiua.org/docs/xlsx) functions allow the encoding and decoding of JSON and XLSX data respectively. + +`json` converts an array to a JSON string. + +```uiua +json [1 2 3 4] +``` + +It works with `map`s as well. + +```uiua +json map {"name" "age"} {"Dan" 31} +``` + +[`un °`](https://uiua.org/docs/un) `json` decodes a JSON string. + +```uiua +°json $ {"type": "requires", "content": "json", "ids": [38, 22, 5]} +``` + +`xlsx` is similar, but is works with binary data rather than strings. + +## [`take ↙`](https://uiua.org/docs/take)/[`drop ↘`](https://uiua.org/docs/drop) [`infinity ∞`](https://uiua.org/docs/infinity) + +[`take ↙`](https://uiua.org/docs/take) and [`drop ↘`](https://uiua.org/docs/drop) isolate part of an array. + +```uiua +↙ 3 [1 2 3 4 5] +↘ 3 [1 2 3 4 5] +``` + +Multidimensional indices have always been supported. + +```uiua +↙2_2 . ↯3_4⇡12 +``` + +You can now provide [`infinity ∞`](https://uiua.org/docs/infinity) as one or more of the indices to [`take ↙`](https://uiua.org/docs/take) or [`drop ↘`](https://uiua.org/docs/drop) that entire axis. + +```uiua +↙∞_2 . ↯3_4⇡12 +``` +``` uiua +↙1_∞_2 . ↯2_3_4⇡24 +``` + +## Swizzles + +Swizzles are a new experimental feature that allow concise manipulation of the stack and extraction from arrays. + +Stack swizzles are written with a `λ` followed by some letters. The stack will be rearranged accordingly. `λ` formats from `'` when followed by letters. + +```uiua +# Experimental! +[λccab 1 2 3] +``` + +Capital letters will [`fix ¤`](https://uiua.org/docs/fix) the corresponding array. This is useful with complex [`rows ≡`](https://uiua.org/docs/rows) operations. + +```uiua +# Experimental! +≡(⊂⊂) ? λaBC 1_2 3_4 5_6 +``` + +*Array* swizzles are written with a `⋊` followed by some letters. Rows from the array that correspond to the letters will be put on the stack. `⋊` formats from `''` when followed by letters. + +```uiua +# Experimental! +⋊beef [1 2 3 4 5 6] +``` + +Capital letters will [`un °`](https://uiua.org/docs/un) [`box ◻`](https://uiua.org/docs/box) the corresponding row. + +```uiua +# Experimental! +⋊aCB {"Dave" 31 [38 22 5]} +``` + +Swizzles are experimental and may change in future versions as their place in the language is explored. + +## The New Pad + +Much of the code for the [Uiua website pad](https://uiua.org/pad) has been rewritten. This new pad uses less custom behavior and should work better in more browsers. + +If you are reading this on the Uiua website (with full editor features), then all the examples above use this new pad! + +## 💗 + +Thank you as always to everyone who uses Uiua and helps with its development! Your enthusiasm for the language gives me life. + +A *special* thanks to all of [Uiua's sponsors](https://github.com/sponsors/uiua-lang) for their continued support 🥰 + +Again, you can find the full changelog for this release [here](https://uiua.org/docs/changelog#0.11.0---2024-06-02). + +You can join the [Uiua Discord](https://discord.gg/3r9nrfYhCc) to chat about the language, ask questions, or get help. + diff --git a/docs/blog/what-will-1-look-like-html.html b/docs/blog/what-will-1-look-like-html.html new file mode 100644 index 00000000..8d1db4a8 --- /dev/null +++ b/docs/blog/what-will-1-look-like-html.html @@ -0,0 +1,5 @@ + + + + +

Uiua

Blog Home

What will Uiua 1.0 look like?

You can read this post with full editor features here.

2024-01-19


The Uiua pad page prominently displays the words "Uiua is not yet stable". And so it has been asked: when will Uiua be stable? What features will it have? Is there a roadmap?

This post is to organize and present my thoughts on the future of Uiua.

Stability

Uiua will be made officially stable only after it has been unofficially stable for some time. That is, not until no breaking changes have been made for a long time.

The following language features will need to be nailed down before Uiua can ever be stable.

Stack manipulation

I think working with the stack, at least for up to 3 values, has become mostly pretty nice. However, things start to get complicated when working with more values, as is often necessary. There is some design work to be done here, and it's not out of the question that a very small amount of non-tacitness could be introduced to improve this.

The experimental bind modifier is a potential solution to this problem.

There is a balance to be struc between Uiua's goal of tacitness and its goal of being ergonomic. While the beauty of fully tacit code is a worthy goal, some problems involve data flows that are inherently complex, and so some kind of labeling system may be necessary to make such problems workable.

Box Ergonomics

While I've explored alternatives, I've come to the conclusion that nested arrays are a necessary pest. The data we work with is often nested or ragged, and while there are ways to represent such data with flat structures, those representations are cumbersome in their own ways.

And so boxes are likely here to stay. However, I do think some design work can be done to improve their ergonomics. Currently, Uiua's boxes are very similar to J's, but I think it may be worth it to make their usage a bit more implicit in some cases, closer to the nested arrays of APL or BQN.

System APIs

The current system functions are useful and mostly work. There are definitely implementation gaps which need to be filled. There are a good number of missing filesystem operations, and some other things like UDP sockets and proper interaction with child processes still need to be implemented.

FFI

An FFI system similar to BQN's is planned. This will allow Uiua to call into C libraries and will enable a lot more functionality.

\ No newline at end of file diff --git a/docs/blog/what-will-1-look-like-text.md b/docs/blog/what-will-1-look-like-text.md new file mode 100644 index 00000000..3e285a0a --- /dev/null +++ b/docs/blog/what-will-1-look-like-text.md @@ -0,0 +1,37 @@ +# What will Uiua 1.0 look like? + +2024-01-19 + +--- + +The [Uiua pad](https://uiua.org/pad) page prominently displays the words "Uiua is not yet stable". And so it has been asked: when will Uiua be stable? What features will it have? Is there a roadmap? + +This post is to organize and present my thoughts on the future of Uiua. + +## Stability + +Uiua will be made officially stable only after it has been unofficially stable for some time. That is, not until no breaking changes have been made for a long time. + +The following language features will need to be nailed down before Uiua can ever be stable. + +### Stack manipulation + +I think working with the stack, at least for up to 3 values, has become mostly pretty nice. However, things start to get complicated when working with more values, as is often necessary. There is some design work to be done here, and it's not out of the question that a very small amount of non-tacitness could be introduced to improve this. + +The experimental [`bind`](https://uiua.org/docs/experimental#swizzles) modifier is a potential solution to this problem. + +There is a balance to be struc between Uiua's goal of tacitness and its goal of being ergonomic. While the beauty of fully tacit code is a worthy goal, some problems involve data flows that are inherently complex, and so some kind of labeling system may be necessary to make such problems workable. + +### Box Ergonomics + +While I've explored alternatives, I've come to the conclusion that nested arrays are a necessary pest. The data we work with is often nested or ragged, and while there are ways to represent such data with flat structures, those representations are cumbersome in their own ways. + +And so boxes are likely here to stay. However, I do think some design work can be done to improve their ergonomics. Currently, Uiua's boxes are very similar to J's, but I think it may be worth it to make their usage a bit more implicit in some cases, closer to the nested arrays of APL or BQN. + +### System APIs + +The current [system functions](https://uiua.org/docs/system) are useful and *mostly* work. There are definitely implementation gaps which need to be filled. There are a good number of missing filesystem operations, and some other things like UDP sockets and proper interaction with child processes still need to be implemented. + +### FFI + +An FFI system similar to [BQN's](https://mlochbaum.github.io/BQN/spec/system.html#foreign-function-interface) is planned. This will allow Uiua to call into C libraries and will enable a lot more functionality. \ No newline at end of file diff --git a/docs/combinators/B.svg b/docs/combinators/B.svg new file mode 100644 index 00000000..d0141a4a --- /dev/null +++ b/docs/combinators/B.svg @@ -0,0 +1,18 @@ + + + F + G + a + + + diff --git a/docs/combinators/B1.svg b/docs/combinators/B1.svg new file mode 100644 index 00000000..8d3f486a --- /dev/null +++ b/docs/combinators/B1.svg @@ -0,0 +1,20 @@ + + + F + G + a + b + + + + diff --git a/docs/combinators/C.svg b/docs/combinators/C.svg new file mode 100644 index 00000000..f46334fb --- /dev/null +++ b/docs/combinators/C.svg @@ -0,0 +1,18 @@ + + + F + a + b + + + diff --git a/docs/combinators/D.svg b/docs/combinators/D.svg new file mode 100644 index 00000000..c2fe4eac --- /dev/null +++ b/docs/combinators/D.svg @@ -0,0 +1,20 @@ + + + F + G + a + b + + + + diff --git a/docs/combinators/D2.svg b/docs/combinators/D2.svg new file mode 100644 index 00000000..fe50b09b --- /dev/null +++ b/docs/combinators/D2.svg @@ -0,0 +1,22 @@ + + + F + G + H + a + b + + + + + diff --git a/docs/combinators/E.svg b/docs/combinators/E.svg new file mode 100644 index 00000000..5c3a8cff --- /dev/null +++ b/docs/combinators/E.svg @@ -0,0 +1,22 @@ + + + F + G + a + b + c + + + + + diff --git a/docs/combinators/I.svg b/docs/combinators/I.svg new file mode 100644 index 00000000..80d52f06 --- /dev/null +++ b/docs/combinators/I.svg @@ -0,0 +1,16 @@ + + + a + a + + diff --git a/docs/combinators/K.svg b/docs/combinators/K.svg new file mode 100644 index 00000000..062b3378 --- /dev/null +++ b/docs/combinators/K.svg @@ -0,0 +1,17 @@ + + + a + a + b + + diff --git a/docs/combinators/KI.svg b/docs/combinators/KI.svg new file mode 100644 index 00000000..5cadf169 --- /dev/null +++ b/docs/combinators/KI.svg @@ -0,0 +1,17 @@ + + + a + b + b + + diff --git a/docs/combinators/N.svg b/docs/combinators/N.svg new file mode 100644 index 00000000..9643dbb4 --- /dev/null +++ b/docs/combinators/N.svg @@ -0,0 +1,21 @@ + + + F + G + a + b + + + + + diff --git a/docs/combinators/R.svg b/docs/combinators/R.svg new file mode 100644 index 00000000..dbcfa1fe --- /dev/null +++ b/docs/combinators/R.svg @@ -0,0 +1,24 @@ + + + F + G + H + a + b + c + + + + + + diff --git a/docs/combinators/S.svg b/docs/combinators/S.svg new file mode 100644 index 00000000..2e851092 --- /dev/null +++ b/docs/combinators/S.svg @@ -0,0 +1,19 @@ + + + F + G + a + + + + diff --git a/docs/combinators/W.svg b/docs/combinators/W.svg new file mode 100644 index 00000000..f18e0bf7 --- /dev/null +++ b/docs/combinators/W.svg @@ -0,0 +1,17 @@ + + + F + a + + + diff --git a/docs/combinators/X.svg b/docs/combinators/X.svg new file mode 100644 index 00000000..68122545 --- /dev/null +++ b/docs/combinators/X.svg @@ -0,0 +1,23 @@ + + + F + G + H + a + b + + + + + + diff --git "a/docs/combinators/\303\212.svg" "b/docs/combinators/\303\212.svg" new file mode 100644 index 00000000..da7520a2 --- /dev/null +++ "b/docs/combinators/\303\212.svg" @@ -0,0 +1,26 @@ + + + F + G + H + a + b + c + d + + + + + + + diff --git "a/docs/combinators/\316\224.svg" "b/docs/combinators/\316\224.svg" new file mode 100644 index 00000000..bdbd02c8 --- /dev/null +++ "b/docs/combinators/\316\224.svg" @@ -0,0 +1,20 @@ + + + F + G + a + b + + + + diff --git "a/docs/combinators/\316\243.svg" "b/docs/combinators/\316\243.svg" new file mode 100644 index 00000000..ce48a612 --- /dev/null +++ "b/docs/combinators/\316\243.svg" @@ -0,0 +1,19 @@ + + + F + G + a + + + + diff --git "a/docs/combinators/\316\246.svg" "b/docs/combinators/\316\246.svg" new file mode 100644 index 00000000..c759a13b --- /dev/null +++ "b/docs/combinators/\316\246.svg" @@ -0,0 +1,21 @@ + + + F + G + H + a + + + + + diff --git "a/docs/combinators/\316\2461.svg" "b/docs/combinators/\316\2461.svg" new file mode 100644 index 00000000..ebd1fdda --- /dev/null +++ "b/docs/combinators/\316\2461.svg" @@ -0,0 +1,24 @@ + + + F + G + H + a + b + + + + + + + diff --git "a/docs/combinators/\316\250.svg" "b/docs/combinators/\316\250.svg" new file mode 100644 index 00000000..040805e3 --- /dev/null +++ "b/docs/combinators/\316\250.svg" @@ -0,0 +1,22 @@ + + + F + G + G + a + b + + + + + diff --git "a/docs/combinators/\316\265.svg" "b/docs/combinators/\316\265.svg" new file mode 100644 index 00000000..5cb9c981 --- /dev/null +++ "b/docs/combinators/\316\265.svg" @@ -0,0 +1,22 @@ + + + F + G + a + b + c + + + + + diff --git "a/docs/combinators/\316\275.svg" "b/docs/combinators/\316\275.svg" new file mode 100644 index 00000000..0782f4f1 --- /dev/null +++ "b/docs/combinators/\316\275.svg" @@ -0,0 +1,21 @@ + + + F + G + a + b + + + + + diff --git "a/docs/combinators/\317\201.svg" "b/docs/combinators/\317\201.svg" new file mode 100644 index 00000000..b830f38e --- /dev/null +++ "b/docs/combinators/\317\201.svg" @@ -0,0 +1,24 @@ + + + F + G + H + a + b + c + + + + + + diff --git "a/docs/combinators/\317\207.svg" "b/docs/combinators/\317\207.svg" new file mode 100644 index 00000000..60762eea --- /dev/null +++ "b/docs/combinators/\317\207.svg" @@ -0,0 +1,23 @@ + + + F + G + H + a + b + + + + + + diff --git a/docs/favicon-crayon.ico b/docs/favicon-crayon.ico new file mode 100644 index 00000000..5b372be8 Binary files /dev/null and b/docs/favicon-crayon.ico differ diff --git a/docs/favicon.ico b/docs/favicon.ico new file mode 100644 index 00000000..9d7d7343 Binary files /dev/null and b/docs/favicon.ico differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..a5e27091 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,120 @@ + + + + + Uiua + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+

Uiua (wee-wuh) is a general purpose, stack-based, + array-oriented programming language with a focus on simplicity, beauty, and tacit code.

+

Uiua lets you write code that is as short as possible while remaining readable, so you can + focus on problems rather than ceremony.

+

The language is not yet stable, as its design space is still being explored. However, it is + already quite powerful and fun to use!

+ +

Loading...

+
+
+ + + + + \ No newline at end of file diff --git a/docs/primitives.json b/docs/primitives.json new file mode 100644 index 00000000..6746d880 --- /dev/null +++ b/docs/primitives.json @@ -0,0 +1,1294 @@ +{ + "&ad": { + "args": 1, + "outputs": 2, + "class": "Audio", + "description": "Decode audio from a byte array", + "deprecated": true + }, + "&ae": { + "args": 2, + "outputs": 1, + "class": "Audio", + "description": "Encode audio into a byte array" + }, + "&ap": { + "args": 1, + "outputs": 0, + "class": "Audio", + "description": "Play some audio" + }, + "&args": { + "args": 0, + "outputs": 1, + "class": "Env", + "description": "Get the command line arguments" + }, + "&asr": { + "args": 0, + "outputs": 1, + "class": "Audio", + "description": "Get the sample rate of the audio output backend" + }, + "&ast": { + "args": 0, + "outputs": 0, + "modifier_args": 1, + "class": "Audio", + "description": "Synthesize and stream audio" + }, + "&camcap": { + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Capture an image from a webcam" + }, + "&cd": { + "args": 1, + "outputs": 0, + "class": "Filesystem", + "description": "Change the current directory" + }, + "&cl": { + "args": 1, + "outputs": 0, + "class": "Stream", + "description": "Close a stream by its handle" + }, + "&clget": { + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Get the contents of the clipboard" + }, + "&clset": { + "args": 1, + "outputs": 0, + "class": "Misc", + "description": "Set the contents of the clipboard" + }, + "&exit": { + "args": 1, + "outputs": 0, + "class": "Misc", + "description": "Exit the program with a status code" + }, + "&fc": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Create a file and return a handle to it" + }, + "&fde": { + "args": 1, + "outputs": 0, + "class": "Filesystem", + "description": "Delete a file or directory" + }, + "&fe": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Check if a file exists at a path" + }, + "&ffi": { + "args": 2, + "outputs": 1, + "class": "Ffi", + "description": "Call a foreign function interface", + "experimental": true + }, + "&fif": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Check if a path is a file" + }, + "&fld": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "List the contents of a directory" + }, + "&fo": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Open a file and return a handle to it" + }, + "&frab": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Read all the contents of a file into a byte array" + }, + "&fras": { + "args": 1, + "outputs": 1, + "class": "Filesystem", + "description": "Read all the contents of a file into a string" + }, + "&ftr": { + "args": 1, + "outputs": 0, + "class": "Filesystem", + "description": "Move a file or directory to the trash" + }, + "&fwa": { + "args": 2, + "outputs": 0, + "class": "Filesystem", + "description": "Write the entire contents of an array to a file" + }, + "&gifd": { + "args": 1, + "outputs": 2, + "class": "Gifs", + "description": "Decode a gif from a byte array", + "deprecated": true + }, + "&gife": { + "args": 2, + "outputs": 1, + "class": "Gifs", + "description": "Encode a gif into a byte array" + }, + "&gifs": { + "args": 2, + "outputs": 0, + "class": "Gifs", + "description": "Show a gif" + }, + "&httpsw": { + "args": 2, + "outputs": 1, + "class": "Tcp", + "description": "Make an HTTP(S) request", + "deprecated": true + }, + "&imd": { + "args": 1, + "outputs": 2, + "class": "Images", + "description": "Decode an image from a byte array", + "deprecated": true + }, + "&ime": { + "args": 2, + "outputs": 1, + "class": "Images", + "description": "Encode an image into a byte array with the specified format" + }, + "&ims": { + "args": 1, + "outputs": 0, + "class": "Images", + "description": "Show an image" + }, + "&invk": { + "args": 1, + "outputs": 1, + "class": "Command", + "description": "Invoke a path with the system's default program" + }, + "&memcpy": { + "args": 3, + "outputs": 1, + "class": "Ffi", + "description": "Copy data from a pointer into an array", + "experimental": true + }, + "&memfree": { + "args": 1, + "outputs": 0, + "class": "Ffi", + "description": "Free a pointer", + "experimental": true + }, + "&p": { + "args": 1, + "outputs": 0, + "class": "StdIO", + "description": "Print a value to stdout followed by a newline" + }, + "&pf": { + "args": 1, + "outputs": 0, + "class": "StdIO", + "description": "Print a value to stdout" + }, + "&raw": { + "args": 1, + "outputs": 0, + "class": "Env", + "description": "Set the terminal to raw mode" + }, + "&rb": { + "args": 2, + "outputs": 1, + "class": "Stream", + "description": "Read at most n bytes from a stream" + }, + "&rs": { + "args": 2, + "outputs": 1, + "class": "Stream", + "description": "Read characters formed by at most n bytes from a stream" + }, + "&ru": { + "args": 2, + "outputs": 1, + "class": "Stream", + "description": "Read from a stream until a delimiter is reached" + }, + "&runc": { + "args": 1, + "outputs": 3, + "class": "Command", + "description": "Run a command and wait for it to finish" + }, + "&runi": { + "args": 1, + "outputs": 1, + "class": "Command", + "description": "Run a command and wait for it to finish" + }, + "&runs": { + "args": 1, + "outputs": 3, + "class": "Command", + "description": "Run a command with streaming IO" + }, + "&s": { + "args": 1, + "outputs": 0, + "class": "StdIO", + "description": "Print a nicely formatted representation of a value to stdout" + }, + "&sc": { + "args": 0, + "outputs": 1, + "class": "StdIO", + "description": "Read a line from stdin" + }, + "&sl": { + "args": 1, + "outputs": 0, + "class": "Misc", + "description": "Sleep for n seconds" + }, + "&tcpa": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Accept a connection with a TCP or TLS listener" + }, + "&tcpaddr": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Get the connection address of a TCP socket" + }, + "&tcpc": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TCP socket and connect it to an address" + }, + "&tcpl": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TCP listener and bind it to an address" + }, + "&tcpsnb": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Set a TCP socket to non-blocking mode" + }, + "&tcpsrt": { + "args": 2, + "outputs": 0, + "class": "Tcp", + "description": "Set the read timeout of a TCP socket in seconds" + }, + "&tcpswt": { + "args": 2, + "outputs": 0, + "class": "Tcp", + "description": "Set the write timeout of a TCP socket in seconds" + }, + "&tlsc": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TCP socket with TLS support" + }, + "&tlsl": { + "args": 1, + "outputs": 1, + "class": "Tcp", + "description": "Create a TLS listener and bind it to an address", + "experimental": true + }, + "&ts": { + "args": 0, + "outputs": 1, + "class": "Env", + "description": "Get the size of the terminal" + }, + "&var": { + "args": 1, + "outputs": 1, + "class": "Env", + "description": "Get the value of an environment variable" + }, + "&w": { + "args": 2, + "outputs": 0, + "class": "Stream", + "description": "Write an array to a stream" + }, + "absolute value": { + "glyph": "⌵", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Get the absolute value of a number" + }, + "add": { + "glyph": "+", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Add values" + }, + "assert": { + "glyph": "⍤", + "args": 2, + "outputs": 0, + "class": "Misc", + "description": "Throw an error if a condition is not met" + }, + "astar": { + "outputs": 2, + "modifier_args": 3, + "class": "Misc", + "description": "Find shortest paths in a graph", + "experimental": true + }, + "atangent": { + "glyph": "∠", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Take the arctangent of two numbers" + }, + "backward": { + "glyph": "¨", + "outputs": 1, + "modifier_args": 1, + "class": "Stack", + "description": "Call a function with its arguments reversed", + "experimental": true + }, + "bits": { + "glyph": "⋯", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Encode an array as bits (LSB-first)" + }, + "both": { + "glyph": "∩", + "args": 2, + "outputs": 1, + "modifier_args": 1, + "class": "Planet", + "description": "Call a function on two sets of values" + }, + "box": { + "glyph": "□", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Turn an array into a box" + }, + "bracket": { + "glyph": "⊓", + "outputs": 1, + "modifier_args": 2, + "class": "Planet", + "description": "Call two functions on two distinct sets of values" + }, + "but": { + "glyph": "⤙", + "outputs": 1, + "modifier_args": 1, + "class": "Stack", + "description": "Call a function but keep its last argument on the top of the stack", + "experimental": true + }, + "by": { + "glyph": "⊸", + "outputs": 1, + "modifier_args": 1, + "class": "Stack", + "description": "Duplicate a function's last argument before calling it" + }, + "case": { + "outputs": 1, + "modifier_args": 1, + "class": "Misc", + "description": "Call a pattern matching case", + "experimental": true + }, + "ceiling": { + "glyph": "⌈", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Round to the nearest integer towards ∞" + }, + "classify": { + "glyph": "⊛", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Assign a unique index to each unique element in an array" + }, + "complex": { + "glyph": "ℂ", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Make a complex number" + }, + "comptime": { + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Run a function at compile time" + }, + "content": { + "glyph": "◇", + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Unbox the arguments to a function before calling it" + }, + "coordinate": { + "glyph": "⟔", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Find the first deep index of one array in another", + "experimental": true, + "deprecated": true + }, + "couple": { + "glyph": "⊟", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Combine two arrays as rows of a new array" + }, + "csv": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Encode an array into a CSV string" + }, + "deal": { + "args": 2, + "outputs": 1, + "class": "Misc", + "description": "Randomly reorder the rows of an array with a seed", + "deprecated": true + }, + "deduplicate": { + "glyph": "◴", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Remove duplicate elements from an array" + }, + "deshape": { + "glyph": "♭", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Make an array 1-dimensional" + }, + "dip": { + "glyph": "⊙", + "outputs": 1, + "modifier_args": 1, + "class": "Planet", + "description": "Temporarily pop the top value off the stack and call a function" + }, + "divide": { + "ascii": "%", + "glyph": "÷", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Divide values" + }, + "do": { + "glyph": "⍢", + "outputs": 1, + "modifier_args": 2, + "class": "IteratingModifier", + "description": "Repeat a function while a condition holds" + }, + "drop": { + "glyph": "↘", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Drop the first n elements of an array" + }, + "dump": { + "args": 0, + "outputs": 0, + "modifier_args": 1, + "class": "Stack", + "description": "Debug print all the values currently on stack without popping them" + }, + "duplicate": { + "glyph": ".", + "args": 1, + "outputs": 2, + "class": "Stack", + "description": "Duplicate the top value on the stack" + }, + "each": { + "glyph": "∵", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each element of an array or arrays" + }, + "equals": { + "ascii": "=", + "glyph": "=", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for equality" + }, + "eta": { + "glyph": "η", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The number of radians in a quarter circle" + }, + "fall": { + "glyph": "⍖", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the indices into an array if it were sorted descending" + }, + "fft": { + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Run the Fast Fourier Transform on an array", + "experimental": true + }, + "fill": { + "glyph": "⬚", + "outputs": 1, + "modifier_args": 2, + "class": "OtherModifier", + "description": "Set the fill value for a function" + }, + "find": { + "glyph": "⌕", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Find the occurences of one array in another" + }, + "first": { + "glyph": "⊢", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the first row of an array" + }, + "fix": { + "glyph": "¤", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Add a length-1 axis to an array" + }, + "flip": { + "glyph": ":", + "args": 2, + "outputs": 2, + "class": "Stack", + "description": "Swap the top two values on the stack" + }, + "floor": { + "glyph": "⌊", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Round to the nearest integer towards ¯∞" + }, + "fold": { + "glyph": "∧", + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Apply a function to aggregate arrays" + }, + "fork": { + "glyph": "⊃", + "outputs": 1, + "modifier_args": 2, + "class": "Planet", + "description": "Call two functions on the same values" + }, + "gap": { + "glyph": "⋅", + "outputs": 1, + "modifier_args": 1, + "class": "Planet", + "description": "Discard the top stack value then call a function" + }, + "gen": { + "args": 1, + "outputs": 2, + "class": "Misc", + "description": "Generate a random number between 0 and 1 from a seed, as well as the next seed" + }, + "get": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Get the value corresponding to a key in a map array" + }, + "greater or equal": { + "ascii": ">=", + "glyph": "≥", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for greater than or equal" + }, + "greater than": { + "glyph": ">", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for greater than" + }, + "group": { + "glyph": "⊕", + "args": 2, + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Group elements of an array into buckets by index" + }, + "has": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Check if a map array has a key" + }, + "identity": { + "glyph": "∘", + "args": 1, + "outputs": 1, + "class": "Planet", + "description": "Do nothing with one value" + }, + "indexof": { + "glyph": "⊗", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Find the first index of each row of one array in another" + }, + "infinity": { + "glyph": "∞", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The biggest number" + }, + "insert": { + "args": 3, + "outputs": 1, + "class": "Map", + "description": "Insert a key-value pair into a map array" + }, + "inventory": { + "glyph": "⍚", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each unboxed row of an array and re-box the results" + }, + "join": { + "glyph": "⊂", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Append two arrays end-to-end" + }, + "json": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Encode an array into a JSON string" + }, + "keep": { + "glyph": "▽", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Discard or copy some rows of an array" + }, + "length": { + "glyph": "⧻", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the number of rows in an array" + }, + "less or equal": { + "ascii": "<=", + "glyph": "≤", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for less than or equal" + }, + "less than": { + "glyph": "<", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for less than" + }, + "logarithm": { + "glyph": "ₙ", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Get the based logarithm of a number" + }, + "map": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Create a hashmap from a list of keys and list values" + }, + "mask": { + "glyph": "⦷", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Mask the occurences of one array in another" + }, + "match": { + "glyph": "≍", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Check if two arrays are exactly the same" + }, + "maximum": { + "glyph": "↥", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Take the maximum of two arrays" + }, + "member": { + "glyph": "∊", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Check if each row of one array exists in another" + }, + "memo": { + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Memoize a function" + }, + "minimum": { + "glyph": "↧", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Take the minimum of two arrays" + }, + "modulus": { + "glyph": "◿", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Modulo values" + }, + "multiply": { + "ascii": "*", + "glyph": "×", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Multiply values" + }, + "negate": { + "ascii": "`", + "glyph": "¯", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Negate a number" + }, + "not": { + "glyph": "¬", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Logical not" + }, + "not equals": { + "ascii": "!=", + "glyph": "≠", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Compare for inequality" + }, + "now": { + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Get the current time in seconds" + }, + "on": { + "glyph": "⟜", + "outputs": 1, + "modifier_args": 1, + "class": "Stack", + "description": "Call a function but keep its first argument on the top of the stack" + }, + "orient": { + "glyph": "⮌", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Change the order of the axes of an array", + "experimental": true + }, + "over": { + "glyph": ",", + "args": 2, + "outputs": 3, + "class": "Stack", + "description": "Duplicate the second-to-top value to the top of the stack" + }, + "parse": { + "glyph": "⋕", + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Parse a string as a number" + }, + "partition": { + "glyph": "⊜", + "args": 2, + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Group sequential sections of an array" + }, + "pi": { + "glyph": "π", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The ratio of a circle's circumference to its diameter" + }, + "pick": { + "glyph": "⊡", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Index a row or elements from an array" + }, + "pool": { + "outputs": 1, + "modifier_args": 1, + "class": "Thread", + "description": "Spawn a thread in a thread pool" + }, + "pop": { + "glyph": "◌", + "args": 1, + "outputs": 0, + "class": "Stack", + "description": "Discard the top stack value" + }, + "power": { + "glyph": "ⁿ", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Raise a value to a power" + }, + "quote": { + "args": 0, + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Convert a string into code at compile time", + "experimental": true + }, + "random": { + "glyph": "⚂", + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Generate a random number in the range [0, 1)" + }, + "range": { + "glyph": "⇡", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Make an array of all natural numbers less than a number" + }, + "recv": { + "args": 1, + "outputs": 1, + "class": "Thread", + "description": "Receive a value from a thread" + }, + "reduce": { + "glyph": "/", + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Apply a reducing function to an array" + }, + "regex": { + "args": 2, + "outputs": 1, + "class": "Misc", + "description": "Match a regex pattern" + }, + "remove": { + "args": 2, + "outputs": 1, + "class": "Map", + "description": "Remove the value corresponding to a key from a map array" + }, + "repeat": { + "glyph": "⍥", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Repeat a function a number of times" + }, + "repr": { + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Convert a value to its code representation" + }, + "rerank": { + "glyph": "☇", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Change the rank of an array's rows" + }, + "reshape": { + "glyph": "↯", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Change the shape of an array" + }, + "reverse": { + "glyph": "⇌", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Reverse the rows of an array" + }, + "rise": { + "glyph": "⍏", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the indices into an array if it were sorted ascending" + }, + "rotate": { + "glyph": "↻", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Rotate the elements of an array by n" + }, + "round": { + "glyph": "⁅", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Round to the nearest integer" + }, + "rows": { + "glyph": "≡", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each row of an array or arrays" + }, + "scan": { + "glyph": "\\", + "args": 1, + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Reduce, but keep intermediate values" + }, + "select": { + "glyph": "⊏", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Select multiple rows from an array" + }, + "send": { + "args": 2, + "outputs": 0, + "class": "Thread", + "description": "Send a value to a thread" + }, + "setinv": { + "outputs": 1, + "modifier_args": 2, + "class": "InversionModifier", + "description": "Set the un-compatible inverse of a function" + }, + "setund": { + "outputs": 1, + "modifier_args": 3, + "class": "InversionModifier", + "description": "Set the under-compatible inverse of a function" + }, + "shape": { + "glyph": "△", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get the dimensions of an array" + }, + "sign": { + "glyph": "±", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Numerical sign (1, ¯1, or 0)" + }, + "signature": { + "args": 0, + "outputs": 2, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Get the signature of a function", + "experimental": true + }, + "sine": { + "glyph": "∿", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Get the sine of a number" + }, + "spawn": { + "outputs": 1, + "modifier_args": 1, + "class": "Thread", + "description": "Spawn a thread" + }, + "sqrt": { + "glyph": "√", + "args": 1, + "outputs": 1, + "class": "MonadicPervasive", + "description": "Take the square root of a number" + }, + "stack": { + "glyph": "?", + "args": 0, + "outputs": 0, + "class": "Stack", + "description": "Debug print all stack values without popping them" + }, + "stringify": { + "args": 0, + "outputs": 1, + "modifier_args": 1, + "class": "OtherModifier", + "description": "Convert code into a string instead of compiling it", + "experimental": true + }, + "subtract": { + "glyph": "-", + "args": 2, + "outputs": 1, + "class": "DyadicPervasive", + "description": "Subtract values" + }, + "switch": { + "glyph": "⨬", + "outputs": 1, + "modifier_args": 2, + "class": "OtherModifier", + "description": "Call the function at the given index" + }, + "table": { + "glyph": "⊞", + "outputs": 1, + "modifier_args": 1, + "class": "IteratingModifier", + "description": "Apply a function to each combination of rows of two arrays" + }, + "tag": { + "args": 0, + "outputs": 1, + "class": "Misc", + "description": "Generate a unique tag" + }, + "take": { + "glyph": "↙", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "Take the first n elements of an array" + }, + "tau": { + "glyph": "τ", + "args": 0, + "outputs": 1, + "class": "Constant", + "description": "The ratio of a circle's circumference to its radius" + }, + "trace": { + "glyph": "⸮", + "args": 1, + "outputs": 1, + "class": "Stack", + "description": "Debug print the top value on the stack without popping it" + }, + "transpose": { + "glyph": "⍉", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Rotate the shape of an array" + }, + "triangle": { + "glyph": "◹", + "outputs": 1, + "modifier_args": 1, + "class": "AggregatingModifier", + "description": "Apply a function to each shrinking row of an array", + "experimental": true + }, + "try": { + "glyph": "⍣", + "outputs": 1, + "modifier_args": 2, + "class": "Misc", + "description": "Call a function and catch errors" + }, + "tryrecv": { + "args": 1, + "outputs": 1, + "class": "Thread", + "description": "Try to receive a value from a thread" + }, + "type": { + "args": 1, + "outputs": 1, + "class": "Misc", + "description": "Check the type of an array" + }, + "un": { + "glyph": "°", + "outputs": 1, + "modifier_args": 1, + "class": "InversionModifier", + "description": "Invert the behavior of a function" + }, + "under": { + "glyph": "⍜", + "outputs": 1, + "modifier_args": 2, + "class": "InversionModifier", + "description": "Operate on a transformed array, then reverse the transformation" + }, + "unique": { + "glyph": "◰", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get a mask of first occurrences of items in an array" + }, + "utf": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Convert a string to UTF-8 bytes" + }, + "wait": { + "args": 1, + "outputs": 1, + "class": "Thread", + "description": "Wait for a thread to finish and push its results to the stack" + }, + "where": { + "glyph": "⊚", + "args": 1, + "outputs": 1, + "class": "MonadicArray", + "description": "Get indices where array values are not equal to zero" + }, + "windows": { + "glyph": "◫", + "args": 2, + "outputs": 1, + "class": "DyadicArray", + "description": "The n-wise windows of an array" + }, + "with": { + "glyph": "⤚", + "outputs": 1, + "modifier_args": 1, + "class": "Stack", + "description": "Call a function but keep its first argument under the outputs on the stack", + "experimental": true + }, + "xlsx": { + "args": 1, + "outputs": 1, + "class": "Encoding", + "description": "Encode an array into XLSX bytes" + } +} \ No newline at end of file diff --git a/docs/site-999ff84c3351f9f6.js b/docs/site-999ff84c3351f9f6.js new file mode 100644 index 00000000..33f41c21 --- /dev/null +++ b/docs/site-999ff84c3351f9f6.js @@ -0,0 +1,1661 @@ +let wasm; + +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + +function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + + heap[idx] = obj; + return idx; +} + +let WASM_VECTOR_LEN = 0; + +let cachedUint8Memory0 = null; + +function getUint8Memory0() { + if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { + cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8Memory0; +} + +const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } ); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length, 1) >>> 0; + getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + + const mem = getUint8Memory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8Memory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +function isLikeNone(x) { + return x === undefined || x === null; +} + +let cachedInt32Memory0 = null; + +function getInt32Memory0() { + if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { + cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32Memory0; +} + +const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); + +if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }; + +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); +} + +let cachedFloat64Memory0 = null; + +function getFloat64Memory0() { + if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { + cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); + } + return cachedFloat64Memory0; +} + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(state => { + wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b) +}); + +function makeMutClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + const a = state.a; + state.a = 0; + try { + return f(a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_2.get(state.dtor)(a, state.b); + CLOSURE_DTORS.unregister(state); + } else { + state.a = a; + } + } + }; + real.original = state; + CLOSURE_DTORS.register(real, state, state); + return real; +} +function __wbg_adapter_38(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0f0a1555c9d5fa68(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_41(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7cb7aaaead6090f5(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_44(arg0, arg1) { + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h342ef8be0dd43d54(arg0, arg1); +} + +function __wbg_adapter_47(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h793423f4d735904c(arg0, arg1, addHeapObject(arg2)); +} + +function getCachedStringFromWasm0(ptr, len) { + if (ptr === 0) { + return getObject(len); + } else { + return getStringFromWasm0(ptr, len); + } +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); + } +} +function __wbg_adapter_446(arg0, arg1, arg2, arg3) { + wasm.wasm_bindgen__convert__closures__invoke2_mut__h7b0dbf8d3468eb09(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); +} + +const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0)); +/** +*/ +export class IntoUnderlyingByteSource { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingByteSourceFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingbytesource_free(ptr); + } + /** + * @returns {string} + */ + get type() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.intounderlyingbytesource_type(retptr, this.__wbg_ptr); + var r0 = getInt32Memory0()[retptr / 4 + 0]; + var r1 = getInt32Memory0()[retptr / 4 + 1]; + var v1 = getCachedStringFromWasm0(r0, r1); + if (r0 !== 0) { wasm.__wbindgen_free(r0, r1, 1); } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } +} +/** +* @returns {number} +*/ +get autoAllocateChunkSize() { + const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr); + return ret >>> 0; +} +/** +* @param {ReadableByteStreamController} controller +*/ +start(controller) { + wasm.intounderlyingbytesource_start(this.__wbg_ptr, addHeapObject(controller)); +} +/** +* @param {ReadableByteStreamController} controller +* @returns {Promise} +*/ +pull(controller) { + const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, addHeapObject(controller)); + return takeObject(ret); +} +/** +*/ +cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingbytesource_cancel(ptr); +} +} + +const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0)); +/** +*/ +export class IntoUnderlyingSink { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSinkFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsink_free(ptr); + } + /** + * @param {any} chunk + * @returns {Promise} + */ + write(chunk) { + const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, addHeapObject(chunk)); + return takeObject(ret); + } + /** + * @returns {Promise} + */ + close() { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_close(ptr); + return takeObject(ret); + } + /** + * @param {any} reason + * @returns {Promise} + */ + abort(reason) { + const ptr = this.__destroy_into_raw(); + const ret = wasm.intounderlyingsink_abort(ptr, addHeapObject(reason)); + return takeObject(ret); + } +} + +const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined') + ? { register: () => {}, unregister: () => {} } + : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0)); +/** +*/ +export class IntoUnderlyingSource { + + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IntoUnderlyingSourceFinalization.unregister(this); + return ptr; + } + + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_intounderlyingsource_free(ptr); + } + /** + * @param {ReadableStreamDefaultController} controller + * @returns {Promise} + */ + pull(controller) { + const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, addHeapObject(controller)); + return takeObject(ret); + } + /** + */ + cancel() { + const ptr = this.__destroy_into_raw(); + wasm.intounderlyingsource_cancel(ptr); + } +} + +async function __wbg_load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'string' ? obj : undefined; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); + }; + imports.wbg.__wbg_new_abda76e883ba8a5f = function() { + const ret = new Error(); + return addHeapObject(ret); + }; + imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { + const ret = getObject(arg1).stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; + }; + imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1, 1); } + console.error(v0); +}; +imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) { + const ret = getObject(arg0) === getObject(arg1); + return ret; +}; +imports.wbg.__wbindgen_number_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof(obj) === 'number' ? obj : undefined; + getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); +}; +imports.wbg.__wbindgen_is_null = function(arg0) { + const ret = getObject(arg0) === null; + return ret; +}; +imports.wbg.__wbindgen_boolean_get = function(arg0) { + const v = getObject(arg0); + const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; + return ret; +}; +imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; +}; +imports.wbg.__wbg_crypto_d05b68a3572bb8ca = function(arg0) { + const ret = getObject(arg0).crypto; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_is_object = function(arg0) { + const val = getObject(arg0); + const ret = typeof(val) === 'object' && val !== null; + return ret; +}; +imports.wbg.__wbg_process_b02b3570280d0366 = function(arg0) { + const ret = getObject(arg0).process; + return addHeapObject(ret); +}; +imports.wbg.__wbg_versions_c1cb42213cedf0f5 = function(arg0) { + const ret = getObject(arg0).versions; + return addHeapObject(ret); +}; +imports.wbg.__wbg_node_43b1089f407e4ec2 = function(arg0) { + const ret = getObject(arg0).node; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_is_string = function(arg0) { + const ret = typeof(getObject(arg0)) === 'string'; + return ret; +}; +imports.wbg.__wbg_require_9a7e0f667ead4995 = function() { return handleError(function () { + const ret = module.require; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_msCrypto_10fc94afee92bd76 = function(arg0) { + const ret = getObject(arg0).msCrypto; + return addHeapObject(ret); +}; +imports.wbg.__wbg_randomFillSync_b70ccbdf4926a99d = function() { return handleError(function (arg0, arg1) { + getObject(arg0).randomFillSync(takeObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_getRandomValues_7e42b4fb8779dc6d = function() { return handleError(function (arg0, arg1) { + getObject(arg0).getRandomValues(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbindgen_is_falsy = function(arg0) { + const ret = !getObject(arg0); + return ret; +}; +imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = takeObject(arg0).original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + const ret = false; + return ret; +}; +imports.wbg.__wbg_instanceof_Window_f401953a2cf86220 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_document_5100775d18896c16 = function(arg0) { + const ret = getObject(arg0).document; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_location_2951b5ee34f19221 = function(arg0) { + const ret = getObject(arg0).location; + return addHeapObject(ret); +}; +imports.wbg.__wbg_history_bc4057de66a2015f = function() { return handleError(function (arg0) { + const ret = getObject(arg0).history; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_navigator_6c8fa55c5cc8796e = function(arg0) { + const ret = getObject(arg0).navigator; + return addHeapObject(ret); +}; +imports.wbg.__wbg_localStorage_e381d34d0c40c761 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).localStorage; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_getComputedStyle_078292ffe423aded = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).getComputedStyle(getObject(arg1)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_open_cc82b8aaf0c296c1 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + const ret = getObject(arg0).open(v0, v1); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_prompt_c80f89a5779f0504 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).prompt(v0); + var ptr2 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_scrollTo_4d970c5e1c4b340b = function(arg0, arg1, arg2) { + getObject(arg0).scrollTo(arg1, arg2); +}; +imports.wbg.__wbg_requestAnimationFrame_549258cfa66011f0 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).requestAnimationFrame(getObject(arg1)); + return ret; +}, arguments) }; +imports.wbg.__wbg_fetch_c4b6afebdb1f918e = function(arg0, arg1) { + const ret = getObject(arg0).fetch(getObject(arg1)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_setTimeout_c172d5704ef82276 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).setTimeout(getObject(arg1), arg2); + return ret; +}, arguments) }; +imports.wbg.__wbg_settitle_33da3ee844c607ef = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).title = v0; +}; +imports.wbg.__wbg_body_edb1908d3ceff3a1 = function(arg0) { + const ret = getObject(arg0).body; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_head_d7a99d3f407e2291 = function(arg0) { + const ret = getObject(arg0).head; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_createComment_354ccab4fdc521ee = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).createComment(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_createDocumentFragment_8c86903bbb0a3c3c = function(arg0) { + const ret = getObject(arg0).createDocumentFragment(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_createElement_8bae7856a4bb7411 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).createElement(v0); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_createTextNode_0c38fd80a5b2284d = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).createTextNode(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_getElementById_c369ff43f0db99cf = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).getElementById(v0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_querySelector_a5f74efc5fa193dd = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).querySelector(v0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_Element_6945fc210db80ea9 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Element; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_id_e0c4392b9418f9b0 = function(arg0, arg1) { + const ret = getObject(arg1).id; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_setclassName_9fee267eae0d8ddc = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).className = v0; +}; +imports.wbg.__wbg_classList_1f0528ee002e56d4 = function(arg0) { + const ret = getObject(arg0).classList; + return addHeapObject(ret); +}; +imports.wbg.__wbg_setscrollLeft_1d74827a003cb259 = function(arg0, arg1) { + getObject(arg0).scrollLeft = arg1; +}; +imports.wbg.__wbg_scrollWidth_d6a7a22a18226f6d = function(arg0) { + const ret = getObject(arg0).scrollWidth; + return ret; +}; +imports.wbg.__wbg_setinnerHTML_26d69b59e1af99c7 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).innerHTML = v0; +}; +imports.wbg.__wbg_children_8904f20261f6442c = function(arg0) { + const ret = getObject(arg0).children; + return addHeapObject(ret); +}; +imports.wbg.__wbg_getAttribute_99bddb29274b29b9 = function(arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getAttribute(v0); + var ptr2 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}; +imports.wbg.__wbg_getBoundingClientRect_91e6d57c4e65f745 = function(arg0) { + const ret = getObject(arg0).getBoundingClientRect(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_getElementsByTagName_ea632875268a272f = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).getElementsByTagName(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_hasAttribute_8340e1a2a46f10f3 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).hasAttribute(v0); + return ret; +}; +imports.wbg.__wbg_removeAttribute_1b10a06ae98ebbd1 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).removeAttribute(v0); +}, arguments) }; +imports.wbg.__wbg_scrollIntoView_0c1a31f3d0dce6ae = function(arg0) { + getObject(arg0).scrollIntoView(); +}; +imports.wbg.__wbg_scrollIntoView_eec424449e6c23da = function(arg0, arg1) { + getObject(arg0).scrollIntoView(getObject(arg1)); +}; +imports.wbg.__wbg_setAttribute_3c9f6c303b696daa = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + getObject(arg0).setAttribute(v0, v1); +}, arguments) }; +imports.wbg.__wbg_before_210596e44d88649f = function() { return handleError(function (arg0, arg1) { + getObject(arg0).before(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_remove_49b0a5925a04b955 = function(arg0) { + getObject(arg0).remove(); +}; +imports.wbg.__wbg_writeText_4f1bf9bc5850bc26 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).writeText(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_getPropertyValue_fa32ee1811f224cb = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getPropertyValue(v0); + const ptr2 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_removeProperty_fa6d48e2923dcfac = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).removeProperty(v0); + const ptr2 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_setProperty_ea7d15a2b591aa97 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + getObject(arg0).setProperty(v0, v1); +}, arguments) }; +imports.wbg.__wbg_top_c4e2234a035a3d25 = function(arg0) { + const ret = getObject(arg0).top; + return ret; +}; +imports.wbg.__wbg_right_4659608ec17bdea7 = function(arg0) { + const ret = getObject(arg0).right; + return ret; +}; +imports.wbg.__wbg_bottom_91d8cb531cf1afd2 = function(arg0) { + const ret = getObject(arg0).bottom; + return ret; +}; +imports.wbg.__wbg_left_fe0a839abdd508f4 = function(arg0) { + const ret = getObject(arg0).left; + return ret; +}; +imports.wbg.__wbg_target_2fc177e386c8b7b0 = function(arg0) { + const ret = getObject(arg0).target; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_defaultPrevented_cc14a1dd3dd69c38 = function(arg0) { + const ret = getObject(arg0).defaultPrevented; + return ret; +}; +imports.wbg.__wbg_cancelBubble_c0aa3172524eb03c = function(arg0) { + const ret = getObject(arg0).cancelBubble; + return ret; +}; +imports.wbg.__wbg_newwitheventinitdict_079f8f3bd3131f96 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Event(v0, getObject(arg2)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_composedPath_58473fd5ae55f2cd = function(arg0) { + const ret = getObject(arg0).composedPath(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_preventDefault_b1a4aafc79409429 = function(arg0) { + getObject(arg0).preventDefault(); +}; +imports.wbg.__wbg_stopPropagation_fa5b666049c9fd02 = function(arg0) { + getObject(arg0).stopPropagation(); +}; +imports.wbg.__wbg_instanceof_KeyboardEvent_d51b1a079e0c6a46 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof KeyboardEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_altKey_2e6c34c37088d8b1 = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; +}; +imports.wbg.__wbg_ctrlKey_bb5b6fef87339703 = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; +}; +imports.wbg.__wbg_shiftKey_5911baf439ab232b = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; +}; +imports.wbg.__wbg_metaKey_6bf4ae4e83a11278 = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; +}; +imports.wbg.__wbg_key_dccf9e8aa1315a8e = function(arg0, arg1) { + const ret = getObject(arg1).key; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_instanceof_MouseEvent_fdc007d866fdd0df = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof MouseEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_clientX_fef6bf7a6bcf41b8 = function(arg0) { + const ret = getObject(arg0).clientX; + return ret; +}; +imports.wbg.__wbg_clientY_df42f8fceab3cef2 = function(arg0) { + const ret = getObject(arg0).clientY; + return ret; +}; +imports.wbg.__wbg_ctrlKey_008695ce60a588f5 = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; +}; +imports.wbg.__wbg_shiftKey_1e76dbfcdd36a4b4 = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; +}; +imports.wbg.__wbg_altKey_07da841b54bd3ed6 = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; +}; +imports.wbg.__wbg_metaKey_86bfd3b0d3a8083f = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; +}; +imports.wbg.__wbg_button_367cdc7303e3cf9b = function(arg0) { + const ret = getObject(arg0).button; + return ret; +}; +imports.wbg.__wbg_append_7ba9d5c2eb183eea = function() { return handleError(function (arg0, arg1) { + getObject(arg0).append(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_addEventListener_53b787075bd5e003 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).addEventListener(v0, getObject(arg3)); +}, arguments) }; +imports.wbg.__wbg_addEventListener_4283b15b4f039eb5 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).addEventListener(v0, getObject(arg3), getObject(arg4)); +}, arguments) }; +imports.wbg.__wbg_dispatchEvent_63c0c01600a98fd2 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).dispatchEvent(getObject(arg1)); + return ret; +}, arguments) }; +imports.wbg.__wbg_removeEventListener_92cb9b3943463338 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).removeEventListener(v0, getObject(arg3)); +}, arguments) }; +imports.wbg.__wbg_instanceof_ShadowRoot_9db040264422e84a = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ShadowRoot; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_host_c667c7623404d6bf = function(arg0) { + const ret = getObject(arg0).host; + return addHeapObject(ret); +}; +imports.wbg.__wbg_instanceof_HtmlStyleElement_ec3ba043094b4bea = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLStyleElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_instanceof_HtmlTextAreaElement_7963188e191245be = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLTextAreaElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_value_d7f5bfbd9302c14b = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_setvalue_090972231f0a4f6f = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).value = v0; +}; +imports.wbg.__wbg_selectionStart_df926430b4a02cb5 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).selectionStart; + getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); +}, arguments) }; +imports.wbg.__wbg_selectionEnd_f223580362878477 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).selectionEnd; + getInt32Memory0()[arg0 / 4 + 1] = isLikeNone(ret) ? 0 : ret; + getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); +}, arguments) }; +imports.wbg.__wbg_setSelectionRange_681f814ff48ad6be = function() { return handleError(function (arg0, arg1, arg2) { + getObject(arg0).setSelectionRange(arg1 >>> 0, arg2 >>> 0); +}, arguments) }; +imports.wbg.__wbg_byobRequest_72fca99f9c32c193 = function(arg0) { + const ret = getObject(arg0).byobRequest; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_close_184931724d961ccc = function() { return handleError(function (arg0) { + getObject(arg0).close(); +}, arguments) }; +imports.wbg.__wbg_close_a994f9425dab445c = function() { return handleError(function (arg0) { + getObject(arg0).close(); +}, arguments) }; +imports.wbg.__wbg_enqueue_ea194723156c0cc2 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).enqueue(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_href_7bfb3b2fdc0a6c3f = function(arg0, arg1) { + const ret = getObject(arg1).href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_origin_ea68ac578fa8517a = function(arg0, arg1) { + const ret = getObject(arg1).origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_pathname_c5fe403ef9525ec6 = function(arg0, arg1) { + const ret = getObject(arg1).pathname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_search_c68f506c44be6d1e = function(arg0, arg1) { + const ret = getObject(arg1).search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_searchParams_bc5845fe67587f77 = function(arg0) { + const ret = getObject(arg0).searchParams; + return addHeapObject(ret); +}; +imports.wbg.__wbg_hash_cdea7a9b7e684a42 = function(arg0, arg1) { + const ret = getObject(arg1).hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_newwithbase_6aabbfb1b2e6a1cb = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + var v1 = getCachedStringFromWasm0(arg2, arg3); + const ret = new URL(v0, v1); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_files_a2848a7a7424820f = function(arg0) { + const ret = getObject(arg0).files; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_getData_35c5974f5cd7e02c = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getData(v0); + const ptr2 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_state_9cc3f933b7d50acb = function() { return handleError(function (arg0) { + const ret = getObject(arg0).state; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_pushState_b8e8d346f8bb33fd = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).pushState(getObject(arg1), v0, v1); +}, arguments) }; +imports.wbg.__wbg_replaceState_ec9431bea5108a50 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).replaceState(getObject(arg1), v0, v1); +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlInputElement_307512fe1252c849 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLInputElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_value_47fe6384562f52ab = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_setvalue_78cb4f1fef58ae98 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).value = v0; +}; +imports.wbg.__wbg_getItem_164e8e5265095b87 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getItem(v0); + var ptr2 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len2 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len2; + getInt32Memory0()[arg0 / 4 + 0] = ptr2; +}, arguments) }; +imports.wbg.__wbg_setItem_ba2bb41d73dac079 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + getObject(arg0).setItem(v0, v1); +}, arguments) }; +imports.wbg.__wbg_instanceof_ClipboardEvent_3fd5b713d8add4f0 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ClipboardEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_clipboardData_0427b2003659865a = function(arg0) { + const ret = getObject(arg0).clipboardData; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_instanceof_DragEvent_329fd02ae838527e = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof DragEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_dataTransfer_cef7816623bd8478 = function(arg0) { + const ret = getObject(arg0).dataTransfer; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_instanceof_InputEvent_787602aee80bca20 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof InputEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_instanceof_Node_daad148a35d38074 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Node; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_parentNode_6be3abff20e1a5fb = function(arg0) { + const ret = getObject(arg0).parentNode; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_childNodes_118168e8b23bcb9b = function(arg0) { + const ret = getObject(arg0).childNodes; + return addHeapObject(ret); +}; +imports.wbg.__wbg_previousSibling_9708a091a3e6e03b = function(arg0) { + const ret = getObject(arg0).previousSibling; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_nextSibling_709614fdb0fb7a66 = function(arg0) { + const ret = getObject(arg0).nextSibling; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_settextContent_d271bab459cbb1ba = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).textContent = v0; +}; +imports.wbg.__wbg_appendChild_580ccb11a660db68 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).appendChild(getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_cloneNode_e19c313ea20d5d1d = function() { return handleError(function (arg0) { + const ret = getObject(arg0).cloneNode(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_removeChild_96bbfefd2f5a0261 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).removeChild(getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_ProgressEvent_a612079592c18661 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ProgressEvent; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_length_4db38705d5c8ba2f = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_get_58f6d5f6aee3f846 = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_error_8e3928cfb8a43e2b = function(arg0) { + console.error(getObject(arg0)); +}; +imports.wbg.__wbg_log_5bb5f88f245d7762 = function(arg0) { + console.log(getObject(arg0)); +}; +imports.wbg.__wbg_warn_63bbae1730aead09 = function(arg0) { + console.warn(getObject(arg0)); +}; +imports.wbg.__wbg_name_f35eb93a73d94973 = function(arg0, arg1) { + const ret = getObject(arg1).name; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_sethref_b94692d1a9f05b53 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).href = v0; +}, arguments) }; +imports.wbg.__wbg_origin_ee93e29ace71f568 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).origin; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_pathname_5449afe3829f96a1 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).pathname; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_search_489f12953342ec1f = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).search; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_hash_553098e838e06c1d = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).hash; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_clipboard_45ef2514e9ece120 = function(arg0) { + const ret = getObject(arg0).clipboard; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_userAgent_e94c7cbcdac01fea = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).userAgent; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}, arguments) }; +imports.wbg.__wbg_newwithstrandinit_3fd6fba4083ff2d0 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Request(v0, getObject(arg2)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_Response_849eb93e75734b6e = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Response; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_status_61a01141acd3cf74 = function(arg0) { + const ret = getObject(arg0).status; + return ret; +}; +imports.wbg.__wbg_text_450a059667fd91fd = function() { return handleError(function (arg0) { + const ret = getObject(arg0).text(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlAnchorElement_5fc0eb2fbc8672d8 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLAnchorElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_target_f0876f510847bc60 = function(arg0, arg1) { + const ret = getObject(arg1).target; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_href_40fd5bca11c13133 = function(arg0, arg1) { + const ret = getObject(arg1).href; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_newwithsrc_ca8c671638a5c104 = function() { return handleError(function (arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Audio(v0); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlSelectElement_f0e1b0ac7b371ac0 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLSelectElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_value_47c64189244491be = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_view_7f0ce470793a340f = function(arg0) { + const ret = getObject(arg0).view; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_respond_b1a43b2e3a06d525 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).respond(arg1 >>> 0); +}, arguments) }; +imports.wbg.__wbg_add_dcb05a8ba423bdac = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).add(v0); +}, arguments) }; +imports.wbg.__wbg_remove_698118fb25ab8150 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).remove(v0); +}, arguments) }; +imports.wbg.__wbg_instanceof_FileReader_40a99278a99671fb = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof FileReader; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_result_77ceeec1e3a16df7 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).result; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_new_c1e4a76f0b5c28b8 = function() { return handleError(function () { + const ret = new FileReader(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_readAsArrayBuffer_4f4ed73c7dc0ce42 = function() { return handleError(function (arg0, arg1) { + getObject(arg0).readAsArrayBuffer(getObject(arg1)); +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlDivElement_31d3273633f69d96 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLDivElement; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_play_14d1cdf5b2b09482 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).play(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_setdata_8c2b43af041cc1b3 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).data = v0; +}; +imports.wbg.__wbg_width_b455dec2a8f76e45 = function(arg0) { + const ret = getObject(arg0).width; + return ret; +}; +imports.wbg.__wbg_length_d0a802565d17eec4 = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_length_c2d5de977172fa1a = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_item_4d089d561e1633ef = function(arg0, arg1) { + const ret = getObject(arg0).item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_setinnerText_087b7e3f90d97466 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).innerText = v0; +}; +imports.wbg.__wbg_style_c3fc3dd146182a2d = function(arg0) { + const ret = getObject(arg0).style; + return addHeapObject(ret); +}; +imports.wbg.__wbg_focus_39d4b8ba8ff9df14 = function() { return handleError(function (arg0) { + getObject(arg0).focus(); +}, arguments) }; +imports.wbg.__wbg_now_4e659b3d15f470d9 = function(arg0) { + const ret = getObject(arg0).now(); + return ret; +}; +imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) { + queueMicrotask(getObject(arg0)); +}; +imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) { + const ret = getObject(arg0).queueMicrotask; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof(getObject(arg0)) === 'function'; + return ret; +}; +imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return addHeapObject(ret); +}; +imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Function(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) { + const ret = getObject(arg0).next; + return addHeapObject(ret); +}; +imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).next(); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) { + const ret = getObject(arg0).done; + return ret; +}; +imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) { + const ret = getObject(arg0).value; + return addHeapObject(ret); +}; +imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() { + const ret = Symbol.iterator; + return addHeapObject(ret); +}; +imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) { + const ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() { + const ret = new Object(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () { + const ret = self.self; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () { + const ret = window.window; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () { + const ret = globalThis.globalThis; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () { + const ret = global.global; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_decodeURI_34e1afc7326c927c = function() { return handleError(function (arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = decodeURI(v0); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) { + const ret = Array.isArray(getObject(arg0)); + return ret; +}; +imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ArrayBuffer; + } catch (_) { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_new_28c511d9baebfa89 = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Error(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_getMonth_5a9eac2ac6ad9255 = function(arg0) { + const ret = getObject(arg0).getMonth(); + return ret; +}; +imports.wbg.__wbg_new0_7d84e5b2cd9fdc73 = function() { + const ret = new Date(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_is_010fdc0f4ab96916 = function(arg0, arg1) { + const ret = Object.is(getObject(arg0), getObject(arg1)); + return ret; +}; +imports.wbg.__wbg_exec_b9996525463e30df = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).exec(v0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_new_3c970fa9da0c5794 = function(arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + var v1 = getCachedStringFromWasm0(arg2, arg3); + const ret = new RegExp(v0, v1); + return addHeapObject(ret); +}; +imports.wbg.__wbg_new_81740750da40724f = function(arg0, arg1) { + try { + var state0 = {a: arg0, b: arg1}; + var cb0 = (arg0, arg1) => { + const a = state0.a; + state0.a = 0; + try { + return __wbg_adapter_446(a, state0.b, arg0, arg1); + } finally { + state0.a = a; + } + }; + const ret = new Promise(cb0); + return addHeapObject(ret); + } finally { + state0.a = state0.b = 0; + } +}; +imports.wbg.__wbg_resolve_b0083a7967828ec8 = function(arg0) { + const ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) { + const ret = getObject(arg0).then(getObject(arg1)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_then_a73caa9a87991566 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) { + const ret = getObject(arg0).buffer; + return addHeapObject(ret); +}; +imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) { + const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); +}; +imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) { + const ret = new Uint8Array(arg0 >>> 0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_buffer_dd7f74bc60f1faab = function(arg0) { + const ret = getObject(arg0).buffer; + return addHeapObject(ret); +}; +imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) { + const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_byteLength_58f7b4fab1919d44 = function(arg0) { + const ret = getObject(arg0).byteLength; + return ret; +}; +imports.wbg.__wbg_byteOffset_81d60f7392524f62 = function(arg0) { + const ret = getObject(arg0).byteOffset; + return ret; +}; +imports.wbg.__wbg_set_1f9b04f170055d33 = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); + return ret; +}, arguments) }; +imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; +imports.wbg.__wbindgen_rethrow = function(arg0) { + throw takeObject(arg0); +}; +imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper1623 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 665, __wbg_adapter_38); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper17834 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4300, __wbg_adapter_41); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper18020 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4340, __wbg_adapter_44); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper19751 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 4364, __wbg_adapter_47); + return addHeapObject(ret); +}; + +return imports; +} + +function __wbg_init_memory(imports, maybe_memory) { + +} + +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedFloat64Memory0 = null; + cachedInt32Memory0 = null; + cachedUint8Memory0 = null; + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + if (wasm !== undefined) return wasm; + + const imports = __wbg_get_imports(); + + __wbg_init_memory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return __wbg_finalize_init(instance, module); +} + +async function __wbg_init(input) { + if (wasm !== undefined) return wasm; + + if (typeof input === 'undefined') { + input = new URL('site_bg.wasm', import.meta.url); + } + const imports = __wbg_get_imports(); + + if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) { + input = fetch(input); + } + + __wbg_init_memory(imports); + + const { instance, module } = await __wbg_load(await input, imports); + + return __wbg_finalize_init(instance, module); +} + +export { initSync } +export default __wbg_init; diff --git a/docs/site-999ff84c3351f9f6_bg.wasm b/docs/site-999ff84c3351f9f6_bg.wasm new file mode 100644 index 00000000..d85532bf Binary files /dev/null and b/docs/site-999ff84c3351f9f6_bg.wasm differ diff --git a/docs/styles-8c6786db4b419547.css b/docs/styles-8c6786db4b419547.css new file mode 100644 index 00000000..b0e5706f --- /dev/null +++ b/docs/styles-8c6786db4b419547.css @@ -0,0 +1,1305 @@ +@font-face { + font-family: "Code Font"; + src: url(Uiua386.ttf) format("truetype"); +} + +html * { + font-family: "Segoe UI", "Arial", sans-serif; +} + +html { + font-size: 115%; + font-weight: 500; +} + +body { + margin: 0; +} + +p { + line-height: 1.5em; +} + +h2 { + margin: 1.8em 0 0.5em 0; + padding-bottom: 0.3em; + border-bottom-width: 0.08em; + border-bottom-style: solid; + border-color: #888a; +} + +.header { + position: relative; +} + +a.header, +a:visited.header, +a:link.header { + text-decoration: none; + color: inherit; +} + +a.header::before { + position: absolute; + left: -1.5em; + bottom: 0.4em; + content: "🔗"; + opacity: 0; + font-size: 0.6em; + transition: opacity 0.2s; +} + +a.header:hover::before { + opacity: 0.5; +} + +h1>a>code, +h2>a>code { + font-weight: normal; +} + +button { + border-width: 0; + border-radius: 0.5em; + padding: 0.2em; + display: inline-block; + position: relative; +} + +button:active { + transform: translateY(0.1em); +} + +code { + font-family: "Code Font", monospace; + border-radius: 0.2em; + padding: 0.2em; + position: relative; +} + +th, +td { + padding: 0.3em; + border-radius: 0.5em; +} + +th { + text-align: left; +} + +tr:nth-child(even) { + background-color: #0001; +} + +.bordered-table { + border: 0.2em solid #0005; + border-radius: 0.5em; +} + +.header-centered-table>tr>th { + text-align: center; + +} + +.cell-centered-table>tr>td { + text-align: center; +} + +li { + margin: 0.3em 0; +} + +@media (prefers-color-scheme: dark) { + + body, + #header-uiua, + .spoiler:hover { + color: #d1daec; + } + + body, + .spoiler:hover { + background-color: #141a1f; + } + + #editor { + outline: 0.1em solid #606468; + background-color: #19232d; + } + + .code, + .input-div, + input[type=text], + #settings>*>*>input, + #settings>*>*>select { + color: #d1daec; + background-color: #1d2c3a; + } + + button { + color: #d1daec; + background-color: #1d2c3a; + } + + button:hover { + background-color: #2d3c4a; + } + + a:link { + color: #6fadea; + } + + a:visited { + color: #947bec; + } + + code { + background-color: #0004; + } + + .important-button { + background-color: #33577b; + } + + .important-button:hover { + background-color: #579; + } + + .tutorial-nav>* { + background-color: #1d2c3a; + } + + tr:nth-child(even) { + background-color: #0001; + } + + .glyph-button:hover, + .combinator-diagram { + background-color: #0003; + } + + .code-entry { + caret-color: white; + } + + #subtitle { + color: #d1daecc0; + } +} + +@media (prefers-color-scheme: light) { + + body, + #header-uiua, + .spoiler:hover { + color: #344; + } + + body, + .spoiler:hover { + background-color: #c6e7ec; + } + + #editor { + background-color: #dff2f3; + outline: 0.1em solid #0004; + } + + .code, + .input-div, + input[type=text], + #settings>*>*>input, + #settings>*>*>select { + color: #344; + background-color: #f4f6f6; + } + + button { + color: #344; + background-color: #f6f8f8; + } + + button:hover { + background-color: #fdffff; + } + + a:link { + color: #0099ad; + } + + a:visited { + color: #6a4bfb; + } + + code { + background-color: #fff8; + } + + .important-button { + background-color: #aadae0; + } + + .important-button:hover { + background-color: #bee2e7; + } + + .tutorial-nav>* { + background-color: #f6f8f8; + } + + tr:nth-child(even) { + background-color: #fff1; + } + + .glyph-button:hover, + .combinator-diagram { + background-color: #fffa; + } + + .code-entry { + caret-color: black; + } + + #subtitle { + color: #344c; + } +} + +#top { + margin: 2em auto; + width: max(10em, min(90%, 53em)); +} + +#header { + display: flex; + justify-content: space-between; + align-items: last baseline; + flex-wrap: wrap; + gap: 1em; + margin-bottom: 1em; +} + + +#header-left { + display: flex; + align-items: last baseline; + margin: -1em 0; +} + +#header-uiua { + text-decoration: none; + white-space: nowrap; +} + +#subtitle { + margin-left: 1.5em; + font-size: 1em; + font-weight: bold; + font-style: italic; +} + +.spoiler { + color: #0000; + background-color: #0008; + border-radius: 0.5em; +} + +.long-subtitle { + font-size: 0.9em; +} + +.long-subtitle>div { + display: flex; + gap: 0.5em; + flex-wrap: nowrap; + white-space: nowrap; +} + +#nav { + display: flex; + gap: 1em; + flex-wrap: nowrap; + align-items: baseline; +} + +#links { + font-size: 1.2em; + display: flex; + justify-content: center; + flex-wrap: wrap; + gap: 1em; + margin-bottom: 1em; + align-content: flex-start; +} + +#links>* { + display: flex; + gap: 1em; + flex-wrap: wrap; + justify-content: space-between; + align-content: flex-start; +} + +.main-text { + font-size: 120%; + text-align: center; +} + +.wee-wuh-span { + font-size: 70%; + opacity: 0.8; +} + +.features { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + gap: min(3em, 3vw); + width: min(120%, 90vw); + margin-left: calc(-0.5 * (min(120%, 90vw) - 100%)); +} + +.features>* { + flex: 1 1 22em; + width: 0; +} + +#editor { + border-radius: 0.5em; + position: relative; +} + +#drag-message { + position: absolute; + inset: 0; + display: flex; + justify-content: center; + align-items: center; + background-color: #0008; + font-size: 2em; +} + +#editor-wrapper { + margin-bottom: 0.5em; + font-size: min(1em, 3.5vw); +} + +.small-editor { + font-size: 1.2em; +} + +.medium-editor { + font-size: 1.4em; +} + +#settings { + display: flex; + justify-content: space-between; + font-size: 0.82em; + padding: 0.2em; + gap: 0.5em; +} + +#settings>* { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.2em 1em; +} + +#settings-left { + width: 85%; + justify-content: space-between; +} + +#settings-right { + flex-direction: column; + align-items: flex-end; +} + +#settings>*>* { + display: inline-block; + white-space: nowrap; +} + +input[type=number] { + appearance: textfield; + -moz-appearance: textfield; +} + +.code-block { + display: block; + white-space: pre-wrap; + padding: 0.8em; +} + +#settings>*>*>input, +#settings>*>*>select { + border-radius: 0.5em; + border: none; + margin-left: 0.5em; +} + +#settings>*>*>input[type=number] { + width: 3em; +} + +#code-area { + position: relative; +} + +.code-outer { + text-align: left; + border-radius: 0.5em; + width: 100%; + resize: vertical; + box-sizing: border-box; + outline: none; + border: none; + padding: 0.3em; + min-height: 1.8em; + overflow-y: auto; + display: flex; + gap: 0.1em; + overflow-y: hidden; +} + +.code-and-overlay { + width: 100%; + position: relative; +} + +.code-entry { + margin: 0.1em 0 0 0; + padding: 0; + position: absolute; + outline: none; + border: none; + box-sizing: border-box; + /* background-color: #0002; */ + /* color: #0008; */ + background-color: transparent; + color: transparent; + resize: none; + font-family: "Code Font", monospace; + font-size: inherit; + line-height: 1.25em; + overflow-wrap: normal; + white-space: pre; + overflow: hidden; + height: 100%; +} + +.code-entry::selection { + color: transparent; + background-color: #0078d7; +} + +.code-overlay { + margin: 0; + padding: 0; + position: absolute; + width: 100%; + pointer-events: none; + white-space: pre; +} + +.code-line { + height: 1.25em; + padding: 0; + margin: 0; +} + +.line-numbers { + min-width: 1.5em; +} + +@media (prefers-color-scheme: dark) { + .line-numbers { + color: #3f4b5d; + } +} + +@media (prefers-color-scheme: light) { + .line-numbers { + color: #bcc9ca; + } +} + +.code-span { + font-size: 1em; + font-family: "Code Font", monospace; + white-space: pre; + text-decoration: none; +} + +.code-hover { + display: none; + position: fixed; + font-family: "Code Font", monospace; + font-size: 0.7em; + color: #eee; + background-color: #000c; + padding: 0.2em; + border-radius: 0.2em; + pointer-events: none; + z-index: 1; + text-decoration: none; + white-space: pre-wrap; + overflow: visible; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.ctrl-pressed .code-underline:hover { + text-decoration: underline; + cursor: pointer; +} + +.output-frame { + display: flex; + justify-content: space-between; + min-height: 1.9em; +} + +.output-lines { + overflow-x: auto; +} + +.output-diagnostics { + white-space: pre-wrap; + text-align: left; + margin-left: 1.75em; + padding: 0.3em 0; + font-family: "Code Font", monospace; +} + +.output-wrapper { + transform: rotateX(180deg); + overflow-x: auto; +} + +.output { + white-space: pre; + text-align: left; + margin-left: 1.85em; + padding: 0.4em 0; + font-family: "Code Font", monospace; + transform: rotateX(180deg); +} + +.output:empty, +.output-diagnostics:empty { + display: none; +} + +.output-item, +.output-report { + font-family: inherit; +} + +#code-buttons { + margin: 0.2em 0.2em 0.2em 0; + display: flex; + flex-wrap: nowrap; + right: 0; + max-height: 1.5em; +} + +.code-button { + font-size: 0.9em; + margin: 0 0 0 0.2em; + height: auto; + text-align: center; + text-justify: center; +} + +.important-button { + animation: fadeAnimation 2s infinite; +} + +.output-line { + font-family: "Code Font", monospace; + font-size: inherit; + white-space: pre; +} + +.output-wrap-line { + white-space: pre-wrap; +} + +.output-report { + font-size: 0.89em; +} + +.output-error { + color: #f44; +} + +.output-warning { + color: #fb0; +} + +.output-advice { + color: #2af; +} + +.output-style { + color: #0a0; +} + +.output-info { + color: #1cf; +} + +.output-faint { + opacity: 0.75; +} + +.output-fainter { + opacity: 0.55; +} + +.output-image { + border-radius: 0.5em; + max-width: 50vw; +} + +.output-audio { + border-radius: 0.5em; + max-width: 50vw; +} + +#code-right-side { + display: flex; + position: absolute; + top: 0.1em; + right: 0.2em; + padding-right: 0.3em; + font-size: min(1em, 3vw); + align-items: center; +} + +#glyphs-toggle-button { + font-weight: bolder; + font-size: 0.9em; +} + +#glyphs-toggle-button:hover:after { + font-size: 0.6em; +} + +.editor-right-button { + font-weight: bolder; + opacity: 0.5; +} + +.editor-right-button:hover { + opacity: 1; +} + +.info-button:hover::after, +.editor-right-button:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 1em; + left: calc(-8em - 50%); + bottom: 1.5em; + color: #eee; + padding: 0.2em; + border-radius: 0.2em; + pointer-events: none; +} + +.editor-right-button:hover::after { + background-color: #000b; + width: 8em; +} + +.info-button:hover::after { + background-color: #000d; + width: 24em; + white-space: pre-wrap; + text-align: left; +} + +#example-tracker { + margin-left: 0.5em; + font-size: 0.8em; +} + +.glyph-buttons { + padding: 0.1em; + font-size: 1.4em; + display: flex; + flex-wrap: wrap; + justify-content: space-evenly; + align-items: baseline; +} + +.glyph-button { + font-family: "Code Font", monospace; + font-size: 0.88em; + padding: 0.05em; + margin: 0em; + background-color: transparent; +} + +.glyph-button:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 0.7em; + bottom: 100%; + color: #eee; + background-color: #000a; + padding: 0.1em; + border-radius: 0.2em; + left: -1em; + width: 7em; + pointer-events: none; + z-index: 1; + white-space: pre-wrap; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.experimental-glyph-button { + display: none; +} + +.prim-code-a { + text-decoration: none; + white-space: nowrap; +} + +.prim-glyph { + font-weight: 400; +} + +.prim-code:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 0.8em; + bottom: 100%; + color: #eee; + background-color: #000d; + padding: 0.2em; + border-radius: 0.2em; + left: 0; + pointer-events: none; + width: 10em; + text-decoration: none; + white-space: pre-wrap; + overflow: visible; + line-height: 1em; + z-index: 1; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.glyph-doc { + position: absolute; + top: min(10%, 1em); + left: 10%; + padding: 0.5em; + font-size: 0.75em; + border-radius: 0.5em; + max-width: 80%; + white-space: pre-wrap; + font-family: "Code Font", monospace; + z-index: 1; +} + +@media (prefers-color-scheme: dark) { + + .glyph-doc { + background-color: #000c; + } + + .glyph-doc-ctrl-click { + color: #aaa; + } +} + +@media (prefers-color-scheme: light) { + + .glyph-doc { + background-color: #fffd; + } + + .glyph-doc-ctrl-click { + color: #777; + } +} + +.glyph-doc-ctrl-click { + font-size: 0.7em; +} + +.code-font { + font-family: "Code Font", monospace; +} + +.combinator-diagram { + border-radius: 0.5em; + height: 8em; +} + +@media (prefers-color-scheme: dark) { + .stack-function { + color: #d1daec; + } +} + +@media (prefers-color-scheme: light) { + .stack-function { + color: #344; + } +} + +.private-binding>* { + opacity: 0.75; +} + +.module { + color: #d7be8c; +} + +.noadic-function { + color: #ed5e6a; +} + +.monadic-function { + color: #95d16a; +} + +.dyadic-function { + color: #54b0fc; +} + +.triadic-function { + color: #8078f1; +} + +.tetradic-function { + color: #f576d8; +} + +.variadic-function { + background-image: linear-gradient(170deg, + #ed5e6a 34%, + #95d16a 34%, + #95d16a 45%, + #54b0fc 45%, + #54b0fc 56%, + #8078f1 56%, + #8078f1 67%, + #f576d8 67%); +} + +.monadic-modifier { + color: #f0c36f; +} + +.dyadic-modifier { + color: #cc6be9; +} + +.triadic-modifier { + color: #F5A9B8 +} + +.space-character { + border-width: 2px; + border-radius: 0.3em; + border-style: dashed; + margin: 0 -2px; +} + +@media (prefers-color-scheme: dark) { + .string-literal-span { + color: #20f9fc; + } + + .space-character { + border-color: #20f9fc80; + } + + .strand-span { + color: #fff8; + } +} + +@media (prefers-color-scheme: light) { + .string-literal-span { + color: #1c9; + } + + .space-character { + border-color: #1c98; + } + + .strand-span { + color: #0008; + } +} + +.number-literal { + color: #f85; +} + + +.comment-span { + color: #888; +} + +@media (prefers-color-scheme: dark) { + .output-a { + color: #cff; + } + + .output-b { + color: #ccf; + } + + .output-c { + color: #fcf; + } + + .output-d { + color: #fcc; + } + + .output-e { + color: #ffc; + } + + .output-f { + color: #cfc; + } +} + +@media (prefers-color-scheme: light) { + + .output-a { + color: #225; + } + + .output-b { + color: #525; + } + + .output-c { + color: #522; + } + + .output-d { + color: #552; + } + + .output-e { + color: #252; + } + + .output-f { + color: #255; + } +} + +#editor-help { + margin: 0.4em 0 0 0; + font-size: 1em; + opacity: 0.5; + display: flex; + justify-content: space-between; + gap: 0.5em; +} + +#editor-help:empty { + display: none; +} + +#editor-help>* { + line-height: 1em; + margin: 0; + white-space: pre-wrap; +} + +.sound-button { + background-color: transparent; +} + +.tutorial-nav { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 1.1em; + gap: 0.5em; +} + +.tutorial-nav>* { + border-radius: 0.5em; + border-color: #0003; + border-radius: 0.5em; + padding: 0.5em; +} + +.tutorial-nav>*:empty { + background-color: #0000; +} + +.primitive-list { + display: flex; + flex-wrap: wrap; + flex-direction: column; +} + +.primitive-list>* { + margin-bottom: 0.5em; +} + +#ascii-glyphs { + display: flex; + justify-content: space-evenly; + flex-wrap: wrap; +} + +.input-div { + display: flex; + align-items: center; + font-size: 1em; + border-radius: 0.5em; + padding: 0.5em; + width: min(100%, max(30%, 22em)); +} + +input[type=text] { + font-size: 1em; + border-radius: 0.5em; + padding: 0 0.5em; + outline: none; + border: none; + width: 100%; +} + +#function-search { + scroll-margin-top: 1em; + scroll-margin-bottom: 1em; +} + +#function-search-wrapper { + display: flex; + justify-content: space-between; + align-items: center; +} + +.running-text { + animation: fadeAnimation 1s infinite; +} + +.slow-pulse { + animation: pulseAnimation 2s infinite; +} + +@keyframes fadeAnimation { + + 0%, + 100% { + opacity: 0.5; + } + + 50% { + opacity: 1; + } +} + + +@keyframes pulseAnimation { + + 0%, + 100% { + transform: scale(1) translate(0); + } + + 50% { + transform: scale(1, 1.1) translate(0, -0.05em); + } +} + +.uiuism-item { + display: flex; + justify-content: space-between; + align-items: center; +} + +.pls-no-block { + font-size: 0.7em; +} + +a.clean { + text-decoration: none; +} + +.experimental { + color: #db2; +} + +.text-gradient { + background-size: 100%; + background-clip: text; + -webkit-background-clip: text; + -moz-background-clip: text; + -webkit-text-fill-color: transparent; + -moz-text-fill-color: transparent; +} + +.trans { + background-image: linear-gradient(180deg, + #5BCEFA 34%, + #F5A9B8 34%, + #F5A9B8 45%, + #FFFFFF 45%, + #FFFFFF 56%, + #F5A9B8 56%, + #F5A9B8 67%, + #5BCEFA 67%); +} + +.bi { + background-image: linear-gradient(180deg, + #D60270 45%, + #9B4F96 45%, + #9B4F96 64%, + #0038A8 64%); +} + +.pan { + background-image: linear-gradient(180deg, + #FF218C 45%, + #FFD800 45%, + #FFD800 64%, + #21B1FF 64%); +} + +.gay { + background-image: linear-gradient(180deg, + #E40303 30%, + #FFA52C 30%, + #FFA52C 40%, + #FFFF41 40%, + #FFFF41 50%, + #008018 50%, + #008018 60%, + #0000F9 60%, + #0000F9 70%, + #86007D 70%); +} + +.ace { + background-image: linear-gradient(180deg, + #000000 30%, + #A3A3A3 30%, + #A3A3A3 50%, + #FFFFFF 50%, + #FFFFFF 70%, + #800080 70%); +} + +.aro { + background-image: linear-gradient(180deg, + #000000 36%, + #A9A9A9 36%, + #A9A9A9 47%, + #FFFFFF 47%, + #FFFFFF 58%, + #A7D379 58%, + #A7D379 69%, + #3DA542 69%); + +} + +.aroace { + background-image: linear-gradient(180deg, + #ef9007 36%, + #f6d317 36%, + #f6d317 47%, + #FFFFFF 47%, + #FFFFFF 58%, + #45bcee 58%, + #45bcee 69%, + #1e3f54 69%); + +} + +.nb { + background-image: linear-gradient(180deg, + #FCF434 30%, + #FFFFFF 30%, + #FFFFFF 50%, + #9C59D1 50%, + #9C59D1 70%, + #2C2C2C 70%); +} + +.fluid { + background-image: linear-gradient(180deg, + #FF76A4 36%, + #FFFFFF 36%, + #FFFFFF 47%, + #C011D7 47%, + #C011D7 58%, + #000000 58%, + #000000 69%, + #2F3CBE 69%); +} + +.queer { + background-image: linear-gradient(180deg, + #B57EDC 48%, + #FFFFFF 48%, + #FFFFFF 65%, + #4A8123 65%); +} + +.lesbian { + background-image: linear-gradient(180deg, + #d42c00 34%, + #fd9855 34%, + #fd9855 45%, + #FFFFFF 45%, + #FFFFFF 56%, + #d161a2 56%, + #d161a2 67%, + #a20161 67%); +} + +@media (prefers-color-scheme: light) { + + .trans, + .bi, + .pan, + .ace, + .aro, + .aroace, + .gay, + .nb, + .fluid, + .queer { + -webkit-text-stroke: 0.01em #000; + } +} + +@media (prefers-color-scheme: dark) { + + .bi, + .nb, + .ace, + .aro, + .aroace, + .fluid { + -webkit-text-stroke: 0.01em #fff8; + } +} \ No newline at end of file diff --git a/docs/styles.css b/docs/styles.css new file mode 100644 index 00000000..b0e5706f --- /dev/null +++ b/docs/styles.css @@ -0,0 +1,1305 @@ +@font-face { + font-family: "Code Font"; + src: url(Uiua386.ttf) format("truetype"); +} + +html * { + font-family: "Segoe UI", "Arial", sans-serif; +} + +html { + font-size: 115%; + font-weight: 500; +} + +body { + margin: 0; +} + +p { + line-height: 1.5em; +} + +h2 { + margin: 1.8em 0 0.5em 0; + padding-bottom: 0.3em; + border-bottom-width: 0.08em; + border-bottom-style: solid; + border-color: #888a; +} + +.header { + position: relative; +} + +a.header, +a:visited.header, +a:link.header { + text-decoration: none; + color: inherit; +} + +a.header::before { + position: absolute; + left: -1.5em; + bottom: 0.4em; + content: "🔗"; + opacity: 0; + font-size: 0.6em; + transition: opacity 0.2s; +} + +a.header:hover::before { + opacity: 0.5; +} + +h1>a>code, +h2>a>code { + font-weight: normal; +} + +button { + border-width: 0; + border-radius: 0.5em; + padding: 0.2em; + display: inline-block; + position: relative; +} + +button:active { + transform: translateY(0.1em); +} + +code { + font-family: "Code Font", monospace; + border-radius: 0.2em; + padding: 0.2em; + position: relative; +} + +th, +td { + padding: 0.3em; + border-radius: 0.5em; +} + +th { + text-align: left; +} + +tr:nth-child(even) { + background-color: #0001; +} + +.bordered-table { + border: 0.2em solid #0005; + border-radius: 0.5em; +} + +.header-centered-table>tr>th { + text-align: center; + +} + +.cell-centered-table>tr>td { + text-align: center; +} + +li { + margin: 0.3em 0; +} + +@media (prefers-color-scheme: dark) { + + body, + #header-uiua, + .spoiler:hover { + color: #d1daec; + } + + body, + .spoiler:hover { + background-color: #141a1f; + } + + #editor { + outline: 0.1em solid #606468; + background-color: #19232d; + } + + .code, + .input-div, + input[type=text], + #settings>*>*>input, + #settings>*>*>select { + color: #d1daec; + background-color: #1d2c3a; + } + + button { + color: #d1daec; + background-color: #1d2c3a; + } + + button:hover { + background-color: #2d3c4a; + } + + a:link { + color: #6fadea; + } + + a:visited { + color: #947bec; + } + + code { + background-color: #0004; + } + + .important-button { + background-color: #33577b; + } + + .important-button:hover { + background-color: #579; + } + + .tutorial-nav>* { + background-color: #1d2c3a; + } + + tr:nth-child(even) { + background-color: #0001; + } + + .glyph-button:hover, + .combinator-diagram { + background-color: #0003; + } + + .code-entry { + caret-color: white; + } + + #subtitle { + color: #d1daecc0; + } +} + +@media (prefers-color-scheme: light) { + + body, + #header-uiua, + .spoiler:hover { + color: #344; + } + + body, + .spoiler:hover { + background-color: #c6e7ec; + } + + #editor { + background-color: #dff2f3; + outline: 0.1em solid #0004; + } + + .code, + .input-div, + input[type=text], + #settings>*>*>input, + #settings>*>*>select { + color: #344; + background-color: #f4f6f6; + } + + button { + color: #344; + background-color: #f6f8f8; + } + + button:hover { + background-color: #fdffff; + } + + a:link { + color: #0099ad; + } + + a:visited { + color: #6a4bfb; + } + + code { + background-color: #fff8; + } + + .important-button { + background-color: #aadae0; + } + + .important-button:hover { + background-color: #bee2e7; + } + + .tutorial-nav>* { + background-color: #f6f8f8; + } + + tr:nth-child(even) { + background-color: #fff1; + } + + .glyph-button:hover, + .combinator-diagram { + background-color: #fffa; + } + + .code-entry { + caret-color: black; + } + + #subtitle { + color: #344c; + } +} + +#top { + margin: 2em auto; + width: max(10em, min(90%, 53em)); +} + +#header { + display: flex; + justify-content: space-between; + align-items: last baseline; + flex-wrap: wrap; + gap: 1em; + margin-bottom: 1em; +} + + +#header-left { + display: flex; + align-items: last baseline; + margin: -1em 0; +} + +#header-uiua { + text-decoration: none; + white-space: nowrap; +} + +#subtitle { + margin-left: 1.5em; + font-size: 1em; + font-weight: bold; + font-style: italic; +} + +.spoiler { + color: #0000; + background-color: #0008; + border-radius: 0.5em; +} + +.long-subtitle { + font-size: 0.9em; +} + +.long-subtitle>div { + display: flex; + gap: 0.5em; + flex-wrap: nowrap; + white-space: nowrap; +} + +#nav { + display: flex; + gap: 1em; + flex-wrap: nowrap; + align-items: baseline; +} + +#links { + font-size: 1.2em; + display: flex; + justify-content: center; + flex-wrap: wrap; + gap: 1em; + margin-bottom: 1em; + align-content: flex-start; +} + +#links>* { + display: flex; + gap: 1em; + flex-wrap: wrap; + justify-content: space-between; + align-content: flex-start; +} + +.main-text { + font-size: 120%; + text-align: center; +} + +.wee-wuh-span { + font-size: 70%; + opacity: 0.8; +} + +.features { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + gap: min(3em, 3vw); + width: min(120%, 90vw); + margin-left: calc(-0.5 * (min(120%, 90vw) - 100%)); +} + +.features>* { + flex: 1 1 22em; + width: 0; +} + +#editor { + border-radius: 0.5em; + position: relative; +} + +#drag-message { + position: absolute; + inset: 0; + display: flex; + justify-content: center; + align-items: center; + background-color: #0008; + font-size: 2em; +} + +#editor-wrapper { + margin-bottom: 0.5em; + font-size: min(1em, 3.5vw); +} + +.small-editor { + font-size: 1.2em; +} + +.medium-editor { + font-size: 1.4em; +} + +#settings { + display: flex; + justify-content: space-between; + font-size: 0.82em; + padding: 0.2em; + gap: 0.5em; +} + +#settings>* { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 0.2em 1em; +} + +#settings-left { + width: 85%; + justify-content: space-between; +} + +#settings-right { + flex-direction: column; + align-items: flex-end; +} + +#settings>*>* { + display: inline-block; + white-space: nowrap; +} + +input[type=number] { + appearance: textfield; + -moz-appearance: textfield; +} + +.code-block { + display: block; + white-space: pre-wrap; + padding: 0.8em; +} + +#settings>*>*>input, +#settings>*>*>select { + border-radius: 0.5em; + border: none; + margin-left: 0.5em; +} + +#settings>*>*>input[type=number] { + width: 3em; +} + +#code-area { + position: relative; +} + +.code-outer { + text-align: left; + border-radius: 0.5em; + width: 100%; + resize: vertical; + box-sizing: border-box; + outline: none; + border: none; + padding: 0.3em; + min-height: 1.8em; + overflow-y: auto; + display: flex; + gap: 0.1em; + overflow-y: hidden; +} + +.code-and-overlay { + width: 100%; + position: relative; +} + +.code-entry { + margin: 0.1em 0 0 0; + padding: 0; + position: absolute; + outline: none; + border: none; + box-sizing: border-box; + /* background-color: #0002; */ + /* color: #0008; */ + background-color: transparent; + color: transparent; + resize: none; + font-family: "Code Font", monospace; + font-size: inherit; + line-height: 1.25em; + overflow-wrap: normal; + white-space: pre; + overflow: hidden; + height: 100%; +} + +.code-entry::selection { + color: transparent; + background-color: #0078d7; +} + +.code-overlay { + margin: 0; + padding: 0; + position: absolute; + width: 100%; + pointer-events: none; + white-space: pre; +} + +.code-line { + height: 1.25em; + padding: 0; + margin: 0; +} + +.line-numbers { + min-width: 1.5em; +} + +@media (prefers-color-scheme: dark) { + .line-numbers { + color: #3f4b5d; + } +} + +@media (prefers-color-scheme: light) { + .line-numbers { + color: #bcc9ca; + } +} + +.code-span { + font-size: 1em; + font-family: "Code Font", monospace; + white-space: pre; + text-decoration: none; +} + +.code-hover { + display: none; + position: fixed; + font-family: "Code Font", monospace; + font-size: 0.7em; + color: #eee; + background-color: #000c; + padding: 0.2em; + border-radius: 0.2em; + pointer-events: none; + z-index: 1; + text-decoration: none; + white-space: pre-wrap; + overflow: visible; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.ctrl-pressed .code-underline:hover { + text-decoration: underline; + cursor: pointer; +} + +.output-frame { + display: flex; + justify-content: space-between; + min-height: 1.9em; +} + +.output-lines { + overflow-x: auto; +} + +.output-diagnostics { + white-space: pre-wrap; + text-align: left; + margin-left: 1.75em; + padding: 0.3em 0; + font-family: "Code Font", monospace; +} + +.output-wrapper { + transform: rotateX(180deg); + overflow-x: auto; +} + +.output { + white-space: pre; + text-align: left; + margin-left: 1.85em; + padding: 0.4em 0; + font-family: "Code Font", monospace; + transform: rotateX(180deg); +} + +.output:empty, +.output-diagnostics:empty { + display: none; +} + +.output-item, +.output-report { + font-family: inherit; +} + +#code-buttons { + margin: 0.2em 0.2em 0.2em 0; + display: flex; + flex-wrap: nowrap; + right: 0; + max-height: 1.5em; +} + +.code-button { + font-size: 0.9em; + margin: 0 0 0 0.2em; + height: auto; + text-align: center; + text-justify: center; +} + +.important-button { + animation: fadeAnimation 2s infinite; +} + +.output-line { + font-family: "Code Font", monospace; + font-size: inherit; + white-space: pre; +} + +.output-wrap-line { + white-space: pre-wrap; +} + +.output-report { + font-size: 0.89em; +} + +.output-error { + color: #f44; +} + +.output-warning { + color: #fb0; +} + +.output-advice { + color: #2af; +} + +.output-style { + color: #0a0; +} + +.output-info { + color: #1cf; +} + +.output-faint { + opacity: 0.75; +} + +.output-fainter { + opacity: 0.55; +} + +.output-image { + border-radius: 0.5em; + max-width: 50vw; +} + +.output-audio { + border-radius: 0.5em; + max-width: 50vw; +} + +#code-right-side { + display: flex; + position: absolute; + top: 0.1em; + right: 0.2em; + padding-right: 0.3em; + font-size: min(1em, 3vw); + align-items: center; +} + +#glyphs-toggle-button { + font-weight: bolder; + font-size: 0.9em; +} + +#glyphs-toggle-button:hover:after { + font-size: 0.6em; +} + +.editor-right-button { + font-weight: bolder; + opacity: 0.5; +} + +.editor-right-button:hover { + opacity: 1; +} + +.info-button:hover::after, +.editor-right-button:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 1em; + left: calc(-8em - 50%); + bottom: 1.5em; + color: #eee; + padding: 0.2em; + border-radius: 0.2em; + pointer-events: none; +} + +.editor-right-button:hover::after { + background-color: #000b; + width: 8em; +} + +.info-button:hover::after { + background-color: #000d; + width: 24em; + white-space: pre-wrap; + text-align: left; +} + +#example-tracker { + margin-left: 0.5em; + font-size: 0.8em; +} + +.glyph-buttons { + padding: 0.1em; + font-size: 1.4em; + display: flex; + flex-wrap: wrap; + justify-content: space-evenly; + align-items: baseline; +} + +.glyph-button { + font-family: "Code Font", monospace; + font-size: 0.88em; + padding: 0.05em; + margin: 0em; + background-color: transparent; +} + +.glyph-button:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 0.7em; + bottom: 100%; + color: #eee; + background-color: #000a; + padding: 0.1em; + border-radius: 0.2em; + left: -1em; + width: 7em; + pointer-events: none; + z-index: 1; + white-space: pre-wrap; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.experimental-glyph-button { + display: none; +} + +.prim-code-a { + text-decoration: none; + white-space: nowrap; +} + +.prim-glyph { + font-weight: 400; +} + +.prim-code:hover::after { + content: attr(data-title); + position: absolute; + font-family: "Code Font", monospace; + font-size: 0.8em; + bottom: 100%; + color: #eee; + background-color: #000d; + padding: 0.2em; + border-radius: 0.2em; + left: 0; + pointer-events: none; + width: 10em; + text-decoration: none; + white-space: pre-wrap; + overflow: visible; + line-height: 1em; + z-index: 1; + -webkit-text-fill-color: #eee; + -moz-text-fill-color: #eee; +} + +.glyph-doc { + position: absolute; + top: min(10%, 1em); + left: 10%; + padding: 0.5em; + font-size: 0.75em; + border-radius: 0.5em; + max-width: 80%; + white-space: pre-wrap; + font-family: "Code Font", monospace; + z-index: 1; +} + +@media (prefers-color-scheme: dark) { + + .glyph-doc { + background-color: #000c; + } + + .glyph-doc-ctrl-click { + color: #aaa; + } +} + +@media (prefers-color-scheme: light) { + + .glyph-doc { + background-color: #fffd; + } + + .glyph-doc-ctrl-click { + color: #777; + } +} + +.glyph-doc-ctrl-click { + font-size: 0.7em; +} + +.code-font { + font-family: "Code Font", monospace; +} + +.combinator-diagram { + border-radius: 0.5em; + height: 8em; +} + +@media (prefers-color-scheme: dark) { + .stack-function { + color: #d1daec; + } +} + +@media (prefers-color-scheme: light) { + .stack-function { + color: #344; + } +} + +.private-binding>* { + opacity: 0.75; +} + +.module { + color: #d7be8c; +} + +.noadic-function { + color: #ed5e6a; +} + +.monadic-function { + color: #95d16a; +} + +.dyadic-function { + color: #54b0fc; +} + +.triadic-function { + color: #8078f1; +} + +.tetradic-function { + color: #f576d8; +} + +.variadic-function { + background-image: linear-gradient(170deg, + #ed5e6a 34%, + #95d16a 34%, + #95d16a 45%, + #54b0fc 45%, + #54b0fc 56%, + #8078f1 56%, + #8078f1 67%, + #f576d8 67%); +} + +.monadic-modifier { + color: #f0c36f; +} + +.dyadic-modifier { + color: #cc6be9; +} + +.triadic-modifier { + color: #F5A9B8 +} + +.space-character { + border-width: 2px; + border-radius: 0.3em; + border-style: dashed; + margin: 0 -2px; +} + +@media (prefers-color-scheme: dark) { + .string-literal-span { + color: #20f9fc; + } + + .space-character { + border-color: #20f9fc80; + } + + .strand-span { + color: #fff8; + } +} + +@media (prefers-color-scheme: light) { + .string-literal-span { + color: #1c9; + } + + .space-character { + border-color: #1c98; + } + + .strand-span { + color: #0008; + } +} + +.number-literal { + color: #f85; +} + + +.comment-span { + color: #888; +} + +@media (prefers-color-scheme: dark) { + .output-a { + color: #cff; + } + + .output-b { + color: #ccf; + } + + .output-c { + color: #fcf; + } + + .output-d { + color: #fcc; + } + + .output-e { + color: #ffc; + } + + .output-f { + color: #cfc; + } +} + +@media (prefers-color-scheme: light) { + + .output-a { + color: #225; + } + + .output-b { + color: #525; + } + + .output-c { + color: #522; + } + + .output-d { + color: #552; + } + + .output-e { + color: #252; + } + + .output-f { + color: #255; + } +} + +#editor-help { + margin: 0.4em 0 0 0; + font-size: 1em; + opacity: 0.5; + display: flex; + justify-content: space-between; + gap: 0.5em; +} + +#editor-help:empty { + display: none; +} + +#editor-help>* { + line-height: 1em; + margin: 0; + white-space: pre-wrap; +} + +.sound-button { + background-color: transparent; +} + +.tutorial-nav { + display: flex; + justify-content: space-between; + align-items: center; + font-size: 1.1em; + gap: 0.5em; +} + +.tutorial-nav>* { + border-radius: 0.5em; + border-color: #0003; + border-radius: 0.5em; + padding: 0.5em; +} + +.tutorial-nav>*:empty { + background-color: #0000; +} + +.primitive-list { + display: flex; + flex-wrap: wrap; + flex-direction: column; +} + +.primitive-list>* { + margin-bottom: 0.5em; +} + +#ascii-glyphs { + display: flex; + justify-content: space-evenly; + flex-wrap: wrap; +} + +.input-div { + display: flex; + align-items: center; + font-size: 1em; + border-radius: 0.5em; + padding: 0.5em; + width: min(100%, max(30%, 22em)); +} + +input[type=text] { + font-size: 1em; + border-radius: 0.5em; + padding: 0 0.5em; + outline: none; + border: none; + width: 100%; +} + +#function-search { + scroll-margin-top: 1em; + scroll-margin-bottom: 1em; +} + +#function-search-wrapper { + display: flex; + justify-content: space-between; + align-items: center; +} + +.running-text { + animation: fadeAnimation 1s infinite; +} + +.slow-pulse { + animation: pulseAnimation 2s infinite; +} + +@keyframes fadeAnimation { + + 0%, + 100% { + opacity: 0.5; + } + + 50% { + opacity: 1; + } +} + + +@keyframes pulseAnimation { + + 0%, + 100% { + transform: scale(1) translate(0); + } + + 50% { + transform: scale(1, 1.1) translate(0, -0.05em); + } +} + +.uiuism-item { + display: flex; + justify-content: space-between; + align-items: center; +} + +.pls-no-block { + font-size: 0.7em; +} + +a.clean { + text-decoration: none; +} + +.experimental { + color: #db2; +} + +.text-gradient { + background-size: 100%; + background-clip: text; + -webkit-background-clip: text; + -moz-background-clip: text; + -webkit-text-fill-color: transparent; + -moz-text-fill-color: transparent; +} + +.trans { + background-image: linear-gradient(180deg, + #5BCEFA 34%, + #F5A9B8 34%, + #F5A9B8 45%, + #FFFFFF 45%, + #FFFFFF 56%, + #F5A9B8 56%, + #F5A9B8 67%, + #5BCEFA 67%); +} + +.bi { + background-image: linear-gradient(180deg, + #D60270 45%, + #9B4F96 45%, + #9B4F96 64%, + #0038A8 64%); +} + +.pan { + background-image: linear-gradient(180deg, + #FF218C 45%, + #FFD800 45%, + #FFD800 64%, + #21B1FF 64%); +} + +.gay { + background-image: linear-gradient(180deg, + #E40303 30%, + #FFA52C 30%, + #FFA52C 40%, + #FFFF41 40%, + #FFFF41 50%, + #008018 50%, + #008018 60%, + #0000F9 60%, + #0000F9 70%, + #86007D 70%); +} + +.ace { + background-image: linear-gradient(180deg, + #000000 30%, + #A3A3A3 30%, + #A3A3A3 50%, + #FFFFFF 50%, + #FFFFFF 70%, + #800080 70%); +} + +.aro { + background-image: linear-gradient(180deg, + #000000 36%, + #A9A9A9 36%, + #A9A9A9 47%, + #FFFFFF 47%, + #FFFFFF 58%, + #A7D379 58%, + #A7D379 69%, + #3DA542 69%); + +} + +.aroace { + background-image: linear-gradient(180deg, + #ef9007 36%, + #f6d317 36%, + #f6d317 47%, + #FFFFFF 47%, + #FFFFFF 58%, + #45bcee 58%, + #45bcee 69%, + #1e3f54 69%); + +} + +.nb { + background-image: linear-gradient(180deg, + #FCF434 30%, + #FFFFFF 30%, + #FFFFFF 50%, + #9C59D1 50%, + #9C59D1 70%, + #2C2C2C 70%); +} + +.fluid { + background-image: linear-gradient(180deg, + #FF76A4 36%, + #FFFFFF 36%, + #FFFFFF 47%, + #C011D7 47%, + #C011D7 58%, + #000000 58%, + #000000 69%, + #2F3CBE 69%); +} + +.queer { + background-image: linear-gradient(180deg, + #B57EDC 48%, + #FFFFFF 48%, + #FFFFFF 65%, + #4A8123 65%); +} + +.lesbian { + background-image: linear-gradient(180deg, + #d42c00 34%, + #fd9855 34%, + #fd9855 45%, + #FFFFFF 45%, + #FFFFFF 56%, + #d161a2 56%, + #d161a2 67%, + #a20161 67%); +} + +@media (prefers-color-scheme: light) { + + .trans, + .bi, + .pan, + .ace, + .aro, + .aroace, + .gay, + .nb, + .fluid, + .queer { + -webkit-text-stroke: 0.01em #000; + } +} + +@media (prefers-color-scheme: dark) { + + .bi, + .nb, + .ace, + .aro, + .aroace, + .fluid { + -webkit-text-stroke: 0.01em #fff8; + } +} \ No newline at end of file diff --git a/docs/text/experimental.md b/docs/text/experimental.md new file mode 100644 index 00000000..167870b7 --- /dev/null +++ b/docs/text/experimental.md @@ -0,0 +1,61 @@ +## Stack Swizzles + +Stack swizzles allow you to reorder the stack in a concise way. +They are written with a `λ` followed by some letters. +The `λ` will format from `'` if followed by letters. + +```uiua +# Experimental! +[λcba 1 2 3 4 5] +[λbbbbba 1 2] +[λccaabb 1 2 3] +``` + +Captial letters [`fix`]() the corresponding value. + +```uiua +# Experimental! +{λaCb 1_2_3 4_5_6 7_8_9} +``` + +## Array Swizzles + +Array swizzles allow you to extract rows from an array in a concise way. +They are written with a `⋊` followed by some letters. +The `⋊` will format from `''` if followed by letters. +Letters up to `m` start from the first row, Letters back from `z` start from the last row. + +```uiua +# Experimental! +[⋊az] [1 2 3 4 5] +[⋊acb] [1 2 3] +``` + +Capital letters `un` `box` the corresponding value. + +```uiua +# Experimental! +⋊CbBa {1 2_3 "hi!"} +``` + +## Labels + +Labels are a way to give names to values. This is to aid in readability and debugging. + +Labels are written with a `$` followed by some letters. + +```uiua +# Experimental! +$foo 1 $bar [2 3 4] +$baz "hi!" +``` + +Labeled values put in an array will lose their labels unless they are [`box`]()ed. + +```uiua +# Experimental! +[$a 1 $b 2 $c 3] +{$a 1 $b 2 $c 3} +``` + +Labels cannot be inspected by code. diff --git a/docs/text/files_and_streams.md b/docs/text/files_and_streams.md new file mode 100644 index 00000000..4757a0b5 --- /dev/null +++ b/docs/text/files_and_streams.md @@ -0,0 +1,104 @@ +# Files and Streams + +Uiua has support for reading and writing files from the filesystem. It has helper functions for reading and writing entire files, as well as a stream abstraction for processing files in chunks. This stream abstraction extends to other input/output sources, such as network sockets. + +## Reading and Writing Entire Files + +Loading an entire file into an array is very simple. +For demonstration purposes, this website has a built-in file called `example.txt` that we will work with. + +We can read an entire file as a string with [`&fras`]() (file read all string). + +```uiua +&fras "example.txt" +``` + +If we instead want to read the file into an array of bytes, we can use [`&frab`]() (file read all bytes). + +```uiua +&frab "example.txt" +``` + +To write an entire array to a file, we can use [`&fwa`]() (file write all). The type of the array determines whether the file is written as text or binary. + +```uiua +&fwa "file.txt" "Hello, world!" +``` + +Each editor on this site has a virtual file system, which means that we can read from files after they have been written to. This is useful for testing file writing functions. + +```uiua +&fwa "file.bin" ⇡10 +&frab "file.bin" +``` + +## Streams + +Stream are an abstraction for sending and receiving data in chunks from some source. Similar concepts exist in many programming languages, inluding Uiua. + +In this tutorial, we will focus on using streams to interact with files. However, Uiua also uses streams for other input/output sources, particularly network sockets. + +## Reading Streams + +Streams in Uiua are passed around as *handles* - boxed integer values that can be used to look up the stream in the interpreter. Functions that create streams return these handles, and they attach some metadata about what kind of stream it is for debugging purposes. + +We can use [`&fo`]() (file open) to open a file for reading. This function returns a stream handle. + +```uiua +&fo "example.txt" +``` + +There are a few functions for reading from streams. The most basic two are [`&rs`]() (read string) and [`&rb`]() (read bytes). These functions read at most a certain number of bytes from the stream and return them as a character or byte array, respectively. + +Here, we open a file with [`&fo`]() and then read 10 bytes from it. [`&rb`]() simply puts the bytes in an array, while [`&rs`]() converts them to a string. +``` +&rb 10 &fo "example.txt" +&rs 10 &fo "example.txt" +``` + +If we pass [`infinity`]() as the number of bytes to read, the stream will read until the end of the file. This is functionally equivalent to [`&fras`]() or [`&frab`](). + +```uiua +&rs ∞ &fo "example.txt" +``` + +If we want to read up until some delimiter, we can use [`&ru`]() (read until). This function reads from the stream until it encounters a certain sequence of characters or bytes, and returns everything up to that point. +If the delimiter is not found, the function will read until the end of the stream. + +```uiua +&ru "file" &fo "example.txt" +``` + +In general, you only need to use streams to read from a file if the file is too large to fit in memory. For most use cases, [`&fras`]() and [`&frab`]() are sufficient. + +## Writing Streams + +The [`&w`]() (write) function writes a character or byte array to a stream. It takes the data to write and the stream handle as arguments. + +```uiua +&w "Hello, world!" &fc "file.txt" +``` + +But wait, if we try to read from the file now, it is empty! + +```uiua +&w "Hello, world!" &fc "file.txt" +&fras "file.txt" +``` + +This is because the writes we have made have not been flushed to the file. +Streams should always be closed with [`&cl`]() (close) when they are no longer needed. This will flush any remaining writes to the file and close the file handle. + +```uiua +&cl &w "Hello, world!" . &fc "file.txt" +&fras "file.txt" +``` + +Knowing this, we see that the examples in the section above are actually incorrect! We should close the file even after reading from it. + +[`under`]() can help here. It will automatically close the stream with [`&cl`]() after the block of code is executed. + +```uiua +⍜(&fc "file.txt"|&w "Hello, world!") +&fras "file.txt" +``` \ No newline at end of file diff --git a/docs/text/format_config.md b/docs/text/format_config.md new file mode 100644 index 00000000..6b989886 --- /dev/null +++ b/docs/text/format_config.md @@ -0,0 +1,86 @@ + +# Uiua Formatter Configuration + +You can configure Uiua's formatter by creating a file called `.fmt.ua` in the directory from which you run the interpreter. This configuration file is also a Uiua program. + +Configuration options are specified by binding values to specific names. + +Example with default values: +```uiua +TrailingNewline ← 1 +CommentSpaceAfterHash ← 1 +MultilineIndent ← 2 +CompactMultilineMode ← "auto" +MultilineCompactThreshold ← 10 +AlignComments ← 1 +IndentItemImports ← 1 +``` +The following configuration options are available: + +### TrailingNewline +Type: boolean + +Default: `1` + +Whether to add a trailing newline to the output. + +--- + +### CommentSpaceAfterHash +Type: boolean + +Default: `1` + +Whether to add a space after the `#` in comments. + +--- + +### MultilineIndent +Type: natural number + +Default: `2` + +The number of spaces to indent multiline arrays and functions + +--- + +### CompactMultilineMode +Type: `"always"`, `"never"`, or `"auto"` + +Default: `"auto"` + +The mode for formatting multiline arrays and functions. + +- `"always"`: Always format multiline expressions in compact mode. +- `"never"`: Never format multiline expressions in compact mode. +- `"auto"`: Format multiline expressions in compact mode if they exceed `MultilineCompactThreshold`. + +--- + +### MultilineCompactThreshold +Type: natural number + +Default: `10` + +The number of characters on line preceding a multiline array or function, at or before which the multiline will be compact. + +--- + +### AlignComments +Type: boolean + +Default: `1` + +Whether to align consecutive end-of-line comments + +--- + +### IndentItemImports +Type: boolean + +Default: `1` + +Whether to indent item imports + +--- + diff --git a/docs/text/strings.md b/docs/text/strings.md new file mode 100644 index 00000000..58ab0035 --- /dev/null +++ b/docs/text/strings.md @@ -0,0 +1,137 @@ +# Working with Strings + +There is a common misconception that array languages like Uiua are only really good for mathematical tasks; that rich text processing is better left to more traditional languages. This is not the case! Strings are, after all, just arrays of characters! + +That being said, it may not be immediately clear how to perform common string manipulations in Uiua. This tutorial will cover the basics. + +## Converting numbers with [`parse`]() + +[`parse`]() is the standard way to convert a string to a number. +```uiua +⋕"5.2" +``` +It can also be used on arrays of boxed strings. +```uiua +⋕{"3" "-16" "π" "1e3"} +``` +[`un`]()[`parse`]() will convert numbers to strings. +```uiua +°⋕ 10 +°⋕ [1 2 3] +°⋕ ↯3_4⇡12 +``` + +## Splitting with [`partition`]() + +As discussed in the [Thinking With Arrays](/tutorial/thinkingwitharrays) tutorial, [`partition`]() can be used to split an array by a delimiter. + +First, we create a mask of places where the delimiter is *not* using [`not equals ≠`](). In this case, we'll use the space character. +```uiua +≠@ . "Split this string" +``` +[`partition`]() will then split the strings at the places where the mask changes, ommitting `0`s. +```uiua +⊜□ ≠@ . "Split this string" +``` + +[`partition`]() has an alternate functionality when its function has signature `|2.1` instead of `|1.1`. This will perform a reduction operation, similar to [`reduce`](). + +Using [planet notation](/tutorial/advancedstack#planet-notation), we can select the first or last split section. +```uiua +⊜⊙◌ ≠@ . "Split this string" +``` +```uiua +⊜⋅∘ ≠@ . "Split this string" +``` +For parts of the string that are not the first or last, we can simply [`box`]() and [`select`](). +```uiua +⊏1_3 ⊜□≠@,. "lorem,ipsum,dolor,sit,amet" +``` + +[`partition`]() can be nested to split by multiple delimiters. + +For example, if you were reading from a file that contained rows of numbers separated by spaces, you could use [`partition`]() to create a multi-dimensional array. + +Here, the contents of the file will be represented as a multi-line string. We use [`parse`]() as the inner function to parse the numbers. +```uiua +$ 1 8 4 99 +$ 5 20 0 0 +$ 78 101 1 8 +⊜(⊜⋕≠@ .)≠@\n. +``` + +This assumes that the two delimiters delimit different dimensions of the array. If they delimit the same dimension, we can use [`not`]()[`member`](). +```uiua +$ 1 8 4 99 +$ 5 20 0 0 +$ 78 101 1 8 +⊜⋕¬∊," \n" +``` + +## Finding substrings with [`mask`]() + +What if we want to split by a non-scalar delimiter? Simply dropping a string delimiter into the code above produces an error. +```uiua should fail +⊜□ ≠" - ". "foo - bar - ba-az" +``` +We might try [`find`](). While there may be cases when this output is useful, it is not quite what we want here. +```uiua + ⌕" - " "foo - bar - ba-az" +⊜□ ¬⌕" - ". "foo - bar - ba-az" +``` +This is because [`find`]() only marks the start of each matching substring. + +[`mask`]() marks each substring with an increasing number. +```uiua +⦷" - ". "foo - bar - ba-az" +``` +This works great with [`partition`]() to split the string how we want. +```uiua + ⦷" - " "foo - bar - ba-az" + ¬⦷" - " "foo - bar - ba-az" +⊜□ ¬⦷" - ". "foo - bar - ba-az" +``` +Notice that while [`not`]() leaves parts of the mask negative, [`partition`]() ignores all sections that are not positive. + +## Replacing substrings with [`under`]() + +Because [`under`]() works with [`partition`](), we can use it with [`mask`]() to replace substrings. + +In this example, we replace each row of the [`partition`]()ed array with the string `"orb"`. +```uiua + ⦷ "ab" "abracadabra" + ⊜∘ ⦷ "ab". "abracadabra" +⍜⊜∘≡⋅"orb" ⦷ "ab". "abracadabra" +``` +This can even be used to replace the matches with different strings. +```uiua +⍜⊜□◌ ⦷ "ab". "abracadabra" {"[first]" "[second]"} +``` +Here is how you might replace with a variable number of strings. +```uiua +F ← ⍜⊜□(↙⧻) ⦷ "ab".:°⋕⇡10 +F "abracadabra" +F "abcdefg" +F "ababab|abababab" +``` + +## [`regex`]() + +When a string search operation is especially complicated, you can always fall back to regular expressions using [`regex`](). + +Uiua uses [Rust's regex engine](https://docs.rs/regex) under the hood, so you can use the same syntax as you would in Rust. + +[`regex`]() returns a table of boxed strings. The first element in each row is the match. Subsequent elements are the captures. +```uiua +regex "\\d{3,4}" "(555) 310-1984" +``` +```uiua +regex "a([bc])" "abracadabra" +``` +Optional captures may need [`fill`]() to avoid errors. +```uiua should fail +regex "foo(bar)?(baz)?" "foobar\nfoobaz" +``` +```uiua +⬚""regex "foo(bar)?(baz)?" "foobar\nfoobaz" +``` \ No newline at end of file diff --git a/site/blog/second-class-functions-html.html b/site/blog/second-class-functions-html.html new file mode 100644 index 00000000..3e30b29c --- /dev/null +++ b/site/blog/second-class-functions-html.html @@ -0,0 +1,11 @@ + + + + +

Uiua

Blog Home

Why doesn't Uiua have first-class functions?

You can read this post with full editor features here.

2023-12-15


People often ask why Uiua doesn't have first-class functions. That is, functions that can be put on the stack and in arrays.

In the beginning, functions were normal array elements. Modifiers popped their functions from the stack like regular values. Functions could be put in arrays, and lists of functions even had some special uses. There was a ! call function which called the top function on the stack. Boxes were not even a dedicated type. They were just functions that took no arguments and returned a single value.

However, as Uiua's development continued, the language began to rely more and more on stack signatures being well-defined. This property catches errors early, enables some optimizations, and allows modifiers to behave differently depending on their function's siganture. That last point lets us avoid having multiple modifiers that work the same way but on different numbers of arguments. For example, Factor has the words bi, 2bi, 3bi, tri, 2tri, and 3tri. Uiua can express all of these and more with just + fork + .

Unfortunately, having first-class functions was at odds with this design. Because functions could be put into arrays and (conditionally) moved around on the stack, the compiler was not able to determine the signature of a function that called a function value. This meant that anywhere the ! call function was used needed a signature annotation nearby, which you better hope was correct, or the code would break somewhere else. It also incurred additional interpreter overhead to get the functions from arrays and made certain types of optimizations impossible.

Other than these design and implementation concerns, the ability to move functions around on the stack made code much harder to read when it was used. You had to keep in your mind not only the values, but the functions that worked on them as well. They were another value you had to deal with, and the related stack manipulation could get quite messy.

And so I settled on a different approach. Functions were removed as an element type and were put elsewhere in the interpreter. Boxes became a type in their own right. The ! call function was removed, and ! was repurposed to be part of defining custom modifiers. Custom modifiers capture the primary use case of first-class functions: injecting some variable code into a function. While they are technically more limited, their uniform structure makes them easier to both read and write. This change also massively simplified the interpreter, as well as the complexity of the language itself.

Despite the downgrading of functions to second-class status, it should be noted that I do like functional programming languages. I just don't think that first-class functions are a good fit for Uiua. In practice, first-class functions are mostly unnecessary if you have higher-order functions, which array languages have had for decades. APL's operators, J's adverbs and conjunctions, and BQN and Uiua's modifiers are all versions of higher-order functions. They allow the mapping, reduction, and general transformation of data in the same way that first-class functions do in other languages.

Now if only I could find a way to get rid of boxes...

\ No newline at end of file diff --git a/site/blog/uiua-0.10.0-html.html b/site/blog/uiua-0.10.0-html.html new file mode 100644 index 00000000..3983afcd --- /dev/null +++ b/site/blog/uiua-0.10.0-html.html @@ -0,0 +1,78 @@ + + + + +

Uiua

Blog Home

Announcing Uiua 0.10.0

You can read this post with full editor features here.

2024-04-04


Uiua 0.10.0 is now available!

You can find the full changelog here.

This release contains so many changes, improvements, and new features that I thought it deserved a blog post.From here on, major releases will be announced in this way.

While there are many changes, I want to highlight a few of them here.

Pattern Matching

Using + ° un + on a constant value will now match a pattern. When used with + try + , this can be used to conditionally match, extract, and process values.

F ← ⍣( + ×10 °[1⊙3] # Extract and multiply.. +| °(⊂5) # ..or remove leading 5.. +| ⇌ # ..else reverse +) +F [1 2 3] +F [5 6 7] +F "cool!"

You can read more in the Pattern Matching tutorial.

Array Macros

Array macros are a powerful new feature that allow full compile-time metaprogramming.

They allow Uiua code to directly manipulate other Uiua code, enabling a wide range of new possibilities.

F! ←^ ≡$"_ ← _\n" "ABC" +F!(1|2|3) +[A B C B B] # [1 2 3 2 2]

You can read more in the updated Macros tutorial.

Git Modules

You can now prefix a module path with git: to import a git repository from a URL.

~ "git: github.com/uiua-lang/example-module" ~ Upscale +Upscale 3 [1_2 3_4]

In the native interpreter, this automatically creates a Git submodule.

On the web, it fetches a lib.ua file from the repository.

You can read more in the updated Modules tutorial.

+ mask +

+ mask + is a new function that is similar to + find + , but it returns full masks of matches rather than just the first positions.

⦷ " - " "Hey - how-are - you" # [0 0 0 1 1 1 0 0 0 0 0 0 0 2 2 2 0 0 0 0]⊜□¬⦷⊙. " - " "Hey - how-are - you" # {"Hey" "how-are" " you"}

This simplifies a lot of string-processing code in particular. A new strings tutorial has been added as well.

Other Changes

Switch functions now format to use ⟨⟩ brackets. This makes them easier to distinguish from function packs.

F ← (×10|↥2)<2. # This..# 1:5: Function packs are not allowed without a modifier +F ← ⟨×10|↥2⟩<2. # Formats to this +F 0 # 2 +F 5 # 50

+ map + and related functions are no longer experimental! See the + map + docs for an overview.

map 1_2_3 4_5_6 + +# ╭─ +# 1 → 4 +# 2 → 5 +# 3 → 6 +# ╯

The new + &clget + and + &clset + functions provide access to the clipboard.

The interpreter's built-in language server now supports many more features.

There are a ton more! Again, you can read the full changelog here.

💖

As always, I'd like to thank everyone who contributed to this release, whether by directly contributing code, reporting bugs, or just using Uiua and providing feedback.

Uiua is in many ways a novel and unique language, and I think it is only through our collective effort that we can properly explore its design space.

With your help, I hope to continue to improve Uiua to the point of stability.

\ No newline at end of file diff --git a/site/blog/uiua-0.11.0-html.html b/site/blog/uiua-0.11.0-html.html new file mode 100644 index 00000000..0fb3f434 --- /dev/null +++ b/site/blog/uiua-0.11.0-html.html @@ -0,0 +1,189 @@ + + + + +

Uiua

Blog Home

Announcing Uiua 0.11.0

You can read this post with full editor features here.

2024-06-02


Uiua 0.11.0 is now available!

You can find the full changelog here.

Uiua is a general purpose, stack-based, array-oriented programming language with a focus on tacit code.

While this release does not have any major new features, it extends the functionality of many primitives, optimizes many common patterns, and fixes a number of bugs.

Here are some of the highlights:

Multi-argument + / reduce +

+ / reduce + takes a dyadic function and applies it "between" all rows of an array.

/+ [1 2 3 4 5] # 15

+ / reduce + can now take multiple arguments if its function takes more than two arguments. Additional arguments are interspersed between the rows and are passed above the main array on the stack.

/(⊂⊂) 0 [1 2 3 4] # [1 0 2 0 3 0 4]

This is particularly useful when used with + content + and + join + to intersperse a delimiter between a list of strings.

/◇(⊂⊂) @, {"cat" "dog" "bird" "fish"} # "cat,dog,bird,fish"

+ json + and + xlsx +

The + json + and + xlsx + functions allow the encoding and decoding of JSON and XLSX data respectively.

json converts an array to a JSON string.

json [1 2 3 4] # "[1,2,3,4]"

It works with maps as well.

json map {"name" "age"} {"Dan" 31} # "{"age":31,"name":"Dan"}"

+ ° un + json decodes a JSON string.

°json $ {"type": "requires", "content": "json", "ids": [38, 22, 5]} + +# ╭─ +# ⌜content⌟ → ⌜json⌟ +# ⌜ids⌟ → ⟦38 22 5⟧ +# ⌜type⌟ → ⌜requires⌟ +# ╯

xlsx is similar, but is works with binary data rather than strings.

+ take + / + drop + + infinity +

+ take + and + drop + isolate part of an array.

↙ 3 [1 2 3 4 5] # [1 2 3] +↘ 3 [1 2 3 4 5] # [4 5]

Multidimensional indices have always been supported.

↙2_2 . ↯3_4⇡12 + +# ╭─ +# ╷ 0 1 2 3 +# 4 5 6 7 +# 8 9 10 11 +# ╯ +# ╭─ +# ╷ 0 1 +# 4 5 +# ╯

You can now provide + infinity + as one or more of the indices to + take + or + drop + that entire axis.

↙∞_2 . ↯3_4⇡12 + +# ╭─ +# ╷ 0 1 2 3 +# 4 5 6 7 +# 8 9 10 11 +# ╯ +# ╭─ +# ╷ 0 1 +# 4 5 +# 8 9 +# ╯↙1_∞_2 . ↯2_3_4⇡24 + +# ╭─ +# ╷ 0 1 2 3 +# ╷ 4 5 6 7 +# 8 9 10 11 +# +# 12 13 14 15 +# 16 17 18 19 +# 20 21 22 23 +# ╯ +# ╭─ +# ╷ 0 1 +# ╷ 4 5 +# 8 9 +# ╯

Swizzles

Swizzles are a new experimental feature that allow concise manipulation of the stack and extraction from arrays.

Stack swizzles are written with a λ followed by some letters. The stack will be rearranged accordingly. λ formats from ' when followed by letters.

# Experimental! +[λccab 1 2 3] # [3 3 1 2]

Capital letters will + ¤ fix + the corresponding array. This is useful with complex + rows + operations.

# Experimental! +≡(⊂⊂) ? λaBC 1_2 3_4 5_6 + +# ╭─ +# ╷ 1 3 4 5 6 +# 2 3 4 5 6 +# ╯

Array swizzles are written with a followed by some letters. Rows from the array that correspond to the letters will be put on the stack. formats from '' when followed by letters.

# Experimental! +⋊beef [1 2 3 4 5 6] # 2 5 5 6

Capital letters will + ° un + + box + the corresponding row.

# Experimental! +⋊aCB {"Dave" 31 [38 22 5]} # ⌜Dave⌟ [38 22 5] 31

Swizzles are experimental and may change in future versions as their place in the language is explored.

The New Pad

Much of the code for the Uiua website pad has been rewritten. This new pad uses less custom behavior and should work better in more browsers.

If you are reading this on the Uiua website (with full editor features), then all the examples above use this new pad!

💗

Thank you as always to everyone who uses Uiua and helps with its development! Your enthusiasm for the language gives me life.

A special thanks to all of Uiua's sponsors for their continued support 🥰

Again, you can find the full changelog for this release here.

You can join the Uiua Discord to chat about the language, ask questions, or get help.

\ No newline at end of file diff --git a/site/blog/what-will-1-look-like-html.html b/site/blog/what-will-1-look-like-html.html new file mode 100644 index 00000000..8d1db4a8 --- /dev/null +++ b/site/blog/what-will-1-look-like-html.html @@ -0,0 +1,5 @@ + + + + +

Uiua

Blog Home

What will Uiua 1.0 look like?

You can read this post with full editor features here.

2024-01-19


The Uiua pad page prominently displays the words "Uiua is not yet stable". And so it has been asked: when will Uiua be stable? What features will it have? Is there a roadmap?

This post is to organize and present my thoughts on the future of Uiua.

Stability

Uiua will be made officially stable only after it has been unofficially stable for some time. That is, not until no breaking changes have been made for a long time.

The following language features will need to be nailed down before Uiua can ever be stable.

Stack manipulation

I think working with the stack, at least for up to 3 values, has become mostly pretty nice. However, things start to get complicated when working with more values, as is often necessary. There is some design work to be done here, and it's not out of the question that a very small amount of non-tacitness could be introduced to improve this.

The experimental bind modifier is a potential solution to this problem.

There is a balance to be struc between Uiua's goal of tacitness and its goal of being ergonomic. While the beauty of fully tacit code is a worthy goal, some problems involve data flows that are inherently complex, and so some kind of labeling system may be necessary to make such problems workable.

Box Ergonomics

While I've explored alternatives, I've come to the conclusion that nested arrays are a necessary pest. The data we work with is often nested or ragged, and while there are ways to represent such data with flat structures, those representations are cumbersome in their own ways.

And so boxes are likely here to stay. However, I do think some design work can be done to improve their ergonomics. Currently, Uiua's boxes are very similar to J's, but I think it may be worth it to make their usage a bit more implicit in some cases, closer to the nested arrays of APL or BQN.

System APIs

The current system functions are useful and mostly work. There are definitely implementation gaps which need to be filled. There are a good number of missing filesystem operations, and some other things like UDP sockets and proper interaction with child processes still need to be implemented.

FFI

An FFI system similar to BQN's is planned. This will allow Uiua to call into C libraries and will enable a lot more functionality.

\ No newline at end of file diff --git a/src/algorithm/loops.rs b/src/algorithm/loops.rs index 1f91fa34..5d448079 100644 --- a/src/algorithm/loops.rs +++ b/src/algorithm/loops.rs @@ -550,10 +550,7 @@ fn multi_partition_indices(markers: Array) -> Vec<(isize, Vec)> { *c = 0; } } - let mut shape_muls: Vec = markers - .shape() - .iter() - .rev() + let mut shape_muls: Vec = (markers.shape().iter().rev()) .scan(1, |mul, &dim| { let prev = *mul; *mul *= dim;