Making a python version of Gfind

For scripts to aid with computation or simulation in cellular automata.
Post Reply
googleplex
Posts: 308
Joined: January 24th, 2018, 4:36 pm
Location: The hertzsprung gap

Making a python version of Gfind

Post by googleplex » February 20th, 2018, 2:14 pm

I would like to make a python version of Gfind so that people can run gfind without using a c compiler.
The source code can be found here.
The Paper describing how it works can be found here.

I think we should write pseudocode and then I can port it to python.
Look at me! I make patterns in golly and go on the forums! I wanna be Famous!

User avatar
Macbi
Posts: 903
Joined: March 29th, 2009, 4:58 am

Re: Making a python version of Gfind

Post by Macbi » February 20th, 2018, 3:49 pm

I suspect that this program would run very slowly, because Python is generally slower than C (being an interpreted language rather than a compiled one).

I got away with writing LLS in Python because all the actual work is done by the SAT solver; which is written in C.

googleplex
Posts: 308
Joined: January 24th, 2018, 4:36 pm
Location: The hertzsprung gap

Re: Making a python version of Gfind

Post by googleplex » February 20th, 2018, 4:43 pm

Yes, but this would be easier to use. No installing Cygwin, just using golly.
Look at me! I make patterns in golly and go on the forums! I wanna be Famous!

User avatar
dvgrn
Moderator
Posts: 10612
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Making a python version of Gfind

Post by dvgrn » February 20th, 2018, 5:25 pm

googleplex wrote:Yes, but this would be easier to use. No installing Cygwin, just using golly.
"Just using Golly" in this case would technically also involve installing Python. These days a script most likely to Just Work for everybody should really be written in Lua instead.

This has always been a difficult dividing line -- basically between people who think that compiling these C/C++ search utilities is trivial, and those who find it to be a very high and mysterious barrier.

As Macbi mentions, the problem is that a Lua or Python script will be only maybe one-tenth as fast as the equivalent compiled C code. What this seems to mean in practice is that for anything interesting that can be found by running a hypothetical gfind script, the odds are very high that it has already been found long ago by someone running a compiled executable.
googleplex wrote:...I think we should write pseudocode and then I can port it to python.
Given the size and complexity of the gfind utility, it doesn't seem as if any possible pseudocode is likely to end up being any easier to understand -- or less buggy -- than the C code that already exists. Might as well start porting to Python or Lua right away, if that still seems like a good idea.

Sokwe
Moderator
Posts: 2645
Joined: July 9th, 2009, 2:44 pm

Re: Making a python version of Gfind

Post by Sokwe » February 20th, 2018, 5:59 pm

As one of the very few people with an in-depth understanding of the gfind source code, I can say that this would be a lot of work, and probably not worth the effort.

I would rather help guide people through installing a c compiler. There are other utilities besides gfind that are written in c (e.g. knight2, knightt, zfind, qfind). Learning to compile c programs will allow users to make use of a much broader spectrum of search programs.
-Matthias Merzenich

AforAmpere
Posts: 1334
Joined: July 1st, 2016, 3:58 pm

Re: Making a python version of Gfind

Post by AforAmpere » February 24th, 2018, 12:11 pm

Is it possible that this idea could be adapted to search for ships in LTL? There are no spaceship searching scripts for LTL that don't involve soup searching, and it would be cool to see one that implemented similar methods to the "find" programs. Golly might help, as it has LTL built in.
I manage the 5S project, which collects all known spaceship speeds in Isotropic Non-totalistic rules. I also wrote EPE, a tool for searching in the INT rulespace.

Things to work on:
- Find (7,1)c/8 and 9c/10 ships in non-B0 INT.
- EPE improvements.

markus_z
Posts: 3
Joined: May 6th, 2018, 3:07 pm

Re: Making a python version of Gfind

Post by markus_z » May 14th, 2018, 4:08 am

Dev C++ portable compiles gfind and gfind-pt easily in Windows. No installation required.

Post Reply