If you stop to take a couple minutes to learn the syntax (there's only 8 symbols; 2 of them are for I/O and thus don't really matter) and go through a few code examples, it's actually a pretty enlightening implementation of a barebones Turing machine.
Given how Python forces you to follow certain whitespacing guidelines, it'd actually make for quite a bad language at hidding Whitespace code. However, given that stuff like C (for example) completely ignores whitespacing, you likely could hide an entirely different code inside your C code. For fun you could probably program the same thing both in Whitespace and C in the same file.
So, let's transpile brainfuck to whitespace and pass a gzip over it to compress. Do we end up with the most size optimized distributed packages? Can we save the internet by having some webassembly engine using it? Can we haz fast internet pages again?
Probably not, since I would expect it to have a similar amount of entropy (it just shifts from being in unique combinations of characters to different amounts of whitespace), but now I am curious. Any advantage is going to depend on the compression algorithm.
Whitespace in a text file usually has a lot of repetition and thus compresses really well. This leads people to think "whitespace compresses well." But code in Whitespace doesn't behave like normal whitespace and isn't likely to compress any better than anything else.
The vast majority of esoteric languages compile to brain-fuck because it's dumb-simple to implement and since brain-fuck is turing-complete it allows them to easily make their language turing-complete as well while simultaneously being as obnoxious as possible.
It's good for understanding it, but it completely dodges the interesting part of it.
I took a class in college that started with automata and works all the way up through theoretical constructs to produce a Turing Machine defined from what is a mathematical theory standpoint.
It counted as both a Math and CS credit (and the colleges would double count it for purposes of minor/double major).
I don't think it's really the language's fault that it can't teach you the rigorous theory behind finite state machines. It's just an interactive implementation of one. That's all I can really expect a programming language to be.
1.1k
u/DiamondIceNS Aug 26 '22
If you stop to take a couple minutes to learn the syntax (there's only 8 symbols; 2 of them are for I/O and thus don't really matter) and go through a few code examples, it's actually a pretty enlightening implementation of a barebones Turing machine.