Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion ANN TclJS 1.0 [Was: Re: Autoproxy behind a corporate firewall that uses a website to configure proxy]
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Neil Madden  
View profile  
 More options Jul 2 2008, 4:12 pm
Newsgroups: comp.lang.tcl
From: Neil Madden <n...@cs.nott.ac.uk>
Date: Wed, 02 Jul 2008 21:12:00 +0100
Subject: ANN TclJS 1.0 [Was: Re: Autoproxy behind a corporate firewall that uses a website to configure proxy]

jal...@gmail.com wrote:
> Okay, taming spidermonkey is one possibility.  I also found -
> http://browsex.com/jstcl.html , which might be able to do the trick.
> The source is available from the site.  Maybe I'll get a chance to
> play around with that or spidermonkey in the near future.  I think
> that developing a method of HTTP access behind these large corporate
> firewalls would be an asset to the community.

I've also wanted easy access to JavaScript from Tcl before (web-scraping
needs it more and more these days). Well, I didn't feel like hacking
around with SpiderMonkey (the install instructions seemed to start with
a dozen or so dependencies, like most Mozilla stuff...), so I instead
opted to quickly wrap the NJS JavaScript interpreter library
(http://www.njs-javascript.org/), which is lightweight and pretty
decent. I've put the result up at: http://www.cs.nott.ac.uk/~nem/tcl/ as
the "tcljs" package. Note: it's LGPL as that is the license NJS uses
(fine for me). Usage:

   package require tcljs 1.0
   tcljs js ;# create interpreter instance
   js eval {
       function foo(a, b) { return a * b; }
       foo(12, 23)
   }

Should make things pretty simple :-) Note though, that NJS does mention
that it is not an entirely standards-compliant interpreter, so possibly
might fail on some things. Should be fine for proxy .pac files, I'd
guess, though.

I was thinking about adding some more features to this, but then I
remembered that TkHTML also has a JavaScript library -- this time to the
SEE lib. See http://tkhtml.tcl.tk/hv3.html and the file hv3see.c for
details. So, it looks like we are now spoiled for choice of JS
interpreter bindings in Tcl... :-)

Cheers,

-- Neil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.