The universal solution to any "shortest program" code-golf challenge?

So I see various challenges about writing the shortest program to "find tree depth", "solve trolley problem" etc and the winners are usually highly contrived languages optimized for succinctness (and consequently unreadable). In general the challenges are biased towards more compact languages (hence made-up languages optimised for that), but also higher level languages in which more functionality is embedded into the compiler/environment itself hence doesn't need coding.

OK so since we have allowed ourselves the luxury of using contrived, high-level, custom, compactness-oriented languages, have we not made all such code-golf challenges trivial?

My challenge: "Write the shortest program which identifies [whether or not a code-golf challenge is trivial / answers P=NP / computes Graham's number / etc]"

My optimal solution: "I have invented a language and written a custom compiler for this particular problem which works like this: If the compiler is given an empty file of length 0, then it runs the routine, built-in, which solves the problem and outputs accordingly. Otherwise, if the file has content, then it is sent to a Python compiler."

Hey, the language is Turing complete... and the solution is provably optimal... and it works for any code-golf challenge!


migration rejected from codegolf.stackexchange.com Aug 5 at 10:25

This question came from our site for programming puzzle enthusiasts and code golfers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as unclear what you're asking by Embodiment of Ignorance, flawr, Adám, Unrelated String, jimmy23013 Aug 5 at 10:25

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    \$\begingroup\$ Please have a look at codegolf.meta.stackexchange.com/questions/10127/… and the questions linked in the first sentence therein. And remember, this site is for fun, so competing to be the shortest in a verbose, general purpose language is a perfectly legitimate way of participating. \$\endgroup\$ – Sanchises Aug 5 at 8:35
  • 2
    \$\begingroup\$ We've had many new users expressing similar thoughts, but please take a closer look at these "contrived" languages: While they are indeed made for golfing, pretty much all of them can be used as general purpose languages. This is not the same as what you suggest, making a language that is optimized to solve exactly one task. You can obviously do this but it seems you and everyone else here agree that this is not an interesting solution. \$\endgroup\$ – flawr Aug 5 at 8:36
  • 1
    \$\begingroup\$ Possible duplicate of Loopholes that are forbidden by default \$\endgroup\$ – Unrelated String Aug 5 at 9:23

There’s an automatically disallowed standard loophole for this (“using a made-up language specifically designed for the challenge”).

  • \$\begingroup\$ As I mentioned as comment when the answer was still at the non-meta side: I think this loophole applies as well (but outsources as file instead of somewhere on the web). Theoretically you could say OP's proposal is still a single language which can be used for any challenge, so doesn't 100% disallow it based on the "using a made-up language specifically designed for the challenge" as is. It's contents in the file do however. \$\endgroup\$ – Kevin Cruijssen Aug 5 at 9:32

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