Feeds:
Posts
Comments

Archive for November, 2018

Edit again: after shuffling around a bit, ES5+ should now be possible, at least in theory.

Edit: change from ES5+ to ES6+ for technical reasons.

j8t is a project I created which efficiently translates any generic JavaScript program (ES5+) into one which uses only 10 unique characters. Why 10 and not 8 or 6, like other projects? Simply put, it’s about following the rules to the letter.

It is based on the idea that individual characters can be formed by abusing various features in the language. For instance:

> +[]
0
> +!![]
1
> (+{}+[])[+[]]
'N'

(Obviously!)

I am taking this way too seriously when I say that similar projects I know of are all cutting one or more corners. As far as I know, 10 characters is the minimum if you want to do it “properly”. So I set out to do that. In the process, I also made various optimizations that makes it possible to convert large programs, and do so efficiently, or indeed convert j8t itself. I’m not aware of any other project that can do the same.

So, what is this good for?

Short answer: nothing! If you’re still reading at this point, you should have known that.

Long answer: it’s a bizarre form of entertainment, and at the same time it is possible to learn a lot when pushing things to the limit.

Read Full Post »

%d bloggers like this: