Instantly share code, notes, and snippets.

View result.hpp
The Scopes Compiler Infrastructure
This file is distributed under the MIT License.
See for details.
#include <assert.h>
View randomwalk.cpp
#include <stdio.h>
#include <stdlib.h>
void measure(int maxsteps) {
const int tries = 1000000;
int success = 0;
for (int attempts = 0; attempts < tries; ++attempts) {
int x = 0;
int y = 0;
for (int i = 0; i < maxsteps; ++i) {
View key_is_value.cpp
static const Type *ReturnLabel(ReturnLabelType::Mode mode, const Args &values) {
struct Equal {
bool operator()( const ReturnLabelType *lhs, const ReturnLabelType *rhs ) const {
(lhs->mode == rhs->mode)
&& (lhs->values == rhs->values);
struct Hash {
View perfect_spatial_hashing.txt
# forays into
Perfect Spatial Hashing (Lefebvre & Hoppe)
how it works:
There are two parts: a slow encoding step, and a fast decoding step.
View octree_keys.txt
# taken from
Fast generation of pointerless octree duals
Lewiner et al., 2010
+-------+ 7
/| /|
View bernstein.glsl
// Bernstein Polynomial Basis Coefficients as derived from mix()
// x is in range 0..1
void basis (float x) {
// basis 0
float b00 = 1.0;
// basis 1
float b10 = mix(b00, 0.0, x);
float b11 = mix(0.0, b00, x);
using import ..tukan.random
fn main ()
let rnd = (static (Random 32))
'seed rnd
fn test-factor (factor)
print "factor" factor
let iters = 100000

Wie ich mir den Ursprung vorstelle

Also für mein Weltenmodell brauchen wir am Ursprung erstmal eine Form von kognitiver Computer, der unendlich viel Zeit zum Rechnen hat. Das kann ein organisch entstandener Rechner in einem Meta-Universum sein, das kann aber auch ein hermetisch von der Aussenwelt abgeriegelter unsterblicher Koma-Patient mit perfektem Gedächtnis sein.

Was macht man, wenn man garnichts hat? Man macht Mathematik. Man kann Logik, Algebra, Geometrie, Graphentheorie und all diese schönen Dinge alle entdecken, ohne dass man physikalische Apparate dafür braucht. Man brauch nur einen Computer und Speicher. Wenn man unendlich viel Zeit hat, kann man alles, was mathematisch möglich ist, perfekt ausarbeiten. Alles, was fruchtbar ist, wird weiterverfolgt. Was sich wiederspricht oder explodiert, lässt man bleiben. So bildet sich ein Labyrinth der Konzepte, ein Substrat der Axiome, aus dem fruchtbare, konsistente, in sich geschlossene Systeme entstehen.

Aus diesem Subs

View gist:8a022734b1444a303aaa33f0df02b38e
Imagine we had opened a wormhole to a distant planet, 50 light years away.
From mapping the sky on both planets, we learn that we are visiting this planet
50 years in the future - or they are visiting an earth 50 years in the past.
This means: if we sent a signal at light speed to this planet by radio waves
through normal space, as well as simultaneously through the wormhole, then the
signals would arrive there at the same time.
Any signal they send us however, would be split: the wormhole signal could be
received immediately, but the intersolar signal would be received in 100 years.
View gist:d8a93a5097f869f35a894aad41e05507
struct Val
x : i32
y : i32
fn new (val)
let mval = (malloc (typeof val))
# option A: wrap pointer in a fancy reference type
let mval = (('from-pointer-type reference (typeof mval)) mval)
mval = val