Skip to content

Instantly share code, notes, and snippets.

View SimonMeskens's full-sized avatar

Simon Meskens SimonMeskens

  • Belgium
View GitHub Profile
@SimonMeskens
SimonMeskens / Pencil Study.md
Created September 25, 2026 14:23
Pearson Moore's Pencil Study

Hi Brian,

Back in 2015 and again in 2022-2024, I studied 1120 graphite art pencils from every major manufacturer. I was disappointed to find that sets such as Derwent Graphic didn't seem to have the quality or value (darkness) consistency I wanted. I started drawing in 2014, so I had little experience as an artist. Why did my Derwent Graphic grade B pencil seem to have the same darkness as my Derwent Graphic 3B pencil? Why was the 4B exactly the same as the 6B in its performance on paper? Why were some of the leads scratchy? Did my inexperience in the discipline give me unreasonable expectations? I was hardly an artist. But I was (and am) a scientist. I resolved to find an answer to my questions.

I found grade varied tremendously from one manufacturer to another. Why? I did some simple experiments. I found darkness and softness are NOT interchangeable terms. I found a pencil could be very dark yet hard as nails and leave little graphite on paper (I measured the amount of graphite deposited), and a pencil

@SimonMeskens
SimonMeskens / scarlet.md
Last active March 6, 2025 22:21
Programming language that resembles redstone

Scarlet - A mini-language vaguely based on redstone

MIT license

Overview

Scarlet is a 2D programming language where the output of the program looks like the source code, but colored based on the signals propagating.

Semantics

  • [a-Z]: Solid block, turns white if receiving a signal
  • [0-9]: Like a solid block, but only pass their signal to nearby blocks after X ticks, where X is their number
  • +: Dust, 16 states, 0 being off, can receive signal from a solid block
@SimonMeskens
SimonMeskens / stream-machines.md
Last active March 20, 2025 15:57
WIP - Stream automata for a turing machine equivalent to concatenative programming.

Copyright 2025 Simon Meskens Licensed under the MIT License

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided this license is preserved. This software is offered as-is, without any warranty.

Stream Machine: An abstract machine with a transition table, no machine state and a finite number of lazy stacks. One of the stacks is the program stack and after each transition, the top of the program stack is popped off.

@SimonMeskens
SimonMeskens / lambdastack.js
Last active February 5, 2025 01:06
Defunctionalized continuations in JS using algebraic data types
// Copyright 2025 Simon Meskens
// Licensed under the MIT License
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided this license is
// preserved. This software is offered as-is, without any warranty.
// Based on: https://www.youtube.com/watch?v=O6s8_4agu4c
// https://gist.github.com/paf31/16f25ef70eaf256fbf301b571db6d533
@SimonMeskens
SimonMeskens / direct.zig
Last active February 5, 2025 01:07
Threaded code in Zig
// Copyright 2024 Simon Meskens
// Licensed under the MIT License
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided this license is
// preserved. This software is offered as-is, without any warranty.
// https://godbolt.org/z/TK5r79esP
pub const VM = struct {
code: []const Inst,

mlatu specification

https://mlatu-lang.github.io/mlatu/

Syntax

A rule is composed of a non-empty sequence of non-quotation terms, followed by the symbol =, followed by a possibly empty sequence of terms, followed by the symbol .. The first sequence of terms is known as the pattern or the redex, and the second sequence of terms is known as the replacement or the reduction. If two rules with the same replacement are defined, it is undefined behaviour.

A term is either a primitive symbol (+, -, >, <, ,, or ~), a word, or a quotation - the symbol (, followed by a possibly empty sequence of terms, followed by the symbol ). A word is composed of a sequence of Unicode characters which does not include whitespace or any of the syntactical or primitive symbols (+-><,~()=.)

Pick either the second or third paragraph and the final one is optional.

Copyright (c) 2024 «AUTHORS»

In the name of a free and open culture, you may do anything with this software that copyright law would normally restrict, provided this license is preserved. This software is offered as-is, without any warranty.

To the extent permitted under applicable law, worldwide, all copyright holders fully waive their copyrights to this software and dedicate it to the public domain.

This software or any derivatives of this software can only be distributed with their source code publicly available; software that is distributed with this software as part of it should also require the same. Services can only make use of this software provided that any modifications are publicly available.

const top = (stack) => stack.length - 1;
const zero = ({ left }) => left.push(0);
const pop = ({ right }) => right.pop();
const increment = ({ left }) => (left[top(left)] = (left[top(left)] + 1) % 256);
const decrement = ({ left }) =>
(left[top(left)] = (left[top(left)] + 255) % 256);
const shift = ({ left, right }) => right.push(left.pop());
@SimonMeskens
SimonMeskens / UTF-8
Last active February 4, 2025 06:01
UTF-8 Explained using one diagram
UTF-8 Code point: a bb bb cc cc dd dd ee ee ff ff
0 e ee ff ff
10 ------- ----------- ---- ERROR -----------
110 d dd ee 10 ee ff ff
1110 cc cc 10 dd dd ee 10 ee ff ff
11110 a bb 10 bb cc cc 10 dd dd ee 10 ee ff ff
111110 ------- ----------- ---- ERROR -----------
@SimonMeskens
SimonMeskens / 00Pattern.purs
Last active February 5, 2025 01:07
Brzozowski derivatives in PureScript - MIT License
module Patterns
( Pattern(..)
, unite
, concat
, repeat
, complement
, derivative
) where
import Data.Boolean (otherwise)