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 »
Meta

Comments on Default Rules: Code Golf I/O

Parent

Default Rules: Code Golf I/O

+8
−0

What input/output methods do you think should be allowed/disallowed while code golfing on this site? What guidelines for input/output methods do you think should be in place?

One method per answer, please. Vote up/down according to if you believe the given method should be allowed.

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

Post
+0
−2

A program may output a boolean value by using different amount of time or instructions till it returns.

If a program needs to determine a boolean value, it may return in less than N second (or instructions) when the value is false but take longer than N + ϵ second (or instructions) when the value is true or vice versa.

The difference (ϵ) has to be large enough to be detectable without much effort. I would suggest there is a factor of at least 16 between true and false (i.e. $ϵ > 15 \cdot N$) . A infinite ϵ should be allowed (if it doesn't return after N second, kill it and consider the result as true). The poster has to give an estimate of N.

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

2 comment threads

Non-observable behaviour (7 comments)
Non-trivial change (3 comments)
Non-trivial change
WheatWizard‭ wrote over 1 year ago

I'm in opposition to this for two reasons. 1. it is not a trivial change in IO, it is a very fundamental change in what can and can't be done. 2. It is not modular, programs written this way can only be combined as part of larger programs in limited ways.

WheatWizard‭ wrote over 1 year ago
  1. With a normal form of output (e.g. 1 and 0) the set of problems that can be solved is the set of computable decision problems. With halting/non-halting output, the set of problems that can be solved is the set of limit computable decision problems. This includes famously non-computable problems such as the halting problem. This means there are certain algorithms with this output that cannot be translated to normal algorithms.

  2. Since there's no way to do anything after producing a falsey result, there's no way to compose functions implemented with this output. You can't for example negate the output. I think programs should be modular and reusable.

And as such I think it should be up to the challenge writer to explicitly allow this form of output.

H_H‭ wrote over 1 year ago

I don't think 2 matters for code golf. There is no goal to have reusable code.

On the other hand, i don't think solutions that require longer to compute as you can reasonable be expected of someone to wait for a result should be allowed by default. The problem is that is a very ambiguous and depend a lot on the computer, interpreter, ... However, it would eliminate the halting problem. But as i said, i was really not sure about this IO method and i am still unsure.

Maybe i should make the suggestion a bit different: A program may output a boolean value by runtime: If it finishes in less than N second (or minute or instructions) the value is true and if it does not finish in N+ϵ second the output is false. Where N is specified by the one posting the code and ϵ should be large enough to make the measurement easy. This would be easy to check and doesn't have the problem of forever.