|
|
Scripting language is the programming language developed for record of "scenarios", sequences of operations which the user can fulfil on the computer. Simple скриптовые languages often named earlier as batch processing languages (batch languages or job control languages). Scenarios are usually interpreted, instead of compiled.
In an application, the scenario (script) is a program which automates some task by which without the scenario the user would do manually, using the program interface.
Plug-ins or scripts?
For writing of user's extensions can be used both plug-ins, and scripts. Skriptovyj language is more preferable in such cases. If it is necessary to provide programmability without risk to destabilise system. As, unlike plug-ins, scripts are interpreted, instead of compiled, incorrectly written script will output the diagnostic message, instead of will lead system to crash. If the expressive code is important. First, the more difficult system, the more code it is necessary to write «because it is necessary» — see, for example, Hello World#Маргинальные examples. Secondly, in скриптовом language there can be absolutely other concept of programming, than in the main program — for example, game can be the monolithic one-line application while scripts controlling characters are fulfilled in a parallel way. Thirdly, скриптовый language has the own problemno-oriented instruction set, and one string of a script can do the same that some tens strings in traditional language. As consequence, on скриптовом language the programmer of very low qualification — for example, геймдизайнер the hands can write, without relying on programmers, can adjust game rules. If it is required кроссплатформенность. A good example is JavaScript — it is executed by browsers under the most different OS. On the other hand, as scripts are interpreted from an initial code dynamically at each fulfilment, they are fulfilled usually considerably more slowly the ready programs compiled in the machine code at a stage of compilation. Therefore скриптовые languages are not applied to writing of the programs demanding an optimality and speed of fulfilment. But because of simplicity they are often applied to writing of small, disposable ("problem") programs.
Also in respect of speed скриптовые languages can be divided into languages of dynamic analysis (sh, command.com) and preliminary compiled (Perl). Languages of dynamic analysis read out instructions from a program file minimum required blocks, and execute these blocks, without reading a further code. Precompiled languages read out in the beginning all program, compile it all either in the machine code, or in any internal format, and only then execute turned out code.
Физика и еще раз физика.
1, 1, 1, 1. Бобруйск.
bravenet.com