PJSR: how do you debug?

Nocturnal

Well-known member
Am I missing something? Are you guys really developing complicated scripts without a debugger? Please tell me I'm just not seeing the debugger and point the way.
 
Hi Sander,

I developed my deBayer script without a debugger - just like in the good old days.

You write some code, run it, it doesn't work, so you add a whole load of 'output' code to display the state of variables as the script executes, you (eventually) spot the stupid mistake that you made, fix it, re-execute the repaired code, find that it still doesn't work, send it to Juan, who immediately (and correctly) spots that you really don't have a clue about object-oriented programming, he fixes your stupid mistake, you remove the 500 lines of work-around code that you had developed to overcome your OOP ignorance, re-execute, find that it doesn't work, add a whole load of 'output' code . . . . . . . . . . . . . :mad:

What the heck do I need a debugger for - in any case, most of my code doesn't have 'bugs' - it has 'un-published features'  ::)

Cheers,
 
Niall,

well clearly I know how to program without a debugger but frankly that's for the birds :) In the good old days of C=64 assembly programming I even had a debugger so let's not pretend like debuggers are such a new thing. I think PJSR would benefit a great deal and perhaps get adopted more widely. If there's a way to bolt on a third party debugger that would be fine too.
 
Hi Sander,

I am sure that Juan has mentioned in the past that a debugging IDE was on the cards for PJSR.

And, yes, of course I agree that a debugger would help - but, before or after Documentation and Tutorial Videos?

Decisions, decisions ........
 
Ah yes, documentation and projects before the debugger please :)

I don't remember which javascript parser is used in PI so I can't look up what it would take to add a debugger. Ideally it would be possible to run these scripts outside PI so that people can decide from themselves if they want to spend money on a debugger or not.
 
Ah, I thought it was some kind of monkey that provided jscript. First tried seamonkey but that's something else entirely :) Is this the one? http://www.mozilla.org/js/spidermonkey/
 
Hi Sander,

Well I looked at the Spidermonkey site, and then I had to check that it was actually written in English.

I barely understood a single word  :mad:

Yep, bring back a Debugger-less version of BBC Basic any day !!

Cheers,
 
Hi Niall,

I did some googling and I saw several people lament the fact that spidermonkey comes without a debugger. I'll wait for Juan to comment on this topic but frankly I don't expect a debugger in PJSR any time soon.
 
Hi Sander,

Yes, PixInsight's JavaScript runtime uses Mozilla's SpiderMonkey engine. SM does include a debugger. Here is the source code repository of Mozilla's JavaScript engine:

http://hg.mozilla.org/mozilla-central/file/f8d2c6f4631d/js

The debugger is on the jsd directory. This debugger is a bit old but perfectly usable. The problem is in integrating the debugger with PJSR and the core application's GUI. These are not trivial tasks by no means, and I obviously have other development priorities ?well, a mountain of them to be more precse!

Another possibility is changing the JavaScript engine. Mozilla's engine is fine, but I am a bit tired of their "peculiar" development rhythm and criteria. An alternative would be Apple's JavaScriptCore, or even SquirrelFish, which is the direct competitor to Mozilla's TraceMonkey. Next year I have to make many important decisions regarding future PI development, and this is one of them for sure.

In the meanwhile, don't let the lack of a debugger stop you from getting into PJSR development. Sophisticated scripts can be developed, as we have demonstrated (and will demonstrate; wait to see the image calibration script). It's just a matter of some experience and more structured work. I think it is always worth the effort, and it's funny anyway :)
 
Sophisticated scripts can be developed, as we have demonstrated

Well hey, they built the pyramids without cranes and other heavy equipment. Their mere existence doesn't prove that's the way to go, right? I mean they did grind through thousands of slaves.

:)
 
Sander,

Just try it. I've never used any debugger of any kind, I just debug using the good old 'print' or equivalent. What I really miss is the ability to do testing. I do it at $job on a daily basis and I've really missed in when programming the PJSR. But, anyway, the scripts are there and users are using them, and reporting problems and failures, and when you come and fix them, they will thank your support. Given that your users come back to you with their problems, programming without a debugger or testing is not that bad after all ;). And it's been widely proved that PI users come to the forum and complain loudly enough for you to hear them ;).
 
David,

I ported some PHD code to PJSR to see if it would explain why a star select feature didn't work. So yes, I've tried it and yes I used print statements to debug :) Still that's for the birds. Perl/CGI and ruby code that I write at work could not be developed as quickly as I do without having the Komodo debugger around when print statements aren't enough. It's all about productivity, not just if it's possible or not. Of course it's *possible* to write code without debuggers but that doesn't mean it's desirable.
 
Hi there,

I wanted to start to learn JS scripting in PI. I found some scripts which I roughly understand what they are doing, but to fully understand stuff I tend to debug code and poke around to see what is happening. Now I could not find a debugger in PI at all but found this discussion which is now over 10 years old. I completely agree with what Nocturnal said, and wonder if there are now any news on this side after so many years of waiting.

Cut a long story short: Is there a possibility to debug now PI js scripts ?

Kind regards

Lothar
 
Back
Top