17
Scripting Languages Intro Jan Stelovsky, ICS 215

Scripting Languages Intro Jan Stelovsky, ICS 215

Embed Size (px)

Citation preview

Page 1: Scripting Languages Intro Jan Stelovsky, ICS 215

Scripting Languages Intro

Jan Stelovsky, ICS 215

Page 2: Scripting Languages Intro Jan Stelovsky, ICS 215

Wikipedia

• A scripting language, script language or extension language is a programming language that allows control of one or more software applications.

• "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the end-user.

• Scripts are often interpreted from source code or bytecode, whereas the applications they control are traditionally compiled to native machine code.

• Scripting languages are nearly always embedded in the applications they control.

Page 3: Scripting Languages Intro Jan Stelovsky, ICS 215

Comment

• from stackoverflow:– You will notice the use of "usually", "often",

"traditionally" and "nearly always" - these all tell you that there is no set of distinct attributes that make a specific language a "scripting language".

Page 4: Scripting Languages Intro Jan Stelovsky, ICS 215

Scripting vs. “Programming” Languages

• Scripting languages are Programming languages (PL)• interpreted vs. compiled

– slow vs. fast• but: Java – a PL is hybrid

– compiled to bytecode• bytecode is common to all hardware platforms• bytecode is then interpreted

– JIT even compiles to “native” code dynamically• but: LISP – a PL - is interpreted• but: scripting languages became hybrid/compiled

– all JavaScript scripts are nowadays compiled

Page 5: Scripting Languages Intro Jan Stelovsky, ICS 215

Hybrid Processing

programscript

bytecode

nativeWindows

Intel

nativeMac

Intel/Motorola

nativeLinuxIntel

Page 6: Scripting Languages Intro Jan Stelovsky, ICS 215

Scripting vs. “Programming” Languages cont.

• scripting languages often operate other programs, or the operating system (OS), e.g. Windows, or other applications, e.g. the browser– batch “shells” on Unix– Applescript operating other applications

• but often programs in PL can execute or at least create scripts for scripting languages

• but does JavaScript “operate another program”– the browser?

Page 7: Scripting Languages Intro Jan Stelovsky, ICS 215

Other Aspects

• verbose vs. terse– PL are typically terse, vs. Applescript• but

– but most languages adopted C syntax: C, C++, Java, JavaScript, even Ruby

Page 8: Scripting Languages Intro Jan Stelovsky, ICS 215

Other Uses of Scripting Languages

• CoffeeScript is a better JavaScript– classes: inheritance

• consistency• alleviates JavaScript quirks– == and ===– is variable defined?– what’s variable’s type

• needs to be translated to JavaScript

Page 9: Scripting Languages Intro Jan Stelovsky, ICS 215

PL Charts

• How did PLs develop– typical chart

– http://upload.wikimedia.org/wikipedia/commons/a/a7/TaxonomyofProgrammingLanguages.png

• mostly C as “grandfather”• Java = C++--

– consider trends (innovation, density)• book publishers, e.g. O’Reilly

– http://oreilly.com/news/graphics/prog_lang_poster.pdf

Page 10: Scripting Languages Intro Jan Stelovsky, ICS 215

Traditional PL Chart (top)

Page 11: Scripting Languages Intro Jan Stelovsky, ICS 215

Traditional PL Chart (bottom)

Page 12: Scripting Languages Intro Jan Stelovsky, ICS 215

O’Reilly PLs & Books

Page 13: Scripting Languages Intro Jan Stelovsky, ICS 215

O’Reilly PLs

Page 14: Scripting Languages Intro Jan Stelovsky, ICS 215

Most Recent O’Reilly PL Books

• 8 out of 13 newer PLs (=60%) • Note: JavaScript ~= ECMA Script ~= ActionScript

Page 15: Scripting Languages Intro Jan Stelovsky, ICS 215

215, ICS and PLs Popularity

ICS 215• 5 out of 11 most

popular PLs (mpPLs)

• 24% of mpPLs

ICS• 7 out of 11 mpPLs• 55% of mpPLs

Page 16: Scripting Languages Intro Jan Stelovsky, ICS 215

Conclusion

• The differences between Scripting Languages and Programming Languages are getting more and more blurred

• languages are becoming compiled or at least hybrid• languages often operate OS or other applications

– e.g. access to file system• our distinction is mainly historical

– Java (Pascal) and C++ are taught in intro courses– we need to expose students to other languages

• ICS exposes you to most of the trending PLs– already in undergraduate curricullum– in particular in ICS 215 (and ICS 315)

Page 17: Scripting Languages Intro Jan Stelovsky, ICS 215

Our Definition

• now– JavaScript– Ruby– PHP– Python– Perl

• in future– other new programming languages as they

become important