This question is because my favorite language C++ does not lend itself to code golf. Now I could try and pick up a new scripting language (like golf-script) or brush up on an old favorite (perl), but that takes time.
I was wondering if introducing a language handicap could help level the playing field for those of us who have not yet had time to learn an appropriate scripting language.
The handicap for a language is the cost of reading a line and writing it back out. Thus the actual golf score is: "the number of characters in the program" - "the cost of language handicap". We could then define for the community these handicaps.
Example: C++ handicap: 109
#include <iostream>
#include <string>
int main(){std::string l;std::getline(std::cin,l);std::cout<<l<<"\n";}
Example: Golf-Script handicap: 0
Example: Perl handicap 12
$_=<>;print
I am sure the perl experts can do better (mine is rusty).
Comments on handicap idea and program needed to define handicap.
This at least would give languages like C++ a fighting chance against more compresses scripting languages.
{}:f
If I am not wrong. \$\endgroup\$print<>
would be shorter. \$\endgroup\$