NeilBostian / bf-in-ts

Brainfuck interpreter written in Typescript's type system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Brainfuck Interpreter in TypeScript's Type System

This project is a Brainfuck interpreter written using TypeScript's type system. Take a look at this github thread for discussion on what the type system is capable of.

To learn more about bf, see:

Install & Test

Clone & yarn:

$> git clone https://github.com/neilbostian/bf-in-ts
$> yarn

Run tests - see tests:

$> yarn test

Patch

yarn postinstall script runs a patch against typescript tsc.js and tsserver.js that updates the max instantiationCount and instantiationDepth. Using the default, tsc will error on large inputs:

error TS2589: Type instantiation is excessively deep and possibly infinite.

VsCode also shows this error - you might need to explicitly set the typescript version to the workspace tsserver defined in .vscode/settings.json. See this comment for more details.

Similar work

  • Shoutout to Carter who had a similar idea 👉 sno/bf
  • This repo has loads of cool typescript 👉 fightingcat/sits

About

Brainfuck interpreter written in Typescript's type system

License:GNU General Public License v3.0


Languages

Language:TypeScript 98.0%Language:JavaScript 2.0%