• JS Doors for Synchro

    From art@DIGDIST/BATTLEST/FREEWAY to All on Tuesday, December 15, 2009 19:10:00
    Hey all,

    After debating much the same issue as previous threads about Door libraries, I have come to the conclusion that I might be better off writing doors in JS. This has the restriction of relying on the Synchro JSOM and therefore unportable to other BBS platforms. Another downside is uncompiled source open for all to see--not a problem in this case as I don't mind open sourcing it.

    Apart from these restrictions, what are the downsides to this approach?

    I've written a few test doors and all works as expected, no need to fiddle with door libraries and obviously no problems with multinode and 32bit systems... am I missing the bigger picture?

    Thanks for your input guys.

    Regs,
    +------------------------------+
    | Art % fatcats.poorcoding.com |
    +--------------- ----- -- -

    ---
    þ Synchronet þ fatcats bbs - http://fatcats.poorcoding.com
  • From Nightfox@DIGDIST/BATTLEST/FREEWAY to art on Tuesday, December 15, 2009 13:38:00
    Re: JS Doors for Synchro
    By: art to All on Tue Dec 15 2009 19:10:56

    This has the restriction of relying on the Synchro JSOM and therefore unportable to other BBS platforms. Another downside is uncompiled source for all to see--not a problem in this case as I don't mind open sourcing

    Apart from these restrictions, what are the downsides to this approach?

    Well, JavaScript does have the upside that you don't need to re-compile it for the multitude of different systems that are available. A JavaScript door will run wherever Synchronet runs, whether that be Windows, Linux, BSD, etc.. But the fact that it relises on the Synchronet JSOM is a significant downside.

    Another downside for some doors is speed - If you're writing something that needs to be very fast, JS isn't always the best languge. Not too long ago, I wrote a Synchronet JS door that can solve Sudoku puzzles, but I noticed that it's noticebly slower than a compiled C++ version using the same algorithm. Furthermore, for the algorithm I used (a brute force solving algorithm I found on Wikipedia), there are worst-case Sudoku puzzles that it takes much more time to solve; for the JavaScript version, the JS engine arbitraily terminated the script once it had reached some high number of iterations - The JS engine (falsely) assumed it was in an infinite loop and thus terminated the script. So, for some things, JS might not be the best language.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com