Author Topic: PJSR: how do you debug?  (Read 8706 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
PJSR: how do you debug?
« on: 2009 December 08 21:22:13 »

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.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: PJSR: how do you debug?
« Reply #1 on: 2009 December 08 23:27:28 »
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 . . . . . . . . . . . . . >:(

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,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PJSR: how do you debug?
« Reply #2 on: 2009 December 09 07:13:33 »
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.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: PJSR: how do you debug?
« Reply #3 on: 2009 December 09 07:35:28 »
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 ........
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PJSR: how do you debug?
« Reply #4 on: 2009 December 09 08:09:05 »
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.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PJSR: how do you debug?
« Reply #5 on: 2009 December 09 08:42:30 »
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/
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: PJSR: how do you debug?
« Reply #6 on: 2009 December 09 15:34:23 »
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  >:(

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

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PJSR: how do you debug?
« Reply #7 on: 2009 December 09 15:38:20 »
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.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PJSR: how do you debug?
« Reply #8 on: 2009 December 16 04:02:28 »
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 :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PJSR: how do you debug?
« Reply #9 on: 2009 December 16 07:21:01 »
Quote
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.

:)
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: PJSR: how do you debug?
« Reply #10 on: 2009 December 16 15:12:37 »
Yes Sander,

But isn't Juan's master-plan to take over the whole world, one 'PixInsight Addict' at a time  ;D

Cheers,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PJSR: how do you debug?
« Reply #11 on: 2009 December 17 17:57:14 »
But isn't Juan's master-plan to take over the whole world, one 'PixInsight Addict' at a time  ;D

Shhhh! Don't tell anyone!  >:D
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: PJSR: how do you debug?
« Reply #12 on: 2009 December 24 02:17:19 »
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 Serrano

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PJSR: how do you debug?
« Reply #13 on: 2009 December 24 07:56:31 »
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.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity