Golly 2.8b3 (Perl is dead, long live Lua)

For general discussion about Conway's Game of Life.
User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » June 15th, 2016, 11:02 pm

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!).
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » June 15th, 2016, 11:12 pm

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
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Scorbie
Posts: 1693
Joined: December 7th, 2013, 1:05 am

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Scorbie » June 15th, 2016, 11:52 pm

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)

User avatar
muzik
Posts: 5898
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by muzik » June 16th, 2016, 3:23 am

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!
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.

User avatar
Scorbie
Posts: 1693
Joined: December 7th, 2013, 1:05 am

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Scorbie » June 16th, 2016, 8:34 am

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."

User avatar
muzik
Posts: 5898
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by muzik » June 16th, 2016, 8:39 am

Scorbie wrote:This was asked before and Andrew's answer was "probably no, we have other priorities."
:(

What are said priorities?
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.

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

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by dvgrn » June 16th, 2016, 3:05 pm

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...!

User avatar
muzik
Posts: 5898
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by muzik » June 16th, 2016, 3:11 pm

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?
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.

User avatar
Scorbie
Posts: 1693
Joined: December 7th, 2013, 1:05 am

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Scorbie » June 25th, 2016, 3:39 am

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.

User avatar
muzik
Posts: 5898
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by muzik » June 25th, 2016, 3:45 am

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)
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » June 25th, 2016, 6:50 am

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:

Code: Select all

g.exit(#orig.array)
See the m.pattern function in Scripts/Lua/gplus/init.lua for details.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » June 25th, 2016, 6:56 am

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.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
muzik
Posts: 5898
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by muzik » June 25th, 2016, 7:32 am

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.
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.

User avatar
Scorbie
Posts: 1693
Joined: December 7th, 2013, 1:05 am

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Scorbie » June 25th, 2016, 10:10 am

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:

Code: Select all

g.exit(#orig.array)
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 :)

User avatar
Scorbie
Posts: 1693
Joined: December 7th, 2013, 1:05 am

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Scorbie » June 30th, 2016, 11:41 am

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/

User avatar
muzik
Posts: 5898
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by muzik » July 8th, 2016, 8:08 am

Another question that has probably been asked a lot, but will Golly ever be able to simulate odd Wolfram rules?

Code: Select all

x = 1, y = 1, rule = W21
o!
It says that they have the same problems as B0 rules, so why not use a similar approach?
Parity Replicator Collection v1.6 is now live - please send all relevant discoveries here.

User avatar
biggiemac
Posts: 515
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by biggiemac » July 19th, 2016, 12:13 am

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.
Physics: sophistication from simplicity.

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » July 19th, 2016, 12:38 am

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.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » July 19th, 2016, 12:43 am

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).
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
biggiemac
Posts: 515
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by biggiemac » July 19th, 2016, 1:06 am

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.
Physics: sophistication from simplicity.

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » July 19th, 2016, 9:25 am

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.
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » July 19th, 2016, 9:37 pm

@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.)
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
biggiemac
Posts: 515
Joined: September 17th, 2014, 12:21 am
Location: California, USA

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by biggiemac » July 19th, 2016, 10:39 pm

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.
Physics: sophistication from simplicity.

User avatar
Andrew
Moderator
Posts: 981
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Andrew » July 20th, 2016, 9:13 am

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).
Use Glu to explore CA rules on non-periodic tilings: DominoLife and HatLife

User avatar
Apple Bottom
Posts: 1034
Joined: July 27th, 2015, 2:06 pm
Contact:

Re: Golly 2.8b3 (Perl is dead, long live Lua)

Post by Apple Bottom » July 20th, 2016, 12:56 pm

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?
If you speak, your speech must be better than your silence would have been. — Arabian proverb

Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_

Proud member of the Pattern Raiders!

Post Reply