News for hackers. Stuff that matters.
Re:From Python to Lua: Why We Switched by LewisJEllis on Tuesday January 26, 2016 @04:05PM (#10976059)
Sure, technically you /can/ do it, but only in the same way that you can use negative indices in JavaScript arrays and objects. The 0-indexed element won't tie into length operators without additional manual bookkeeping with table.setn.

  $ lua
  Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
  > x = {}
  > x[0] = 1
  > =#x
  0
  > =x[0]
  1
  > x[1] = 2
  > =#x
  1
  >
  $ node
  > x = []
  []
  > x[-1] = 0
  0
  > x[0] = 1
  1
  > x
  [ 1, '-1': 0 ]
  > x.length
  1
That's reason enough IMO to just suck it up and use 1-based indexing, even before you add munificent's (stronger) point about standard libraries and the rest of the ecosystem.

I agree that 1-based indexing isn't as much of a downside as people make it out to be, but saying you can ignore it and index from 0 "no worries" is just being silly.

Re:From Python to Lua: Why We Switched by qwertyuiop924 on Tuesday January 26, 2016 @05:51PM (#10976877)
In lua, iterating over arrays/tables with things like ipairs() is the idiom, so it's not so bad, but if you want to do anything involving mod, you have to add an extra plus 1. this is where bugs happen.
Re:From Python to Lua: Why We Switched by LewisJEllis on Tuesday January 26, 2016 @08:49PM (#10977678)
Yes, ipairs is idiomatic, but that doesn't matter here because ipairs doesn't return the 0 index.

  > x = {}
  > x[0] = 2
  > x[1] = 3
  > for i, v in ipairs(x) do print(i, v) end
  1	3
  > x[2] = 4
  > for i, v in ipairs(x) do print(i, v) end
  1	3
  2	4
Re:From Python to Lua: Why We Switched by qwertyuiop924 on Wednesday January 27, 2016 @08:19AM (#10979862)
No, what I mean is that it's not idiomatic to access lua "arrays" by index.
Re:From Python to Lua: Why We Switched by fit2rule on Wednesday February 03, 2016 @07:13AM (#11026027)
The only requirement is the Lua developer knowing how to use a Lua table for anything they need.