• Vekyization challenge

 

Can you write a program with the following properties?

  1. Takes a string describing a python program as input.
  2. Outputs another string also describing a python program.
  3. The two programs are equivalent, i.e. they behave in the same way.
  4. The output doesn't contain a newline character, i.e. it's a one-liner.
  5. The length of the output is at most a constant times the length of the input.
  6. The runtime of the output is at most a constant times the runtime of the input.
  7. If the input doesn't contain eval-like constructs, the output doesn't either.
26