Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Advice for hosting a language agnostic King of the Hill contest

+3
−0

A King of the Hill contest requires that a controller program provided by the person hosting the contest communicate (both input and output) with each of the entries to the contest. For some contests these entries may be functions to be called by the controller, and in other contests the entries may be stand alone programs that communicate with the controller by some other means.

Some methods of communication (such as function calls) tend to make the contest language specific. For example, a controller that calls functions often means that each entry must be a function written in the same language as the controller.

Language specific contests are permitted, but language agnostic contests have the advantage of including more potential players. They also add an extra layer to the competition, as there is now competition between languages as well as competition between players.

What advice should I bear in mind when designing a language agnostic King of the Hill contest? What approaches would you recommend and what advantages and disadvantages do they have?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+2
−0

Contestants should read from standard input and write to standard output. This is because almost all programming languages, including most esoteric programming languages, allow reading from standard input and writing to standard output. Especially for esoteric programming languages, this is commonly the only way to communicate. Therefore this method of communication is the most inclusive.

If you want to include languages that cannot use a standard input/standard output interface (for example SQL), you can allow a translation layer in another language that turns standard input into a form that the program can read and gives the output. That translation layer would have to do nothing else but pass standard input to the program and write the output of the program to standard output; otherwise the entry would be counted as a combination of two languages (are there any general rules about language combinations here on the site?). For example, in an SQL solution, the input could be passed as argument to a stored procedure, and the output could be a one-row table with one text column, which is written to standard output by the translation layer.

Such a translation layer might also be allowed to support languages that only support non-interactive computation (that is, input is given at the program start, and output is provided at the end of the program) in round-based contests where normally programs are expected to continue running between rounds. In this case, the translation layer would accept extra data after the defined output from the program, would pass the defined output to the controller process, then for the next round it would receive input from the controller process, and pass both that input and the previous output back to the program. The translation layer should not transform that data in any other way. Obviously this part only applies if the code is allowed to keep information between rounds.

It should be on the submitter to make it evident that the translation layer does not sneak in additional behaviour. Also, the languages of the translation layer may be restricted to allow easy checking.

Advantages

This approach is IMHO the most inclusive to all languages, including esoteric languages. The vast majority of languages support interaction though standard input/standard output. The option of a translation layer makes it inclusive also to languages that don't fulfil that requirement

Disadvantages

Allowing a translation layer means extra effort for checking that no extra functionality is sneaked in by that translation layer. However those translation layer should be simple because their functionality is simple.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »