BYTE.com
RSS feed

Newsletter
Free E-mail Newsletter from BYTE.com
Email Address
First Name
Last Name




 
    
             
BYTE.com > Tangled in the Threads > 2002 > February

What Is General-Purpose Scripting?

By Jon Udell

February 18, 2002

(What Is General-Purpose Scripting? :  Page 1 of 1 )



Language and environment are the two axes of debate. Someday we may be able to separate these issues, but probably not anytime soon.

A friend wrote recently to ask my thoughts on [ECMA|Java|J]Script (which I will now, out of habit, refer to as JavaScript) as a general-purpose scripting language. He teaches software engineering courses and would like to use Python but, he says, there's pushback because people seem to long for a syntax like that of C or Java. Coincidentally, I'd just been doing some work that prompted me to rethink my own assumptions about JavaScript's effective domain. Although I usually reach for JavaScript when I need to activate a web page in some way, and generally rely on its special relationship to the browser and its document object model, I've also increasingly found myself running JavaScript from the command line using the cscript utility that's part of the Windows Scripting Host (WSH).

Here's an example. I work on a project that needs some ad-hoc reporting. The database is accessible at an authenticated URL, allows a subset of SQL to be passed on the URL-line, and returns results as HTML or XML. Queries have two general flavors: Some count or sum matching records for a set of dateranges, others display them. The queries further subdivide into families; within each family a query has the same general shape, which varies along one or several dimensions. Typically, in this situation, I've used templates to express the query shapes, and Perl to interpolate values into variable slots and run the queries. But this time, I wanted to make the mechanism available to others without requiring them to have or use Perl, or deal with any CGI machinery. Why not use JavaScript to manage the query templating and query execution?

There was one obstacle. The queries that return counts of records are used interactively, as a kind of status dashboard. But there's also a need to record these numbers at regular intervals and save them for longitudinal analysis.

 Page 1 of 1 


BYTE.com > Tangled in the Threads > 2002 > February
Dr. Dobb's Media Center
BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE: Volume 2 - Heuristic Algorithms
The Best of BYTE: Volume 2 - Heuristic Algorithms
In this volume of Best of BYTE, we explore the emergence of some heuristic algorithms. Although we have only scratched the surface of this intriguing subject, we hope we've suggested the potential of the synthesis of heuristics and algorithms.

© 2008 Think Services, Privacy Policy, Terms of Service, United Business Media Limited
Site comments: webmaster@byte.com
Web Sites: BYTE.com, dotnetjunkies.com, Dr. Dobb's Journal, SD Expo, Sys Admin, sqljunkies.com, Unixreview



MarketPlace
Try Numara FootPrints 9, The ITSM software that Delivers Real Value, Flexibility and Results.
Sign Up & Get Full Access To The Definitive Online Book Collection With SkillSoft's Books24x7�.
Fast online exception analysis. Capture customer crash data online.
One Stop to Buy All Your Business IT Solutions. Browse Through Dell's Best Deals Online Now!
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.
Wanna see your ad here?
 

web2