Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

JSPL vs JavaScript ...and other questions

by ptizoom (Scribe)
on Jul 18, 2017 at 14:18 UTC ( [id://1195345]=perlquestion: print w/replies, xml ) Need Help??

ptizoom has asked for the wisdom of the Perl Monks concerning the following question:

A few decades ago, I wanted to perl-swig the javascripting for vague hording applications. but then failed miserably... We did not have all this help : < https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_User_Guide > at hand !

now I have time to mess with that. but then, trying the joys of JavaScript-1.16+mozjs185, I encounter too many bugs and nasties, and an ultimate frustration when rewarded by SIGVEC messages and showers of core dumps while objects instantiating.

but then JSPL-1.08_1 prooved more docile and compliant to my deeds. I even started pinching some code from it, and stuffing if back to JavaScript. but hey...stop. tingle and come questions... Shouldn't JavaScript be more robust?

somewhat both packages are old, and quietly abandoned on CPAN. unless ActiveState has commercial interests to keep it so, my guts tells me that JSPL is the package to back up.

so, back to the monks, here are my questions:

are they out there, new trendy marriages with SpiderMonkey and Perl ?

if not, would it be worth evolving JSPL rather than JavaScript (sorry) ?

or forget perl and try python (just teasing, like perl too much to do that)?

thanks.
  • Comment on JSPL vs JavaScript ...and other questions

Replies are listed 'Best First'.
Re: JSPL vs JavaScript ...and other questions
by Corion (Patriarch) on Jul 18, 2017 at 14:38 UTC

    Depending on what you actually want to do, you might find other Javascript interpreters less hassle. For example JavaScript::Duktape comes with the interpreter included.

    I don't know what APIs SpiderMonkey provides or JSPL provides that you really need, so I don't know what a good migrations path might be and what your pain points are with the two packages.

    Personally, I run my Javascript in the browser and not on the command line.

      thanks Corion,

      I will check this JavaScript::Duktape out , at first it looks like by prefixing all the key words with "duck_" you can part away from from mozjs (aka spidermonkey) itself; is this ducktape library worth the swap ?

      there are a multitude of packages interpreting javascript, which is quite mind bugling. diversity is ok, and blogs like this can help to find a way and engaging into the right path. hence my questions.

      JE seems to be used a lot.

      WWW-Mechanize-Firefox-0.79, looks promising.

      so it takes a lot of time to evaluate those packages particularly when they fail their dependencies, internal tests, and got neglected. but who knows what would it become in a few years, but one is sure javascript is not dead yet.

        I have only looked briefly at JavaScript::Duktape and patched it to also work on Windows, but I haven't had the need to use it in a more involved way.

        I also haven't used JE, but as it is an implementation running in pure Perl, it is really slow.

        I have used (and written) WWW::Mechanize::Chrome and WWW::Mechanize::Firefox, but if you don't need a browser+DOM, they are vast overkill and likely much more fragile than an embedded VM.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1195345]
Approved by herveus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-23 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found