Thank you for your response. So I have a Lua table of cells alive, every cell is a table with only x,y of their position.
This is how I add cells to next gen.
table.insert(next_gen_grid, {x = v.x, y = v.y})
And yes I am using for pairs(table) and table.insert. For me, it is better. It is closer to LINQ from C#.
Then I have a separate piece of code. Where I am calculating actual cells to display on tilemap. Similar to your infinite map example.