# Should the “#lang racket” line be included in code golfs?

There has been discussion whether the #lang racket line should be included in code golf submissions.

So really the question is two-fold:

• The technical aspect: Is it possible to run Racket code without the #lang racket line?
• Poll: If it isn't possible to run Racket code without the #lang racket line, should this it be necessary in code golf submissions?

### Edit

It turns out one can use #!racket instead of #lang racket as a shorter alternate form.

### Edit 2

It turns out you do not strictly need the #lang racket when you do this: racket -e "$(< your-racket-file.rkt)" or possibly more likely racket -e "$(pbpaste)" or similar.

### Edit 3

Even simpler -- racket -f your-racket-file.rkt works without #lang racket.

# No.

It's like a shebang, there's no need to count it. I see no reason to include a line that's meant for the shell/compiler. Its not like its real code, it doesn't add to your answer in any way.

Nobody counts shebangs in Bash scripts, since you don't need them to run, so why do that with Racket?

#!/usr/bin/env bash
rm -rf /


Now how many characters is this code? I'd say 8, because that's how long rm is. The shebang doesn't do anything to the code except tell the shell what language the code is. It's like a file extension, but in the file. Are we going to add five bytes for adding .java?

We can easily remove the shebang by using sh or by adding the file extension .sh, meaning we get:

rm -rf /

Wow... now it's only 8 bytes... wylat...

Now let's do that with Racket.

#lang racket
"Hello, World!"


#lang racket specifies the language. It is not needed to run Racket programs in files:

$cat hello.racket "Hello, World!"$ racket -f hello.racket
Hello, World!


There's no need for it, so there's no need to count it.

• In Perl, shebangs have to be counted too. So no reason why Racket should be any different. :-) – Chris Jester-Young Jul 29 '15 at 0:36
• @ChrisJester-Young But you don't need it. I see no reason to include a line that's meant for the shell/compiler. Its not like its real code. – phase Jul 29 '15 at 0:38
• I'm on this boat, as it is possible to run Racket code without the #lang racket line. While it is hacky, it certainly works. See the Question edits for more info. – Winny Jul 29 '15 at 1:16
• Check out the question again, found a method that looks legitimate. racket -f that-file.rkt – Winny Jul 29 '15 at 3:55
• @Winny ;-; That's just running the file through the compiler(/interpreter?), like every language. If that's an option, why is this a question?!? You can use a shebang with Java, but most people just use javac. – phase Jul 29 '15 at 4:06
• @phase Because there is some dissent between some members of the community over it. Winny thinks we don't need to count the line. I feel that we do. This question's purpose is to get some clarity on the topic with the community at large. – Chris Jester-Young Jul 29 '15 at 17:39
• @phase I think your bash shebang should be #!/usr/bin/env bash, nice update btw! – Winny Jul 29 '15 at 18:45
• When I voted no, I did it assuming that #lang racket (12 characters) will be free, but a variant like #lang typed/racket (18 characters) will still cost the difference (6 characters in this case). – manatwork Jul 30 '15 at 6:38

# Yes.

Count the #lang racket in the character count.

• Why? What's your rationale for your claim? – Anubian Noob Aug 4 '15 at 20:33