What golfing languages are better suited as an object for genetic programming?

4

1

I see GolfScript, Pyth, CJam and similar languages can make compex-ish algorithms in few bytes. This terseness makes think about genetic programming applications (using said languaes as the thing being mutated).

I assume that to make a good GP language, it should have following characteristics:

  • Programs are typically short;
  • Random bytes should have high change of being a well-formed program;
  • Programs should compile and run fast;
  • Typical programs should not fall into endless loop often, or such loops should be early-detectable in most cases;
  • Contatenations, extraction of substrings, small modifications should often lead to something related to the original program;
  • Program should be easy to put in a sandbox (i.e. should not crash the interpreter);
  • Be turing-complete or near it.

How much languages typically used for golfing suit for genetic programming?

Vi.

Posted 2015-02-13T15:53:48.563

Reputation: 2 644

Question was closed 2015-02-13T19:23:32.360

3You might want to clarify that you're trying to evolve programs in the target language, as opposed to trying to implement genetic algorithms in a programming language. Also, does it have to be specifically golfing languages? Because Brainfuck for instance is probably a good candidate (and I know it has been used for this purpose). In any case, I'm not really sure this is on topic here. I don't really know which SE it would fit better, because it's sort of open-ended and a bit of a list question. Might be something interesting to discuss in chat though. – Martin Ender – 2015-02-13T15:57:16.670

I also believe this should go to meta instead of main site, – Optimizer – 2015-02-13T18:12:13.677

2@Optimizer I don't think this has a place on meta. Meta is for discussions about how we run this site. If anything it might go on SO or Programmers.SE. We don't have machine learning SE yet (there have been two attempts that didn't survive three weeks of beta), where this would probably be most appropriate. – Martin Ender – 2015-02-13T18:16:45.597

We do have questions like list some well formed questions from main site on meta .. – Optimizer – 2015-02-13T18:19:30.233

4I'm voting to close this question as off-topic because it is neither a programming challenge, nor is it a question asking for golfing advice. I think this might be on-topic on Stack Overflow or Programmers.SE, but at least on the former it could be too open-ended to be well received. – Martin Ender – 2015-02-13T18:21:46.557

4I think this doesn't hurt. It is an advice question directly related to golfing (although not for golfing itself), and can't be expected to be answered better anywhere else. We may want to close it if it becomes too broad or primarily opinion-based. But seeing the two related questions, I think that is unlikely true. – jimmy23013 – 2015-02-13T18:46:55.770

Answers

1

I would be surprised if any golfing languages were appropriate for genetic programming. Pyth, at least, is very unlikely to form a valid program with random bytes, and I believe the same is true of most golfing languages. This, if nothing else, probably invalidates them as genetic programming languages.

isaacg

Posted 2015-02-13T15:53:48.563

Reputation: 39 268

There is a joke about Perl programmer fixing errors in a "programme" typed by mashing random keys on keyboard. For golfing languages I expect higher probability of 20 random bytes being a meaningful program compared to Java or C. – Vi. – 2015-02-13T18:47:38.023

http://en.wikipedia.org/wiki/Malbolge is so complicated that it is easier to generate a program than to write one by hand. – captncraig – 2015-02-13T19:24:44.197

@Vi. I don't dispute that, I just think the ratio is too low for any of these languages to be much good for golfing. – isaacg – 2015-02-13T19:33:44.930

Genetic programming doesn't necessarily require that a large proportion of random strings are valid programs, just that there are at least some potential mutations that are valid. – trichoplax – 2015-06-22T22:08:17.933