1
votes

I'm looking to dip my toes into coding with Lua - I'm trying to find something to teach my 11-year-old son some programming skills (he's already mastered Scratch :) ). I'm completely new to Lua myself, but I have some background in other languages.

I've downloaded and installed ZeroBrane (v0.80 running on OS X 10.9.5); however, when I try to compile/run any of the sample files the test program turtle.lua, I get a crash:

enter image description here

The same happens if I choose Lua 5.2 as the interpreter. Any ideas as to the possible cause and fix?

EDIT: I was a bit hasty when testing this before; simple Lua code appears to run fine, as do the sample programs in the turtle-samples folder.

The sample code spirograph.lua runs without crashing, but doesn't appear to actually do anything. Turtle.lua still crashes: by stepping through the code, it appears to crash when exiting the loop between lines 543 and 555:

enter image description here

If I press F10 at this breakpoint, I get the Lua crash.

1
Does it happen on all scripts, even a simple one-liner with print 'Hello World'? Does it happen when you try to Run or Debug? - Paul Kulchenko
I tested v0.80 on OX 10.9.5, but don't see any issues and there hasn't been other similar reports. You may want to open a ticket on github. - Paul Kulchenko
@PaulKulchenko: apologies, I should have tested more thoroughly. See my edits above, it's only some sample code that crashes (or, in the case of spirograph.lua, doesn't appear to do anything). - KenD
Added an answer; also the title is a bit misleading as it's the lua application that crashes and not the IDE itself. - Paul Kulchenko
Agreed, I've updated the title. - KenD

1 Answers

1
votes

Both turtle.lua and spirograph.lua files are modules, so you don't need to "run" them as they don't do anything by themselves. You can run all the included examples, and those that use those modules run without issues.

Thank you for debugging it; I'll check what may be causing a crash on turtle.lua, but you can continue using it as a module without issues.