Skip to content

Instantly share code, notes, and snippets.

Brainfuck Interpreter in the TypeScript Compiler

This is a brainfuck interpreter written using the new template string literals upcoming in TypeScript 4.1.

Since brainfuck is turing complete, this means that the TS type system is also turing complete, although the compiler does impose stringent limits on how many types you can instantiate at once. As such, these brainfuck programs have to be kept short and sweet.

[Play around with it yourself](https://www.typescriptlang.org/play?ts=4.1.0-pr-40336-88#code/PTAEFEA8EMFsAcA2BTAzgKAC4E97NALICuimAlktgEwCCAdgCYBsoAvKAEIBO0ZdAZkQDGAawA8AIgDUoKVIDaAPjkqpYgLQBdRQDoJi0CFASAOkQAM5gIxUJWXPnBCAFgHs2nHn0GjJAGnkdP00JP2MACWRERFd9QzAJSOjY+zxQACVkADdkLlR8dm5eAWFxUKVgsUCxELCJBlcAczijCUbXBjt0I25kaBF4Vz5MVFAACgkAQgkASlBUTFd4UGRIZCEiclc6UGhGUC5kTCIuHehQY6R8V35QeTFD2GK+RtAhDuRFMLEiOiJ8higPjwTZfUBieBcYbIQGuTYgzBgiFDOiYXKgGJCaBbOhIhbQURI2DIWCuLjYUAMIgIRSaVL4Xr9QbDDxFbylfyBL6aaZ1JIxFpgeQSULGUWJKICsIAVjCvwYyH4fBhYXkAHYqGErNY

@kiontupper
kiontupper / derequire.js
Last active December 2, 2018 19:43
Poor man's derequire
#!/usr/bin/env node
let i = "";
process.stdin.on("readable", () => {
let chunk;
while (null !== (chunk = process.stdin.read())) {
i += chunk.toString();
}
});
process.stdin.on("end", () => {
@kiontupper
kiontupper / package.json
Last active October 5, 2018 14:07
{N} Cloud Build Failure
{
"name": "antem",
"version": "1.0.0",
"description": "Your network, your way.",
"author": "Antem Technologies <contact@antem.app>",
"license": "UNLICENSED",
"private": true,
"nativescript": {
"id": "com.antem.antem",
"tns-ios": {
[15:01:48] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:01:48] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[15:01:48] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[15:01:48] [main/INFO]: Forge Mod Loader version 14.23.4.2745 for Minecraft 1.12.2 loading
[15:01:48] [main/INFO]: Java is OpenJDK 64-Bit Server VM, version 1.8.0_181, running on Linux:amd64:4.15.0-30-generic, installed at /usr/lib/jvm/java-8-openjdk-amd64/jre
[15:01:49] [main/INFO]: Searching /home/potassiumion/.minecraft/mods for mods
[15:01:49] [main/INFO]: Searching /home/potassiumion/.minecraft/mods/1.12.2 for mods
[15:01:49] [main/INFO]: Loading tweaker guichaguri.betterfps.tweaker.BetterFpsTweaker from BetterFps-1.4.8.jar
[15:01:49] [main/INFO]: Loading tweaker codechicken.asm.internal.Tweaker from ChickenASM-1.12-1.0.2.7.jar
[15:01:49] [main/WARN]: Found FMLCorePluginContainsFMLMod marker in EnderCore-1.12.2-
@kiontupper
kiontupper / latest.log
Created July 31, 2018 20:44
AE2 crash report
This file has been truncated, but you can view the full file.
[14:46:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[14:46:31] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[14:46:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[14:46:31] [main/INFO] [FML]: Forge Mod Loader version 14.23.4.2745 for Minecraft 1.12.2 loading
[14:46:31] [main/INFO] [FML]: Java is OpenJDK 64-Bit Server VM, version 1.8.0_171, running on Linux:amd64:4.15.0-29-generic, installed at /usr/lib/jvm/java-8-openjdk-amd64/jre
[14:46:31] [main/INFO] [FML]: Searching /home/potassiumion/.minecraft/TOII Sky/mods for mods
[14:46:31] [main/INFO] [FML]: Searching /home/potassiumion/.minecraft/TOII Sky/mods/1.12.2 for mods
[14:46:32] [main/INFO] [FML]: Loading tweaker guichaguri.betterfps.tweaker.BetterFpsTweaker from BetterFps-1.4.8.jar
[14:46:32] [main/INFO] [FML]: Loading tweaker codechicken.asm.internal.Tweaker from ChickenASM-
@kiontupper
kiontupper / journymap.log
Last active July 31, 2018 18:10
JournyMap (1.12.2) crash when loading world from 1.10.2
[13:36:02] [main/INFO] [JMLogger] JourneyMap log initialized.
[13:36:02] [main/INFO] [JourneymapClient] initialize ENTER
[13:36:02] [main/ERROR] [JMLogger] Default theme not found in /home/potassiumion/.minecraft/TOII Sky/journeymap/icon/theme/Victorian/Victorian.theme2.json: Victorian (SUPPRESSED)
[13:36:02] [Client thread/INFO] [?] Version: JourneyMap 1.12.2-5.5.2, built with Forge 14.23.0.2491
Forge: 14.23.4.2745
Environment: os.name, os.arch, java.version, user.country, user.language=null, game language=en_us, locale=en_us
Features:
RadarPlayers : singleplayer = true , multiplayer = true
RadarAnimals : singleplayer = true , multiplayer = true
RadarMobs : singleplayer = true , multiplayer = true