Page 1 of 5

Löve debugging with ZeroBrane Studio

Posted: Fri Jun 29, 2012 10:26 pm
by paulclinger
Hi All,

I've been teaching my 8-year old son programming in Lua using the IDE I've developed and noticed how excited he got when I showed him a simple Löve game. It wasn't in my plans, but I thought it may be a good exercise to see how extensible the IDE I've been working on is and to make it easier for him to debug his scripts, so I added auto-complete and debugging support for Löve (thanks to Santos for posting löve API as a Lua table). I made a blog post with a brief description and a screencast here: http://notebook.kulchenko.com/zerobrane ... -debugging.

Before doing that I thought I'd look for what's out there and found a good dozen of IDE projects, most of which seem to be dead now (love studio is probably one exception):
There also seems to be enough interest in having some IDE for debugging of Löve scripts, as indicated by the following topics (with some people using code editors and others using Decoda or Koneki/LDT):
The source code for the IDE (in Lua) is available on github; the packaged versions for windows and Mac are available on the project website. The current version in the repository also runs on Linux. I'll take questions/suggestions here (if any), but if you come across an issue, please open a ticket on github.

Paul.

Re: Löve debugging with ZeroBrane Studio

Posted: Sat Jun 30, 2012 8:09 am
by bartbes
This looks pretty interesting. I'm on linux, though, and even if it was out, I doubt I could leave my beloved vim behind.

Re: Löve debugging with ZeroBrane Studio

Posted: Sat Jun 30, 2012 11:47 am
by coffee
With all respect paul for your work the problem of any custom editor made for LOVE is that the benefits of debugging (or any other LOVE oriented feature) don't make intermediate/advanced coders leave their favorite editors. You can have some positive responses from first-time coders and LOVE beginners but anyone else that need an editor for a couple more languages won't look at this with much enthusiasm. Also you have the problem that your editor is OS dependent. So anyone like me (using OSX) or Linux can't even work or test it easily. So don't be surprised that all that editors end "dead".

Re: Löve debugging with ZeroBrane Studio

Posted: Sat Jun 30, 2012 12:56 pm
by Santos
Congratulations! :awesome:

While admittedly I also can't imagine using anything other than Vim for now (until Light Table is released), I would guess that debugging support will be useful for a lot of people. Live coding could also be a compelling use case. Do the number sliders work with LÖVE? LICK may be of interest.

Re: Löve debugging with ZeroBrane Studio

Posted: Sat Jun 30, 2012 4:48 pm
by paulclinger
@bartbes and @coffee, MacOS version is in the works (https://github.com/pkulchenko/ZeroBraneStudio/issues/14) and I expect it to be available in the next version and match the features of the Windows version. The linux version will take a bit longer, but there has been some interest around it and I opened a ticket for those who may have time to contribute (https://github.com/pkulchenko/ZeroBraneStudio/issues/15).

In terms of the support for intermediate/advanced coders, I'm not trying to convince people to leave their favorite editors. In fact, outside of Lua development, most of my consulting work is done using vim running in a terminal window. Still, having to support only one language allows me to provide features that are not available in more general-purpose editors. Live coding (as noted by Santos) is one of the features, but there are others (like stack view with a hierarchy of local/upvalue variables or an integrated remote console that allows you to change your code while your app is being debugged) and I have plans for more; some of those may be of interest to more experienced developers too.

Re: Löve debugging with ZeroBrane Studio

Posted: Sat Jun 30, 2012 4:57 pm
by paulclinger
@Santos, the sliders don't work with Löve debugging at the moment, mostly due to a different control loop that Löve is using. There are some technical challenges, but I think it is doable and it may end up being even more powerful than the current live coding as (if what I'm trying is going to work) this will allow you to update the code without restarting the game.

I checked LICK and it looks like an interesting approach to live coding; the way it's done in ZeroBrane Studio is completely different, although in terms of the end result it may look similar. I'll update the thread with the result of my experiments.

Re: Löve debugging with ZeroBrane Studio

Posted: Sat Jun 30, 2012 6:11 pm
by coffee
paulclinger wrote:MacOS version is in the works and I expect it to be available in the next version and match the features of the Windows version. The linux version will take a bit longer, but there has been some interest around it and I opened a ticket for those who may have time to contribute.
That's good to know and welcomed. Even that Zerobrane wouldn't turn the main editor of many of us could became an valuable asset in LOVE dev.

Re: Löve debugging with ZeroBrane Studio

Posted: Mon Jul 02, 2012 5:56 am
by _ex_
This is way awesome!
I was planning to do exactly this for my Lua dialect and you have done already a lot of the work for me :D

Re: Löve debugging with ZeroBrane Studio

Posted: Mon Jul 02, 2012 10:32 pm
by kclanc
Pretty cool. When I tried debugging zoetrope, I initially got a bunch of warnings about accesses to the undefined global jit on mobdebug line 430. After commenting that line out, everything seemed to work fine. I like how you can embed links in the comments in this editor. Are you planning to add the ability to trap errors? For me, that is an extremely important feature for a debugger. I'm also curious about the type/class guessing that you mention in the project's wiki. How does that work?

Re: Löve debugging with ZeroBrane Studio

Posted: Tue Jul 03, 2012 12:21 am
by paulclinger
kclanc wrote:Pretty cool. When I tried debugging zoetrope, I initially got a bunch of warnings about accesses to the undefined global jit on mobdebug line 430. After commenting that line out, everything seemed to work fine.
I added a local variable to reduce the number of messages on jit global to one. It seems like löve is using some sort of "strict" module, which I didn't realize.

> I like how you can embed links in the comments in this editor.

it implements limited Markdown support, so you can add links, headings, and bold/italic/code/highlight text.

> Are you planning to add the ability to trap errors? For me, that is an extremely important feature for a debugger.

Can you elaborate a bit more on what you mean by trapping errors? Right now I simply report everything that the app throws.

> I'm also curious about the type/class guessing that you mention in the project's wiki. How does that work?

Where on the wiki? We do plan to implement type/class guessing, but it has not been completed yet.

Paul.