August 22, 2008

Gecko 1.9.1, TraceMonkey and Venkman?

I admit, I'm pretty blown away by the TraceMonkey announcement. I'm envious. I'm still trying to get my company onto Mozilla Firefox 3 code...

That said, one of the biggest questions with JIT compilation of JavaScript that I've had for months is, "How are we going to debug JavaScript now?".

It probably doesn't help that Venkman didn't make it into hg.mozilla.org. I think that was intentional, and I don't dispute it. Still, with Gijs Kruitbosch on vacation, there's not a lot of people to maintain Venkman (we've been down this road before).

Perhaps the right answer with TraceMonkey is to let Venkman die.

Note that I don't suggest this lightly. Venkman nearly died once with 1.9, and has been on life support for years anyway. With Mozilla 2 breaking backwards compatibility in interfaces - and Venkman left in the dust, not even having automated tests for it (any tests at all?) - by the time we get around to bringing it up to 1.9.1, we may find it simply cannot work with TraceMonkey.

So I'd like to start a general discussion on what sort of JavaScript debugging tools we can craft for Mozilla 2.0. I really, really do care about this - without a good JS debugger, I may be dead in the water for a lot of what I do. (If I'm forced to use and learn DTrace for debugging JavaScript, I'd really like to apply it to a XUL app that can do the work for me.)

Comments are open. Please serious commentary only, not "I want this feature!". I'm trying to find (and join, and participate in!) a group of people who can spend the time on researching & implementing a solution.

Posted by WeirdAl at 5:59 PM | Comments (10)

August 20, 2008

Over Washington, rv

Since everyone else seems to be blogging their vacations, I figure it's my turn. See the extended entry for details.

  • Wed. night / Thu. early, early morning: A little late-night hacking. No sleep before my flight.
  • Thursday: Arrived in Seattle. Noticed the new light rail system going in. We have light rail in San Jose - trust me, you're gonna love it up there. Relaxed for a couple hours, then visited Tillicum Village for a nice smoked salmon & dinner dance. Totally exhausted from no sleep earlier, yet my brothers convince me to join them at a local bar for pool "for a half-hour or so." Yeah, right. Didn't get home until about 11:30 pm, over my quiet fuming.
  • Friday: Full night's sleep, felt pretty good. Rented a bicycle from Montlake Bicycle Shop, then headed for the Burke-Gilman Trail. Ended up somewhere just past Lake Forest Park, a couple hours later. I'd never been on this trail before, and I had a blast. Dinner with an old friend of mine, and picked up a half-dozen used books for the trip home.
  • Saturday: There's only one thing on my mind today: Seattle Seahawks preseason football. Picked up some ear muffs for hearing protection, wandered downtown to pick up the ticket my brother reserved for me. Late-breaking call from the office to fix one little bug (dude, I'm on vacation... ah, well, that's start-up life) just as I'm going into Qwest Field. 29-26 Seahawks, overtime, went home on the bus on a very warm evening. Started fixing this little bug. Sent it in later (sometime Sunday AM) - turns out I only had to recompile.
  • Sunday: Checking out of the hotel in Seattle. Now the fun begins. Have I got everything? Yep, sure looks like it. Off to Church. Leave Church, brunch with uncle & aunt. Leave there, down to the train station. Three hour train ride, Vancouver, WA, to my parent's house. Open up my suitcase. Ummm... where's my jacket? You know, the one with house keys, wallet, and cell phone? Commence freak-out.
  • Monday: Slept very poorly that night - AC is broken. Two hours at a time, all the time wondering where my jacket is. Hotel says they don't have it. Carpool says they don't have it. Suitcase doesn't have it, I wasn't wearing it on the train for sure. I'm scrambling for ideas, even to the point of calling my cell phone provider to locate the phone (which is in the jacket). No dice - it's a company phone, needs company authorization, and no one's in yet. Then I get an e-mail from the Church I went to - someone turned it in. Yay! Problem solved. My brother retrieves the jacket, ships it on Greyhound that afternoon back to me in Vancouver, and I fly home with it. End the weekend with pizza, then a flight and a taxi ride back to my apartment complex.

I actually had so much fun on my vacation that I didn't mind the request from work at all. I only wish I had spent a little more time to work on my pet projects - but the jacket crisis on Sunday and Monday ate all my energy up. Overall, a great success.

Posted by WeirdAl at 5:58 PM | Comments (0)

August 14, 2008

Regular expressions: Editing in a grid

This is for you, glazou, and your Diavolo editor. (Though I wrote it for Verbosio as well - I need it too.)

As I started my vacation, I was thinking, "I'd like to edit regular expressions in Mozilla. But I don't want to edit one at a time. I want to edit a bunch, and see what they all do to a bunch of text."

So in four late-night hours, I put together a simple XBL binding to help me do just that:

Each keystroke updates the table. When a regular expression is not well-formed, it disappears (and the results fields under it). When text and regular expression don't match, the cell they share goes blank. The rest of the UI is, I hope, fairly self-explanatory for anyone familiar with JS regexps.

Yes, I know it's not localized, and it's not pretty. It's functional, though, and for proof-of-concept code, that's all I care about.

You may also notice this is on the new hg.mozdev.org repository. I'm in the process of converting over from CVS to Mercurial, and doing some other clean-up as well.

Posted by WeirdAl at 2:32 AM | Comments (1)

August 11, 2008

Over Washington, redux

A few weeks ago, I said I'd be in Washington for ten days on vacation. Then my supervisor approached me...

So I'm still going, but only for half as long:

  • August 14-17: Seattle
  • August 17-18: Vancouver

Again, if anyone's interested in meeting up, let me know!

Posted by WeirdAl at 6:58 PM | Comments (2)

August 9, 2008

Cool tip of the day: Where in the DOM is your mouse?

What, elementFromPoint isn't good enough for you? Well, in my case, no. For Verbosio, it would help a great deal to convert a mouse point to a DOM range point (think scripted selections, drag & drop like Pencil does, etc.). DOM ranges form, among other things, the basis for Mozilla's selection algorithms.

Fortunately, there's a way to figure it out. Just ask the mouse event for the range coordinates. Literally.

window.addEventListener("mousemove", {
  handleEvent: function(aEvt) {
    this.rangeParent = aEvt.rangeParent;
    this.rangeOffset = aEvt.rangeOffset;
  }
}, true);

This comes to us courtesy of the nsIDOMNSUIEvent interface.

The funny thing is, I knew about this back in 2002, when I was writing my book for Sams Publishing. I forgot about it sometime over the past six years (and I admit now that the book's been only partially useful since then, missing certain bits of info I would've liked to know then).

Now, imagine using this to give a visual indicator where a given element you're dragging will be dropped in a HTML or XML document...

Posted by WeirdAl at 11:18 PM | Comments (0)