TIL about esoteric programming languages like Brainfuck. en.wikipedia.org/wiki/Brainfuc

Not masochistic enough to want to write something in it though.


Ok now came across JSFuck and mind is blown.

How the hell is this valid JavaScript and printing "no".

@curtismchale Hah, yes, me too, where possible (not that often). But not really because I hate writing it, more because I feel the web should be mostly HTML.

@danny Same here. JS feels like it’s for some final UI stuff to make it perfect and give good user feedback...and AJAX stuff

@danny It's casting error responses into text strings, then slicing them.
e.g. [][[]] is undefined ... add '+[]' to the end and it gets turned into the string 'undefined' ... then we slice off char 1 by turning !+[] true into the number 1 ... and so on.

@danny The JavaScript VM has given up on life and is simply saying "no" .. AI at its finest

@danny In JSFuck { and } are not allowed. But this is an o too: (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]

@danny @thegcat +[]=0, !+[] = true, +!+[]=1
[][[]] + [] = "undefined"
({}) + ({}) = "[object Object][object Object]"

So it is more or less using corner cases

Sign in to participate in the conversation

Personal Mastodon instance of @danny.