Page 3 of 4
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 15th, 2016, 11:02 pm
by Andrew
muzik wrote:I want to know, when will the next update for the mobile version come out?
Maybe this year. Maybe next year. To be honest I'm in a period when I'm a bit bored by the thought of working on Golly (but don't worry too much -- such periods have never lasted more than a few months!).
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 15th, 2016, 11:12 pm
by Andrew
Scorbie wrote:Almost all golly scripts convert golly's cell lists to list of cell coordinates.
I'm assuming you mean all the scripts
you write? I've never found the need to do that.
That's why there are posts saying "You can do it with zip(celllist[::2], celllist[1::2]) in Python!" in the scripts thread.
I haven't used Lua, so I am not sure what is the best practice to achieve the same thing. Does anybody know this?
You could write a zip-like function as in the following example, but I'm struggling to see why you would want to do that. Just seems to add an extra level of complexity.
Code: Select all
local g = golly()
local function zip(cellarray)
-- convert one-state cell array: { x1, y1, x2, y2, ... xn, yn }
-- to array of cell coordinates: { {x1,y1}, {x2,y2}, ... {xn,yn} }
if (#cellarray & 1) == 1 then
-- cellarray has an odd number of ints
g.exit("Given cell array is multi-state.")
end
local coords = {}
for i = 1, #cellarray, 2 do
coords[#coords + 1] = { cellarray[i], cellarray[i+1] }
end
return coords
end
local carray = g.getcells(g.getrect())
local coords = zip(carray)
g.note(carray[1]..","..carray[2]) -- displays x1,y1
g.note(coords[1][1]..","..coords[1][2]) -- ditto
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 15th, 2016, 11:52 pm
by Scorbie
Andrew wrote:I'm assuming you mean all the scripts you write? I've never found the need to do that.
Hmm! That is very strange! I must be writing it all wrong or maybe we are doing different things.
Well on non-trivial scripts I write, I had to:
Seperate patterns to still lifes.
Find a target inside a pattern.
See if two patterns are identical (this is in fusefinder, but I guess we could do this without zipping by using another layer...)
Get the cells + their boundaries (i.e. empty cells adjacent to a live cell)
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 16th, 2016, 3:23 am
by muzik
This has more than likely been asked before, but will there ever be support for non-totalistic rules in Golly without having to generate a rule table? LifeViewer is capable of this:
Code: Select all
x = 5, y = 3, rule = B36_S2-i34q
5o$5o$5o!
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 16th, 2016, 8:34 am
by Scorbie
muzik wrote:This has more than likely been asked before, but will there ever be support for non-totalistic rules in Golly without having to generate a rule table? LifeViewer is capable of this:
Code: Select all
x = 5, y = 3, rule = B36_S2-i34q
5o$5o$5o!
This was asked before and Andrew's answer was "probably no, we have other priorities."
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 16th, 2016, 8:39 am
by muzik
Scorbie wrote:This was asked before and Andrew's answer was "probably no, we have other priorities."
What are said priorities?
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 16th, 2016, 3:05 pm
by dvgrn
muzik wrote:Scorbie wrote:This was asked before and Andrew's answer was "probably no, we have other priorities."
What are said priorities?
The biggest change for Golly 2.8 is Lua support, which will make it possible to run scripts without a separate Perl or Python install, or the attendant versioning and 32-vs-64-bit headaches. Personally I'm hoping to get some significant updates in for the Life Lexicon and the pattern collection as well, though here it is June already and those projects aren't exactly done yet.
That said, I think the "probably no" has been adjusted to something a bit more positive recently. Not to name any names or make promises on anyone else's behalf, but at least we have a new potential contributor who is looking at adding the necessary code for native isotropic rule support. Check the
golly-test list on Sourceforge for details...!
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 16th, 2016, 3:11 pm
by muzik
dvgrn wrote:
The biggest change for Golly 2.8 is Lua support, which will make it possible to run scripts without a separate Perl or Python install, or the attendant versioning and 32-vs-64-bit headaches. Personally I'm hoping to get some significant updates in for the Life Lexicon and the pattern collection as well, though here it is June already and those projects aren't exactly done yet.
That said, I think the "probably no" has been adjusted to something a bit more positive recently. Not to name any names or make promises on anyone else's behalf, but at least we have a new potential contributor who is looking at adding the necessary code for native isotropic rule support. Check the
golly-test list on Sourceforge for details...!
Wait. Chris is the developer of LifeViewer, right?
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 25th, 2016, 3:39 am
by Scorbie
muzik wrote:Wait. Chris is the developer of LifeViewer, right?
Long time no reply... I am pretty sure he is!
Is it intended behavior for indexing in gplus to change the original pattern?
I don't think anybody has used this feature...
Run the following, for example.
Code: Select all
local g = golly()
local gp = require "gplus"
local orig = gp.pattern("2o!") -- domino
local temp = orig[10] -- temp is empy, but...
g.exit(#orig) -- orig is empty too?!!
This looks like a bug; The python version is working as expected:
Code: Select all
import golly as g
import glife
orig = glife.pattern("2o!") # Domino
temp = orig[10]
g.exit(str(orig)) # Cell list of a domino, as expected.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 25th, 2016, 3:45 am
by muzik
I want to know, why are some named rules not listed on the scroll down thing on the mobile version?
Such as DryLife (B37/S23) and Live Free or Die (B2/S0)
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 25th, 2016, 6:50 am
by Andrew
Scorbie wrote:Is it intended behavior for indexing in gplus to change the original pattern?
It doesn't. Lua's length operator (#) only returns sensible results for strings and for tables that use integer indices starting at 1. To get the length of the cell array stored in the table created by gp.pattern you have to do this:
See the m.pattern function in Scripts/Lua/gplus/init.lua for details.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 25th, 2016, 6:56 am
by Andrew
muzik wrote:why are some named rules not listed on the scroll down thing on the mobile version?
I had to stop somewhere. My original plan was to provide some interface for letting you create your own names (as in desktop Golly's Set Rule dialog) but I ran out of enthusiasm.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 25th, 2016, 7:32 am
by muzik
Well, since I'm that one demon who forces extra and unneccesary tasks upon developers:
I feel like Life-like rules should only show up when QuickLife and HashLife are selected, Generations when Generations rules are selected, etc.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 25th, 2016, 10:10 am
by Scorbie
Andrew wrote:Scorbie wrote:Is it intended behavior for indexing in gplus to change the original pattern?
It doesn't. Lua's length operator (#) only returns sensible results for strings and for tables that use integer indices starting at 1. To get the length of the cell array stored in the table created by gp.pattern you have to do this:
See the m.pattern function in Scripts/Lua/gplus/init.lua for details.
Ahh, thanks. I looked at the code indeed and didn't get what went wrong. Thought it was some lua black magic. Good to know, thanks again

Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: June 30th, 2016, 11:41 am
by Scorbie
For those who are not so familiar with Lua, here is moonscript that compiles to Lua and looks a lot like python (with some significant differences) I think one could reuse most of python's syntax, although I think lua's syntax itself is acceptable.
http://leafo.net/posts/moonscript_overview.html
http://moonscript.org/reference/
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 8th, 2016, 8:08 am
by muzik
Another question that has probably been asked a lot, but will Golly ever be able to simulate odd Wolfram rules?
It says that they have the same problems as B0 rules, so why not use a similar approach?
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 19th, 2016, 12:13 am
by biggiemac
Ok just installed this, had been using 2.6. I'm not sure if I did something wrong regarding GollyPrefs before opening the new version but it doesn't seem to adapt to my 4K monitor, while 2.6 never had this problem. The infoboxes and toolbars are too small to reasonably use and I'm wondering what to change to fix this.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 19th, 2016, 12:38 am
by Andrew
muzik wrote:Another question that has probably been asked a lot, but will Golly ever be able to simulate odd Wolfram rules?
I'm not planning to do it.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 19th, 2016, 12:43 am
by Andrew
biggiemac wrote:Ok just installed this, had been using 2.6. I'm not sure if I did something wrong regarding GollyPrefs before opening the new version but it doesn't seem to adapt to my 4K monitor, while 2.6 never had this problem. The infoboxes and toolbars are too small to reasonably use and I'm wondering what to change to fix this.
More details please. Is this on Windows, Mac or Linux? 64-bit or 32-bit? More technical info on your monitor would be handy. A screenshot would be even more useful (especially one comparing 2.6 with 2.8b3).
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 19th, 2016, 1:06 am
by biggiemac
Andrew wrote:biggiemac wrote:Ok just installed this, had been using 2.6. I'm not sure if I did something wrong regarding GollyPrefs before opening the new version but it doesn't seem to adapt to my 4K monitor, while 2.6 never had this problem. The infoboxes and toolbars are too small to reasonably use and I'm wondering what to change to fix this.
More details please. Is this on Windows, Mac or Linux? 64-bit or 32-bit? More technical info on your monitor would be handy. A screenshot would be even more useful (especially one comparing 2.6 with 2.8b3).
Windows 10, 64-bit golly on 64-bit OS, N501VW Asus laptop.
Screenshots of 2.6 and of 2.8b3 upon launch.
Edit: 2.7 also has the behavior of 2.8. Both do not scale to 4K monitors, at least not without some modification I am still unaware of. I also have the problem where golly presently crashes running python scripts but I remember seeing a thread somewhere about that so it is likely not 2.8 specific.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 19th, 2016, 9:25 am
by Andrew
biggiemac wrote:Windows 10, 64-bit golly on 64-bit OS, N501VW Asus laptop.
Screenshots of 2.6 and of 2.8b3 upon launch.
Yuk! Thanks for doing the screenshots. I've done some googling and it looks like there is a known bug in the wxWidgets code on Win 10 with 4K monitors. There seems to be a simple fix so some time in the next day or two I'll do a new build for you to try.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 19th, 2016, 9:37 pm
by Andrew
@biggiemac: I've uploaded a new
64-bit Windows build so please give it a try and let me know if it fixes the scaling problem. It should look very similar to 2.6.
After unpacking the .zip file I recommend creating a new, *empty* GollyPrefs file in the same folder as the .exe file. That might fix your Python scripting problem. (If you were able to run Python scripts in 2.6 then you should be able to do the same with 2.8, assuming your 2.6 version is also 64-bit.)
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 19th, 2016, 10:39 pm
by biggiemac
The scaling problem has been fixed, thanks!
The Python scripts crash the same as before. My issue was that my previous computer had a 32-bit python and 32-bit Golly and scripts worked. When I got this computer I installed 64-bit Python, but Golly transferred with the backup so it was 32-bit 2.6. I simply hadn't ever needed to run a script. Now I would like to, so I tried installing a 64-bit version of Golly, at which point I decided to update to 2.8.
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 20th, 2016, 9:13 am
by Andrew
biggiemac wrote:The scaling problem has been fixed, thanks!
Good to hear -- thanks for the report!
The Python scripts crash the same as before. ...
I see in another thread that you installed Python 2.7.11. There is a known bug with that version, so you need to uninstall it, then download and install an earlier version like 2.7.10 (64-bit of course).
Re: Golly 2.8b3 (Perl is dead, long live Lua)
Posted: July 20th, 2016, 12:56 pm
by Apple Bottom
Andrew wrote:I see in another thread that you installed Python 2.7.11. There is a known bug with that version, so you need to uninstall it, then download and install an earlier version like 2.7.10 (64-bit of course).
Python 2.7.12 actually came out a few weeks ago. Does that fix said bug?