Mike Burr - log

[comp] Camouflaged Code

Take an "advanced" programming language with lots of syntax magic and search the space of "simpler languages" for bits of legal syntax in the simple language that can be something entirely different in the advanced.

Not very great example:

Have a Rust macro that looks like python but is actually...whatever you like.

def reanimate_parrot():

It's stupid and stupid-contrived, but there's better stuff, maybe. If you can not use macros, that'd make it cleverer. Mostly, but not entirely this involves comparing "keyword" or "built-in" spaces. It's especially powerful if you can find a single character that is special in one but not the other.

"Advanced vs Simple" is possibly not relevant.

Consider Lisp v Python. Rust's macros feel like cheating and probably is.

Little scripts and watnot that could help one write such a thing'd be fun.

Think of your own examples or dismiss this idea, I'm ok either way.

- 1 toast