112 lines
3.4 KiB
Markdown
112 lines
3.4 KiB
Markdown
---
|
||
title: quox. the language
|
||
date: 2023-10-25
|
||
tags: [quox, computer, types]
|
||
bibliography: quox.bib
|
||
link-citations: true
|
||
show-toc: true
|
||
...
|
||
|
||
<style>
|
||
header h1 { margin-left: 0; }
|
||
header h1::before, header h1::after {
|
||
content: url(../images/qt.svg);
|
||
display: inline-block;
|
||
height: 0.75em; width: 0.75em;
|
||
padding: 0 0.5em;
|
||
}
|
||
header h1::before {
|
||
transform: rotateY(0.5turn);
|
||
}
|
||
main > :is(h1, h2, h3, h4, h5, h6)::after {
|
||
content: url(../images/quox-tod.png);
|
||
image-rendering: crisp-edges;
|
||
image-rendering: pixelated;
|
||
margin-left: 0.5em;
|
||
}
|
||
.qtt-q { font-family: Muller; font-weight: 600; color: #60c; }
|
||
.xtt-x { font-family: Muller; font-weight: 600; color: #082; }
|
||
|
||
#panqt {
|
||
--width: 202px; --height: 200px;
|
||
}
|
||
#panqt div {
|
||
width: var(--width); height: var(--height);
|
||
position: relative;
|
||
}
|
||
#panqt img, #panqt div::before {
|
||
position: absolute;
|
||
top: 0; left: 0;
|
||
width: var(--width); height: var(--height);
|
||
}
|
||
#panqt div::before {
|
||
content:
|
||
image-set(url(../images/panqt.png) 1x,
|
||
url(../images/panqt2x.png) 2x);
|
||
mix-blend-mode: multiply;
|
||
}
|
||
#panqt figcaption {
|
||
width: var(--width);
|
||
}
|
||
</style>
|
||
|
||
|
||
:::{.aside .floating}
|
||
### [hot minute][wkt] *n.* {.unnumbered}
|
||
|
||
1. A long period of time.
|
||
2. A short period of time.
|
||
3. An unspecified period of time.
|
||
|
||
[wkt]: https://en.wiktionary.org/wiki/hot_minute
|
||
:::
|
||
|
||
for the last _hot minute_ [@hotminute], i’ve been working on a little programming language. it’s finally starting to approach a state where it can compile some programs, so maybe i should talk about it a bit.
|
||
|
||
|
||
# what is a quox [(tl;dr for type system nerds)]{.note}
|
||
|
||
<figure class=floating>
|
||
<img src=../images/quox.png class='shadow pixel'
|
||
alt='a dragon from an old arcade game'
|
||
title='use my warps to skip some floors!'>
|
||
<figcaption>this is also a quox.</figcaption>
|
||
</figure>
|
||
|
||
0. it’s a *dependently typed functional language*, like your agdas and your idrises.
|
||
1. *[q]{.qtt-q}uantitative type theory* (qtt) [@nuttin; @qtt] is a nice combination of dependent types, resource tracking, and erasure of stuff like proofs.
|
||
2. it uses *[x]{.xtt-x}tt* [@xtt] for equality. i think it's neat
|
||
3. it has a *closed type universe*. you don’t define new datatypes, but the language gives you building blocks to put them together. this is because of xtt originally, but i just ran with it.
|
||
|
||
so now you can see where the name [q]{.qtt-q}uo[x]{.xtt-x} comes from. other than my favourite dragon. anyway it also has
|
||
|
||
4. *bidirectional type checking* [@bidi]
|
||
5. crude-but-effective stratification [@crude; @crude-blog] for dealing with universes
|
||
|
||
|
||
# dependent types
|
||
|
||
<figure class=floating>
|
||
<div><img src=../images/panqt.png srcset='../images/panqt.png 2x'
|
||
width=202 height=200
|
||
alt='one of my fursonas is a quox with three heads'
|
||
title='i hear putting pictures of your fursona on your blog is a good way to get hacker news types Big Mad'></div>
|
||
<figcaption>
|
||
sometimes i am also a quox. or three, depending on how you count.
|
||
</figcaption>
|
||
</figure>
|
||
|
||
there are lots of languages with dependent types already. if you are reading this, chances are probably _quite_ high you already know what they are and can skip to the next section.
|
||
|
||
`*but still something. probably*`
|
||
|
||
|
||
# qtt
|
||
|
||
sometimes, values can only be used in certain ways to make sense. this isn't controversial: it's the old use-after-free.
|
||
|
||
|
||
# xtt
|
||
|
||
|
||
# references {#refs}
|