6
\$\begingroup\$

See this answer.

I'm not sure how to deal with this answer. That's the shorter code at this time, so it may be the winner.

On one hand, the tokenized version is sort of compressed code, but it seems to be totally unreadable by an human. So I'm not sure if counting the characters of the tokenized version is fair. On the other hand, it's a feature from the language so it doesn't break any rule.

What do you think? Are there other languages which can be compressed on similar ways?

I haven't seen this discussion on meta yet so I'm posting it, it may be useful if somebody asks the same thing.

\$\endgroup\$
  • 1
    \$\begingroup\$ I started a similar discussion in chat a few days ago, which you might want to read. I was mostly worried that if we allow this, by extension, compiled or zipped code sizes might be valid, too. \$\endgroup\$ – Martin Ender May 13 '14 at 20:08
6
\$\begingroup\$

Despite being a moderator, I'm not speaking for the whole site in this instance. I am just speaking as a user.

I consider that valid. It's not required for the code to be human-readable. We allow submissions in GolfScript or object code, after all.

\$\endgroup\$
  • 2
    \$\begingroup\$ Even if I don't know the GolfScript syntax, I can read it when code is posted in a answer. With tokenized PostScript/GhostScript, it can't be displayed as plain text, it's necessary to use hexdump. \$\endgroup\$ – A.L May 13 '14 at 19:42
  • \$\begingroup\$ @n.1, I've posted quite a few GolfScript answers which had to be encoded by hexdump because they use non-printing characters in strings. \$\endgroup\$ – Peter Taylor May 13 '14 at 22:04
  • 1
    \$\begingroup\$ @PeterTaylor should we require answers to use printable characters only? \$\endgroup\$ – John Dvorak May 14 '14 at 6:25
  • 2
    \$\begingroup\$ @JanDvorak, I don't think so. If the standard interpreter treats ? as \u0004 then a golfer would be crazy not to exploit that. Similarly where the standard interpreter provides aliases for keywords, so Chris' analogy is a good one. \$\endgroup\$ – Peter Taylor May 14 '14 at 7:29
  • \$\begingroup\$ Thanks for your answer and comments, I followed your advice and accepted the answer. \$\endgroup\$ – A.L May 14 '14 at 17:14
  • 1
    \$\begingroup\$ @JanDvorak: I tried requiring that in this challenge. It seemed to work OK, although I'm not sure it really can be said to have improved readability. \$\endgroup\$ – Ilmari Karonen May 23 '14 at 10:32
2
\$\begingroup\$

Since Postscript's binary tokens are in 1-to-1 correspondence with the regular ascii words, it's only polite to provide a full ascii version as well.

But if the binary version is correctly executed by the interpreter, that would appear to be the definition of valid (unless, of course, ascii-only were an explicit requirement of the challenge).

I hasten (after actually looking at the linked question) to add that even the authors of these binary postscript programs are reluctant to take the idea too far, because it gets sooooo weird so fast.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .