Skip to content

Commit 9cae2a8

Browse files
committed
build site
1 parent 7c4501f commit 9cae2a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+12428
-6
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
.vscode
22
.idea
33
/target
4-
/docs
5-
/site/blog/*.html
64
site/dist
75
/uiua-modules
86

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,7 @@ members = ["site", "tests_ffi", "pad/editor"]
168168

169169
[profile.dev]
170170
incremental = true
171+
172+
[profile.release]
173+
lto = true
174+
opt-level = 'z'

docs/404.html

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title>Uiua</title>
7+
<script type="text/javascript">
8+
// Single Page Apps for GitHub Pages
9+
// MIT License
10+
// https://github.com/rafgraph/spa-github-pages
11+
// This script takes the current url and converts the path and query
12+
// string into just a query string, and then redirects the browser
13+
// to the new url with only a query string and hash fragment,
14+
// e.g. https://www.foo.tld/one/two?a=b&c=d#qwe, becomes
15+
// https://www.foo.tld/?/one/two&a=b~and~c=d#qwe
16+
// Note: this 404.html file must be at least 512 bytes for it to work
17+
// with Internet Explorer (it is currently > 512 bytes)
18+
19+
// If you're creating a Project Pages site and NOT using a custom domain,
20+
// then set pathSegmentsToKeep to 1 (enterprise users may need to set it to > 1).
21+
// This way the code will only replace the route part of the path, and not
22+
// the real directory in which the app resides, for example:
23+
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
24+
// https://username.github.io/repo-name/?/one/two&a=b~and~c=d#qwe
25+
// Otherwise, leave pathSegmentsToKeep as 0.
26+
var pathSegmentsToKeep = 0;
27+
28+
var l = window.location;
29+
l.replace(
30+
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
31+
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +
32+
l.pathname.slice(1).split('/').slice(pathSegmentsToKeep).join('/').replace(/&/g, '~and~') +
33+
(l.search ? '&' + l.search.slice(1).replace(/&/g, '~and~') : '') +
34+
l.hash
35+
);
36+
37+
</script>
38+
</head>
39+
40+
<body>
41+
</body>
42+
43+
</html>

docs/CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
www.uiua.org

docs/DejaVuSansMono.ttf

334 KB
Binary file not shown.

docs/Pixua.ttf

77 KB
Binary file not shown.

docs/Uiua386.ttf

257 KB
Binary file not shown.

docs/assets/ooh-ee-ooh-ah.mp3

41.2 KB
Binary file not shown.

docs/assets/rss.svg

+17
Loading

docs/assets/uiua-crayon.jpg

99.3 KB
Loading

docs/assets/uiua-logo-jacob.svg

+1
Loading

docs/assets/uiua-logo-pride.gif

120 KB
Loading

docs/assets/uiua-logo-pride.png

80.4 KB
Loading
7.93 KB
Loading

docs/assets/uiua-logo.gif

131 KB
Loading

docs/assets/uiua-logo.png

27.6 KB
Loading

docs/assets/uiua-logo.svg

+38
Loading

docs/assets/wee-wah.mp3

15.3 KB
Binary file not shown.

docs/assets/wee-wuh.mp3

15.5 KB
Binary file not shown.

docs/assets/you-dont.png

895 KB
Loading

docs/blog/feed.rss

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<rss version="2.0"
3+
xmlns:atom="http://www.w3.org/2005/Atom">
4+
<channel>
5+
<title>Uiua Blog</title>
6+
<description>Blog of the Uiua Programming Language</description>
7+
<link>https://uiua.org/blog</link>
8+
<atom:link href="https://uiua.org/blog/feed.rss" rel="self" type="application/rss+xml"></atom:link>
9+
<lastBuildDate>Fri, 20 Dec 2024 23:42:02 +0000</lastBuildDate>
10+
<item>
11+
<link>https://uiua.org/blog/uiua-0.14.0</link>
12+
<guid isPermaLink="false">a516e01b-732f-4e30-aba2-9599fedfffab</guid>
13+
<pubDate>Fri, 20 Dec 2024 00:00:00 +0000</pubDate>
14+
<title>Announcing Uiua 0.14.0
15+
</title>
16+
</item>
17+
<item>
18+
<link>https://uiua.org/blog/subscripts</link>
19+
<guid isPermaLink="false">820eeae1-7c05-4c3c-877c-0675dd7517aa</guid>
20+
<pubDate>Mon, 25 Nov 2024 00:00:00 +0000</pubDate>
21+
<title>Subscripts
22+
</title>
23+
</item>
24+
<item>
25+
<link>https://uiua.org/blog/uiua-0.13.0</link>
26+
<guid isPermaLink="false">666c3590-e42d-4e75-a7bf-1552a098ccd2</guid>
27+
<pubDate>Mon, 21 Oct 2024 00:00:00 +0000</pubDate>
28+
<title>Announcing Uiua 0.13.0
29+
</title>
30+
</item>
31+
<item>
32+
<link>https://uiua.org/blog/uiua-0.12.0</link>
33+
<guid isPermaLink="false">95d63645-10e4-4312-bbe3-f0a6254c0144</guid>
34+
<pubDate>Fri, 16 Aug 2024 00:00:00 +0000</pubDate>
35+
<title>Announcing Uiua 0.12.0
36+
</title>
37+
</item>
38+
<item>
39+
<link>https://uiua.org/blog/uiua-0.11.0</link>
40+
<guid isPermaLink="false">32cba0cb-2378-4cf9-894c-ea65e2a3ffda</guid>
41+
<pubDate>Sun, 2 Jun 2024 00:00:00 +0000</pubDate>
42+
<title>Announcing Uiua 0.11.0
43+
</title>
44+
</item>
45+
<item>
46+
<link>https://uiua.org/blog/uiua-0.10.0</link>
47+
<guid isPermaLink="false">6841da9d-9b35-4992-92b3-0c6820606733</guid>
48+
<pubDate>Thu, 4 Apr 2024 00:00:00 +0000</pubDate>
49+
<title>Announcing Uiua 0.10.0
50+
</title>
51+
</item>
52+
<item>
53+
<link>https://uiua.org/blog/what-will-1-look-like</link>
54+
<guid isPermaLink="false">113ee6ab-1d29-4115-9a1e-4bb2701d23f0</guid>
55+
<pubDate>Fri, 19 Jan 2024 00:00:00 +0000</pubDate>
56+
<title>What will Uiua 1.0 look like?
57+
</title>
58+
</item>
59+
<item>
60+
<link>https://uiua.org/blog/second-class-functions</link>
61+
<guid isPermaLink="false">c6a7b400-5d2b-413a-888b-4cd675c8c1db</guid>
62+
<pubDate>Fri, 15 Dec 2023 00:00:00 +0000</pubDate>
63+
<title>Why doesn't Uiua have first-class functions?
64+
</title>
65+
</item>
66+
</channel>
67+
</rss>
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html><html><head>
2+
<meta charset="utf-8">
3+
<meta name="viewport" content="width=device-width, initial-scale=1">
4+
<link rel="stylesheet" href="https://uiua.org/styles.css">
5+
</head><body><div id=top><p><a href="https://uiua.org" data-title=>Uiua</a></p><p><a href="https://uiua.org/blog" data-title=>Blog Home</a></p><h1 id="why-doesn't-uiua-have-first-class-functions?">Why doesn't Uiua have first-class functions?</h1><p><strong>You can read this post with full editor features <a href="https://uiua.org/blog/second-class-functions" data-title=>here</a>.</strong></p><p>2023-12-15</p><hr/><p>People often ask why Uiua doesn't have first-class functions. That is, functions that can be put on the stack and in arrays.</p><p>In the beginning, functions <em>were</em> 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 <code>! call</code> 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.</p><p>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, <a href="https://factorcode.org/" data-title=>Factor</a> has the words <code>bi</code>, <code>2bi</code>, <code>3bi</code>, <code>tri</code>, <code>2tri</code>, and <code>3tri</code>. Uiua can express all of these and more with just <a
6+
href="https://uiua.org/docs/fork"
7+
data-title="Call two functions on the same values"
8+
class="prim_code_a"
9+
style="text-decoration: none;">
10+
<code><span class="prim-glyph code-font dyadic-modifier"></span> fork</code>
11+
</a>.</p><p>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 <code>! call</code> 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.</p><p>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.</p><p>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 <code>! call</code> function was removed, and <code>!</code> was repurposed to be part of defining macros. <a href="/docs/macros" data-title=>Macros</a> 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.</p><p>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.</p><p>Now if only I could find a way to get rid of boxes...</p></div></body></html>
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Why doesn't Uiua have first-class functions?
2+
3+
2023-12-15
4+
5+
---
6+
7+
People often ask why Uiua doesn't have first-class functions. That is, functions that can be put on the stack and in arrays.
8+
9+
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.
10+
11+
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]().
12+
13+
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.
14+
15+
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.
16+
17+
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 macros. [Macros](/docs/macros) 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.
18+
19+
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.
20+
21+
Now if only I could find a way to get rid of boxes...

0 commit comments

Comments
 (0)