Making a python version of Gfind

For scripts to aid with computation or simulation in cellular automata.
Post Reply
googleplex
Posts: 331
Joined: January 24th, 2018, 4:36 pm
Location: Minnesota, USA

Making a python version of Gfind

Post by googleplex »

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: 919
Joined: March 29th, 2009, 4:58 am
Contact:

Re: Making a python version of Gfind

Post by Macbi »

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: 331
Joined: January 24th, 2018, 4:36 pm
Location: Minnesota, USA

Re: Making a python version of Gfind

Post by googleplex »

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: 12040
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Making a python version of Gfind

Post by dvgrn »

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: 3400
Joined: July 9th, 2009, 2:44 pm

Re: Making a python version of Gfind

Post by Sokwe »

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
Moderator
Posts: 1432
Joined: July 1st, 2016, 3:58 pm

Re: Making a python version of Gfind

Post by AforAmpere »

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.
The torch of 5S has been passed on again, and is now managed by speedydelete. It can be found here. Also check out my program EPE, a tool for searching for patterns in various rulespaces.
markus_z
Posts: 3
Joined: May 6th, 2018, 3:07 pm

Re: Making a python version of Gfind

Post by markus_z »

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