Teknik Informatika    
   
Daftar Isi
(Sebelumnya) ScripsitScrivener (software) (Berikutnya)

Scripting language

A scripting language or script language is a programming language that supports the writing of scripts, programs written for a software environment that automate the execution of tasks which could alternatively be executed one-by-one by a human operator. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), and several general purpose and domain-specific languages such as those for embedded systems.

Scripting is usually a property of the primary implementations of a language, although many languages are not very suited to this kind of implementation.

Typically, a scripting language is characterized by the following properties:

  • Ease of use. Scripting languages are intended to be very fast to pick up and author programs in. This generally implies relatively simple syntax and semantics.
  • OS facilities - especially filesystem and related, built in with easy interfaces. Scripting is usually aimed at desktops, limiting the portability needs of the pre-built libraries.
  • Interpreted from source code - to give the fastest turnaround from script to execution. On a desktop, the performance of even a slow interpreter is often non-problematic. In comparison, non-scripting languages intended for large programs are often precompiled in at least some sense for superior performance.
  • Relatively loose structure. It would be difficult to use Java as a scripting language due to the rules about which classes exist in which files - contrast to Python, where it's possible to simply define some functions in a file.

Scripts can be written and executed "on-the-fly", without explicit compile and link steps; they are typically created or modified by the person executing them.[1] A scripting language is usually interpreted from source code or bytecode.[2] By contrast, the software environment the scripts are written for is typically written in a compiled language and distributed in machine code form; the user may not have access to its source code, let alone be able to modify it.

The spectrum of scripting languages ranges from very small and highly domain-specific languages to general-purpose programming languages. The term script is typically reserved for small programs (up to a few thousand lines of code).

Contents

History

Early mainframe computers (in the 1950s) were non-interactive, instead using batch processing. IBM's Job Control Language (JCL) is the archetype of languages used to control batch processing.[3]

The first interactive shells were developed in the 1960s to enable remote operation of the first time-sharing systems, and these used shell scripts, which controlled running computer programs within a computer program, the shell. Calvin Mooers in his TRAC language is generally credited with inventing command substitution, the ability to imbed commands in scripts that when interpreted insert a character string into the script.[4] Multics calls these active functions.[5] Louis Pouzin wrote an early processor for command scripts called RUNCOM for CTSS around 1964. Stuart Madnick at MIT wrote a scripting language for IBM's CP/CMS in 1966. He originally called this processor COMMAND, later named EXEC.[6] Multics included an offshoot of CTSS RUNCOM, also called RUNCOM.[7]

Languages such as Tcl and Lua were specifically designed as general purpose scripting languages that could be embedded in any application. Other languages such as Visual Basic for Applications (VBA) provided strong integration with the automation facilities of an underlying system. Embedding of such general purpose scripting languages instead of developing a new language for each application also had obvious benefits, relieving the application developer of the need to code a language translator from scratch and allowing the user to apply skills learned elsewhere.

Some software incorporates several different scripting languages. Modern web browsers typically provide a language for writing extensions to the browser itself, and several standard embedded languages for controlling the browser, including JavaScript (a dialect of ECMAScript) or XUL.

Types of scripting languages

Job control languages and shells

A major class of scripting languages has grown out of the automation of job control, which relates to starting and controlling the behavior of system programs. (In this sense, one might think of shells as being descendants of IBM's JCL, or Job Control Language, which was used for exactly this purpose.) Many of these languages' interpreters double as command-line interpreters such as the Unix shell or the MS-DOS COMMAND.COM. Others, such as AppleScript offer the use of English-like commands to build scripts.

GUI scripting

With the advent of graphical user interfaces, a specialized kind of scripting language emerged for controlling a computer. These languages interact with the same graphic windows, menus, buttons, and so on that a human user would. They do this by simulating the actions of a user. These languages are typically used to automate user actions. Such languages are also called "macros" when control is through simulated key presses or mouse clicks.

These languages could in principle be used to control any GUI application; but, in practice their use is limited because their use needs support from the application and from the operating system. There are a few exceptions to this limitation. Some GUI scripting languages are based on recognizing graphical objects from their display screen pixels. These GUI scripting languages do not depend on support from the operating system or application.

Application-specific languages

Many large application programs include an idiomatic scripting language tailored to the needs of the application user. Likewise, many computer game systems use a custom scripting language to express the programmed actions of non-player characters and the game environment. Languages of this sort are designed for a single application; and, while they may superficially resemble a specific general-purpose language (e.g. QuakeC, modeled after C), they have custom features that distinguish them. Emacs Lisp, while a fully formed and capable dialect of Lisp, contains many special features that make it most useful for extending the editing functions of Emacs. An application-specific scripting language can be viewed as a domain-specific programming language specialized to a single application.

Text processing languages

The processing of text-based records is one of the oldest uses of scripting languages. Scripts written for the Unix tools AWK, sed, and grep automate tasks that involve text files, for example, configuration and log files.

Perl was originally designed to overcome limitations of these tools and has grown to be one of the most widespread general purpose languages.

General-purpose dynamic languages

Some languages, such as Perl, began as scripting languages[8] but were developed into programming languages suitable for broader purposes. Other similar languages – frequently interpreted, memory-managed, or dynamic – have been described as "scripting languages" for these similarities, even if they are more commonly used for applications programming. They are usually not called "scripting languages" by their own users.

Extension/embeddable languages

A number of languages have been designed for the purpose of replacing application-specific scripting languages by being embeddable in application programs. The application programmer (working in C or another systems language) includes "hooks" where the scripting language can control the application. These languages may be technically equivalent to an application-specific extension language but when an application embeds a "common" language, the user gets the advantage of being able to transfer skills from application to application. JavaScript began as and primarily still is a language for scripting inside web browsers; however, the standardization of the language as ECMAScript has made it popular as a general purpose embeddable language. In particular, the Mozilla implementation SpiderMonkey is embedded in several environments such as the Yahoo! Widget Engine. Other applications embedding ECMAScript implementations include the Adobe products Adobe Flash (ActionScript) and Adobe Acrobat (for scripting PDF files).

Tcl was created as an extension language but has come to be used more frequently as a general purpose language in roles similar to Python, Perl, and Ruby. On the other hand, Rexx was originally created as a job control language, but is widely used as an extension language as well as a general purpose language.

Other complex and task-oriented applications may incorporate and expose an embedded programming language to allow their users more control and give them more functionality than can be available through a user interface, no matter how sophisticated. For example, Autodesk Maya 3D authoring tools embed the MEL scripting language, or Blender which has Python to fill this role.

Some other types of applications that need faster feature addition or tweak-and-run cycles (e.g. game engines) also use an embedded language. During the development, this allows them to prototype features faster and tweak more freely, without the need for the user to have intimate knowledge of the inner workings of the application or to rebuild it after each tweak (which can take a significant amount of time.) The scripting languages used for this purpose range from the more common and more famous Lua and Python to lesser-known ones such as AngelScript and Squirrel.

Ch is another C compatible scripting option for the industry to embed into C/C++ application programs.

Market analysis

According to a global survey performed by Evans Data in 2008,[9] the most widespread scripting language is JavaScript. The second most widespread is PHP. Perl is the third most widespread scripting language, but in North America it enjoys significantly more popularity.[10]

See also

References

  1. ^ IEEE Computer, 2008, In praise of scripting, Ronald Loui author
  2. ^ Brown, Vicki. ""Scripting Languages"". http://www.mactech.com/articles/macte ch/Vol.15/15.09/ScriptingLanguages/in dex.html. Retrieved 2009-07-22.
  3. ^ IBM Corporation (1967). IBM System/360 Operating System Job Control Language (C28-6529-4). http://www.bitsavers.org/pdf/ibm/360/ os/R01-08/C28-6539-4_OS_JCL_Mar67.pdf.
  4. ^ Mooers, Calvin. "TRAC, A Procedure-Describing Language for the Reactive Typewriter". Archived from the original on 2001-04-25. http://web.archive.org/web/2001042501 4914/http://tracfoundation.org/trac64 /procedure.htm. Retrieved Mar 9, 1012.
  5. ^ Van Vleck(ed.), Thomas. "Multics Glossary -A- (active function)". http://www.multicians.org/mga.html. Retrieved Mar 9, 2012.
  6. ^ Varian, Melinda. "VM AND THE VM COMMUNITY: Past, Present, and Future". http://web.me.com/melinda.varian/Site /Melinda_Varians_Home_Page_files/neuv m.pdf. Retrieved Mar 9, 2012.
  7. ^ Van Vleck, Thomas(ed.). "Multics Glossary -R- (RUNCOM)". http://www.multicians.org/mgr.html#ru ncom. Retrieved Mar 9, 2012.
  8. ^ Sheppard, Doug (2000-10-16). "Beginner's Introduction to Perl". dev.perl.org. http://www.perl.com/pub/2000/10/begpe rl1.html. Retrieved 2011-01-08.
  9. ^ "PHP, JavaScript, Ruby, Perl, Python, and Tcl Today: The State of the Scripting Universe". Cio.com. 2008-08-29. http://www.cio.com/article/446829/PHP _JavaScript_Ruby_Perl_Python_and_Tcl_ Today_The_State_of_the_Scripting_Univ erse?contentId=446829. Retrieved 2012-11-09.
  10. ^ PHP, JavaScript, Ruby, Perl, Python, and Tcl Today: The State of the Scripting Universe - CIO.com

External links

(Sebelumnya) ScripsitScrivener (software) (Berikutnya)