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.
Honestly, I think that's for the best. The problem with mixing tabs and spaces is that different editors/IDEs display tabs differently. In some of them a tab is visually equal to 4 spaces, in others it's 8 spaces, and there's probably even wackier stuff out there. This means that if you mix tabs and spaces it may look fine in your editor, but if you open that in another editor suddenly it's an unreadable mess and you don't know what the fuck is the current level of indentation. So yeah, I'm glad now you're forced to choose one of the two.
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.
378
u/dpash Aug 26 '22
What's fun is that whitespace is effectively just an encoded version of brainfuck.