By Leonard Ritter (25.9.2024, last update 6.1.2024)
NOIR is a high-level function-scope intermediate representation for programs, extending SSA Form but omitting basic blocks in favor of a simple acyclic dependency structure that is simpler to evaluate, analyze, canonicalize and optimize, particularly in the context of concurrent and iterative execution, and offers different lowering strategies.
In order to render a function-level IR fully functional, we only need five things: instructions, ordering, branches, merges and loops. In the following sections, we will introduce and describe each element.
As an introductory example and for overview, here is an iterative fibonacci procedure expressed in NOIR pseudocode:
/////////////////////////////////////////////////////////////////////////////// | |
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader | |
// AUTHOR: Freya Holmér | |
// LICENSE: Use for whatever, commercial or otherwise! | |
// Don't hold me liable for issues though | |
// But pls credit me if it works super well <3 | |
// LIMITATIONS: There's some precision loss beyond 3 decimal places | |
// CONTRIBUTORS: yes please! if you know a more precise way to get | |
// decimal digits then pls lemme know! | |
// GetDecimalSymbolAt() could use some more love/precision |
This is the predecessor of Mazeppa.
Supercompilation is a deep program transformation technique due to V. F. Turchin, a prominent computer scientist, cybernetician, physicist, and Soviet dissident. He described the concept as follows [^supercompiler-concept]:
A supercompiler is a program transformer of a certain type. The usual way of thinking about program transformation is in terms of some set of rules which preserve the functional meaning of the program, and a step-by-step application of these rules to the initial program. ... The concept of a supercompiler is a product of cybernetic thinking. A program is seen as a machine. To make sense of it, one must observe its operation. So a supercompiler does not transform the program by steps; it controls and observes (SUPERvises) the running of the machine that is represented by th
So /tick
is now available in vanilla. Well, most of it is. Obviously only one could exist at a time, meaning /tick
from carpet is gone, so here is the gist... mhm... of what happened, what is covered, what is lost and what might not be lost forever. This is not a writeup from a Mojang developer, it's a writeup from a mod developer whose part of the mod just got obsolete by a gaming studio.
/tick
on its own, as a query command, is moved to vanilla /tick query
providing much more information about the health of the game tick. Tick performance and tick targets are also now way better handled in F3
and especially F3+2
screens, but if you are not in singleplayer or run the server with your game, a better information directly from the server through /tick query
may come in handy.
/tick rate
now exists as a vanilla command. It is limited on the lower end to 1 tps (not 0.1 tps like in carpet) to get a more responsive chat (the only reason so far tbh), but due to improvements to h
Every once in a while I investigate low-level backend options for PL-s, although so far I haven't actually written any such backend for my projects. Recently I've been looking at precise garbage collection in popular backends, and I've been (like on previous occasions) annoyed by limitations and compromises.
I was compelled to think about a system which accommodates precise relocating GC as much as possible. In one extreme configuration, described in this note, there
In this article, I'll explain why implementing numbers with just algebraic datatypes is desirable. I'll then talk about common implementations of FFT (Fast Fourier Transform) and why they hide inherent inefficiencies. I'll then show how to implement integers and complex numbers with just algebraic datatypes, in a way that is extremely simple and elegant. I'll conclude by deriving a pure functional implementation of complex FFT with just datatypes, no floats.
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>WebGPU Audio</title> | |
</head> | |
<body> | |
<button type="button" id="play">Play</button> | |
<script type="module"> | |
const code = ` |
type term = | |
| Lam of (term -> term) | |
| Pi of term * (term -> term) | |
| Appl of term * term | |
| Ann of term * term | |
| FreeVar of int | |
| Star | |
| Box | |
let unfurl lvl f = f (FreeVar lvl) |