Today with friend of mine discussed about code golf, I want to ask your opinion about the thing we discussed about.

Would it be legal if I create my own programming (actually scripting) language with many cool built in functions, that would let win code-golf challenges?

Please, do not discuss if it would be hard to implement, but just express your opinion, if it would be legal or not.


  • \$\begingroup\$ I recently had a discussion with GlitchMr about this topic. \$\endgroup\$ Jan 21, 2014 at 2:16
  • \$\begingroup\$ Since I've not enough rep: please add tags and/or extend the title with tags like "DSL", "invent custom language", "create own language", etc. to make it findable. (The title "would it be legal?" applies to nearly 50% of the questions in this meta, I think ;) I didn't found it with searching for therese words, only accidently. \$\endgroup\$ Jun 7, 2014 at 12:41
  • \$\begingroup\$ There are already such languages, and the general consensus seems to be that it's okay as long as you use a version of the language that existed before the question was posted. \$\endgroup\$
    – user344
    Feb 13, 2015 at 19:00

3 Answers 3


I think that Timtech has already done this with a source-to-source compiler which is basically a macro language. That seems to tread rather close to the subject matter of the previous meta question Is a code golfing library legitimate? It's also on rather thin ice because there isn't a generally available reference implementation: the only compiler provided is provided in an encoded format for which there doesn't appear to be a decoder. I personally would not accept or upvote an answer in GTB.

It's easy to imagine a language which would be clearly unacceptable. I'll call it zc: its compiler is

zcat "$@" | sh

and a program is generally written by first writing in another language and then source-to-source translating it. E.g. the "source" is

gcc -flags <<<X
#include foo

after it's run through gzip.

So it seems to me that there are several minimal criteria which affect whether a language which you create is reasonable to use:

  • The source is directly editable in general (i.e. you don't need to "compile" a different source into the code you submit).
  • The language is well enough documented that other people can use it, and there is a reference implementation available for them to use.
  • The language is stable, or at least stable enough that you don't give the impression that you're adding bits for each new challenge.

If you can get other people using your language, that's obviously a big bonus to its credibility. (The creators of J and GolfScript do not, as far as I know, participate on this site).

  • \$\begingroup\$ Would this count? It's not translated, there's a reference, and pretty much fixed right now \$\endgroup\$
    – mniip
    Jan 17, 2014 at 3:30
  • \$\begingroup\$ A stable language? Java is not stable, there are new versions from time to time. I suggest that the language version must already exist when the question was submitted. \$\endgroup\$ Jan 21, 2014 at 2:18
  • \$\begingroup\$ Timwi's got one too, now: esolangs.org/wiki/Sclipting \$\endgroup\$
    – boothby
    Jan 24, 2014 at 18:13

In this post, I'm writing as a user, not a moderator.

Personally, I believe there's a fine line between GolfScript and HQ9+. Both languages are designed for golfing, but GolfScript is actually a general-purpose programming language (albeit one that lacks many useful features like floating-point numbers) that happens to use really short identifiers for its built-in operators, whereas HQ9+ is a language that's tailor-made to be good at three specific problems only.

So my question for you is, is your language going to be general-purpose? (That is, are your "cool built-in functions" going to be applicable to a wide range of programming problems, as opposed to being specific to a small handful of code challenges?) If so, great!

Also, you need to decide what will make your language appealing compared to GolfScript. One of GolfScript's strengths is that, compared to FlogScript, it's actually pretty easy to read: the operators are chosen with some care, and in particular, the author of GolfScript aimed to make most of the operators use punctuation rather than alphanumeric names (and given GolfScript's lexer, there is good reason for this). In contrast, in FlogScript, many operators use alphanumeric names and they are nearly indecipherable (IMHO).


Build it. Then see if they come. What I mean is if you construct such a language, one great test of legitimacy is whether other code golfers start to use it also.

Frustrating as it might seem, you may not get a ruling in advance on this strategy until you actually try it. Context is very important when it comes to judging fairness. And rules can change day to day as the community continues to assess a situation.

Build a compelling tool and they will come! So whatcha got?


You must log in to answer this question.

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