21
\$\begingroup\$

By physical analogs, I mean solutions written via objects in the physical world. Specifically, I am referring to a couple solutions to this challenge (including my own and a couple others).

  • Should we allow solutions like this?
  • If so, where is the cut off?
    • Should they publish a language specification first?
  • If not, why not?

TL;DR

I ask because I would like a ruling from the community before posting more domino solutions in case my other solutions aren't as well received. I also think it will be helpful to have distinctions on what is allowed and what isn't. For instance, if someone thought to solve a problem with some set of physical analogs, what criterion should they consider before posting the solution here? On the flip side, what criterion should we point to if we downvote a solution like this?

\$\endgroup\$
6
  • 1
    \$\begingroup\$ I don't think anyone would be upset if there were more dominos solutions. That answer is awesome! \$\endgroup\$
    – Blue
    Commented Sep 23, 2016 at 13:30
  • 1
    \$\begingroup\$ You may want to consider scaling the images down a bit, though (or thumbnailing smaller, etc). I don't mind images, but having to scroll through 17 large ones is a bit much :) \$\endgroup\$
    – Geobits
    Commented Sep 23, 2016 at 13:31
  • 8
    \$\begingroup\$ Thanks for making this post. I've been considering bringing this up as well. As much as I've enjoyed your domino post, I have really mixed feelings about allowing non-testable solutions without standardised byte counts as answers. Maybe it would be better to have dedicated challenges for these with a clear definition of input, output and score? \$\endgroup\$ Commented Sep 23, 2016 at 13:46
  • \$\begingroup\$ As much as I want to say "no", I really want to see someone use those logic gates to make a BF interpreter or a prime checker. And oh my goodness a domino computer \$\endgroup\$
    – mbomb007
    Commented Sep 23, 2016 at 13:50
  • \$\begingroup\$ Another (great IMO) dominoes answer \$\endgroup\$ Commented Sep 23, 2016 at 19:22
  • 3
    \$\begingroup\$ @DigitalTrauma The difference being that that one is actually run by a formal and existing interpreter. \$\endgroup\$ Commented Sep 23, 2016 at 21:33

3 Answers 3

17
\$\begingroup\$

To be acceptable as a programming language, a digital simulator must exist.

Photos of dominos are great fun and all, but by themselves they don't really meet the definition of programming language. The basic problem with programming languages 'implemented by the physical world' is that the results of running programs cannot be reliably reproduced. They suffer from nondeterminism: the real world is full of noise and a program that's intended to be deterministic may not be. It's impossible to set up dominos in exactly the same configuration and push them with identical force every time; the mechanics may be affected by air currents or vibrations from a passing truck.

Precision in copying the program is also an issue as a program can only be approximately reproduced from a photograph. Are you willing to specify tolerances for domino positions, shapes, and masses; the smoothness of the table; and the local gravitational field?

The only way to fully address these issues is by writing an interpreter on a computer. This also solves the problem of scoring, since the interpreter can use some file format.

\$\endgroup\$
7
  • 6
    \$\begingroup\$ Devil's advocate: dominoes falling the wrong way is merely a soft error, if you set it up and run again you'll probably get the intended answer. \$\endgroup\$
    – Linus
    Commented Sep 24, 2016 at 22:51
  • 6
    \$\begingroup\$ @Linus There is no specification... so how do you decide whether an event is an error? \$\endgroup\$
    – feersum
    Commented Sep 24, 2016 at 22:59
  • \$\begingroup\$ I'm just suggesting an argument based on being not being reproduced doesn't seem like a hard enough distinction. The biggest distinction I see with dominoes is that it's that's "source codes" form an uncountable set, unlike any discrete language. I'm just not sure whether I have enough for separate answer here or not, since such languages end up being the ones that can be stored on a computer (barring memory limits). \$\endgroup\$
    – Linus
    Commented Sep 24, 2016 at 23:10
  • \$\begingroup\$ do you mean compiler or interpreter? hardly ever do we simulate a language (with the exception of AVRc for microcontrollers) \$\endgroup\$
    – user56309
    Commented Sep 26, 2016 at 19:45
  • 2
    \$\begingroup\$ Can the dominoes be executed in a physics engine like one used in some video games? \$\endgroup\$
    – Vi.
    Commented Sep 29, 2016 at 21:25
  • 3
    \$\begingroup\$ @Linus This is golf, and people may try to do some sort of trick to reduce the number of dominoes used, if that were the score criterion, to the point that one domino just barely touches another domino to trigger it. It's exactly that kind of thing that would be useful to exploit for golfing, and it's also exactly that kind of thing that is prone to be non-deterministic. \$\endgroup\$
    – nitro2k01
    Commented Oct 3, 2016 at 10:15
  • 1
    \$\begingroup\$ @Linus And most people, when they tip over a line of dominoes of significant size, are wondering if it will all work. There is literally no way to set it up such that it is guaranteed to work. \$\endgroup\$
    – mbomb007
    Commented Oct 5, 2016 at 20:36
11
\$\begingroup\$

Native vs Logical

TL;DR :: logical -> esolangs

I think there is an important distinction to be made between different types of physical analogs. There are Native analogs and there are Logical analogs.

  • Native
    • Written in the real world
    • Directly executed in the real world
    • eg Dominoes
  • Logical
    • May be written in the real world
    • Executed via logic
    • Not executed in the real world
    • eg Chess

Native

This code has to be executed in the real world or a simulation of the real world. For example, dominoes can get complex and require the real world in order to execute. You can simulate dominoes or you can simulate the real world but these simulations are simplifications. Whereas for Logical analogs you can actually have an exact implementation in the real world.

Logical

These Logical analogs can be written in the real world, but the are not executed in the real world. They are compiled via a series of rules/constraints/assumptions into a sequence of executable steps. What makes this different from Native is that these executable steps could be executed via a normal everyday interpreter and are independent of the real world. I think we should encourage Logical analog solutions to create a normal esolang.

Example

Lets make a physical analog from tic-tac-toe. Rules:

  • The opponent is a perfect logician
    • If two squares are equally strategic, he will choose the lower and then the left most
  • A win is equivalent to ...
  • A loss is equivalent to ...
  • A cats game is a ...
  • Input is given by ...

Is this Native or Logical? The first bullet point tell us that the logician is the compiler, he executes the program and not the real world, so this is a Logical analog. Since the logicians steps have to be precisely laid out, we could write a Python interpreter to act as the logician and run the code for us. Instead of taking input and giving output in the real world, it is much easier to create a normal esolang for tic-tac-toe. Give the interpreter input like this:

 a | b | c 
---+---+---
 d | e | f 
---+---+---
 g | h | i 

and Python will execute the logical steps and return some output.

Conclusion

Logical analogs should be implemented as esolangs. It makes verification easier and it just makes sense. Thus the set of problematic physical analogs has been reduced to Native ones.

\$\endgroup\$
8
  • 1
    \$\begingroup\$ I definitely support this, but I find the presentation a bit hard to digest. Maybe if you don't call them "machine code" and "compiled languages" but something that isn't already associated with other things, it might clear things up. Maybe call them physics-based and logic-based or something? Discrete and continuous? They don't even need names at all if you just focus on explaining that some of these answers can be emulated accurately by a computer based on simple rules and some can't. \$\endgroup\$ Commented Sep 23, 2016 at 15:37
  • 1
    \$\begingroup\$ I'm unable to understand this post in general but I'm wondering particularly why you mention chess. The rules of chess are a discrete mathematical structure, so why would a chess-related programming language suffer from any issues peculiar to a 'physical' language (unless it's based on tipping over chains of chess pieces? :))? \$\endgroup\$
    – feersum
    Commented Sep 23, 2016 at 15:37
  • 1
    \$\begingroup\$ @feersum He's trying to say the exact opposite. "Physical" languages based on things like chess which follow strict and formal rules can and should be turned into esolangs instead. \$\endgroup\$ Commented Sep 23, 2016 at 15:45
  • \$\begingroup\$ Oh, so this answer doesn't attempt to address actual physical analogs of programming at all? Why is it here? \$\endgroup\$
    – feersum
    Commented Sep 23, 2016 at 15:50
  • 1
    \$\begingroup\$ @feersum Because these three (a, b, c) solutions are similar but I think fundamentally different. \$\endgroup\$ Commented Sep 23, 2016 at 15:54
  • 1
    \$\begingroup\$ (a) and (b) are just non-physical languages that the poster couldn't be bothered to write an interpreter for, no? In your question you ask only about ones that use physics. \$\endgroup\$
    – feersum
    Commented Sep 23, 2016 at 15:58
  • \$\begingroup\$ I can't find the reference but those are covered by the consensus that a programming language must have an interpreter to be valid. \$\endgroup\$
    – feersum
    Commented Sep 23, 2016 at 15:59
  • 1
    \$\begingroup\$ Just pointing out that there's no reason for the "perfect logician" in this answer to need to be male, and that there's no reason to assume that NonlinearFruit is male. Implicit biases are strong in coding communities, and it's good to recognize that they're affecting our assumptions. \$\endgroup\$ Commented Oct 4, 2016 at 6:56
-3
\$\begingroup\$

Dominoes

It seems to me that it would be a bummer to discard all of mechanical computing because it might be problematic. I personally am a huge fan, but I can't think of a general argument. So here is a case for allowing Domino solutions. Note I don't think it is my goal to dot i's and cross t's, I am trying to make a case that domino computing could meet the concerns that have been raised (ie not necessarily how we should meet those concerns).

Problems to Address

I propose that if the following issues are adequately addressed, domino solutions are valid.

  • Sharing :: how do we share domino layouts so that they can be reproduced?
  • Scoring :: how do we calculate bytes for a domino solution?
  • Testing :: how do we verify solutions?

Sharing

This isn't rocket science, setting up dominoes and knocking them over is literally something a child can do. While we could provide distances, angles, weights and details until we are blue in the face; I propose that a clear photo (or set of photos) that unambiguously displays how the dominoes line up is sufficient for someone to replicate the layout.

Scoring

Scoring dominoes in terms of bytes is currently not doable. But consider:

  1. Minecraft didn't have a standard way of measuring bytes until recently
    • there is precedence
    • someone might invent a reasonable byte conversion
  2. There is a micro-competition within each language
    • the shortest answer for each language de facto wins
    • dominoes can compete with dominoes
  3. We are trying to document best solutions in every language
    • this includes esoteric/golfing solutions
    • domino solutions are a similar novelty
  4. Number of tiles is unambiguous

Testing

Vids or it didn't happen! It seems like it would be reasonable for domino solutions to include video confirmation of the test cases. Given the effort involved in creating a video, this requirement should be flexible for trivial solutions. The reason we have test cases is to verify that a solution probably works. So if there is video evidence of a solution working for the test cases, the solution probably works.

Conclusion

Domino solutions are shareable, score-able, and testable so they should be considered valid.

\$\endgroup\$
2
  • 7
    \$\begingroup\$ This proposal violates the site-wide rule that a functional interpreter must exit. This is a site for programming competitions. Unless it can be run on a computer, it's not programming. \$\endgroup\$
    – Dennis
    Commented Oct 3, 2016 at 21:39
  • \$\begingroup\$ @Dennis Agreed. Otherwise we could have "paper and pencil" programming, requiring every user to write down and erase according to set rules. Maybe throw in some origami. \$\endgroup\$
    – mbomb007
    Commented Oct 18, 2016 at 14:50

You must log in to answer this question.

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