Scripting Languages/Meeting Notes 2018-08-20

From SOBAC Wiki
< Scripting Languages
Revision as of 20:16, 20 August 2018 by BobJonkman (talk | contribs) (Future Topics)
Jump to navigation Jump to search

Scripting Languages

Date
Monday, 20 August 2018 from 7:00pm to 9:00pm iCal
Meetup Event
https://www.meetup.com/NetSquared-Kitchener-Waterloo/events/253044847/
Location
Room 1301 -- Conrad Grebel University College, 140 Westmount Rd. N., Waterloo, Ontario Map
Event Announcement
Scripting Languages/Announcement 2018-08-20

Do you need to do the same thing again and again? Have you automated those repetitive tasks? What software tools do you use? Keyboard macros? Programmable keyboard macros? A scripting language? Which scripting language? What makes a scripting language different from a programming language? Is a scripting language Turing-complete? Can't you just do everything in PowerShell or Bash?

Let's talk about what can be solved with scripting languages, and what can't. Bring your laptop to give a demonstration of your favourite scripting languages, and maybe we can help solve some of your most annoying repetitive problems.


--Bob Jonkman & Marc Paré


Resources


Introductions

  • Testers, programmers, SysAdmins, and some non-scripting user


Programming vs. Scripting
  • "Programs" are compiled, "Scripts" are interpreted
  • BUt mostly there's no differences in syntax
  • Brian Kernighan still uses AWK,
    • Touts the advantages of one-liners, which can't be compiled
    • Lecture he gavbe in the UK, "Successful programming language, why are some more successful than others"
      • Keeps coming back to AWK as a successful language
  • "If you want to compile AWK, just re-write it in C"
  • Use a scripting language to prototype a concept
  • Non-programmers using scripts to do application installation
    • Useful for installing applications without a GUI to get that app installed to the GUI level
    • eg. Mail-In-A-Box, installed with a script


  • Vagrant written in RUBY, but has its own scripting language
  • Lots of variation in scritping language syntax, even within the same language
    • "semicolons forever!"
    • Brackets, or no brackets
    • Is whitespace significant?
    • Indenting
  • many of these are tradeoffs
    • Optimizing for speed, time to program, robustness


  • LLVM (local level virtual machine) is used to create p[rogramming language
    • take input intermediate language, p-code, generates machine language
    • Needs research. Bob can't figure out what this does
    • LLVM is embedded in CLANG, RUST,
    • way to create code generation for your software


  • if all scripting languages were combide, could we reate a universal scripting language?"
    • Probably not -- semantic ambiguity, eg. use of semicolons is different


  • Using one language is comforatable, so you tend to do everything in that language, appropriate or not
    • What is the lifespan of a language? Depends on the domain -- AWK has been around for 25 years, RUST has not
  • How do you keep up with all the new languages?
    • Need to decide what to give up
    • How much spare time do you have
    • How do you know what new tech to embrace
    • Depends on the lifespan of the project, don't spend 3 mo to learn a language for a 2 mo bproject


  • "Lambda the ultimate" on programming language design
    • There is a formal science to language design


  • Still worth learning C?
    • Yes, it's still efficient, has installed base, still close to the hardware
    • C makes it tolerable to understand what is happening in your computer
    • High level languages have many layers of abstraction
    • Knowing C leads to understanding


Scripting is a gateway drug to programming


How do we learn scripting?

  • Get a raspberry pi
  • JavaScript
  • YOu need a project to solve!
  • Find something on GitHub
  • Python is considered the preferred entry-level language
  • "app inventor" allows people with no programming experience ot create aps on android.
  • "Scratch" is another drag'n'drop learning app
  • Marc taught Logo to a kindergarten class
    • NetLogo used for serious science application, complexity science, Santa Fe Institute




    • Other applications like Docker are written in GO, so worth learning


LUA
  • LUA: Access to the Linux encryption keyring subsystem
    • Using GUILE (FSF's SCHEME), not so good for encryption
    • "Python for millennials"
    • Written in ANSI C
    • Very embeddable, no linking,
  • Comiles to a Virtual Machine
  • Two flavours, LUA and LUAJIT (Just-In-Time compiler)
  • Seen in XMPP server, used for real-time application
  • Came from Brazil, unverisity project, released "into the wild"
  • Has facility for OOP, but needs your own OOP tools
  • Has co-routines, program in loops that are interruptable; daisychain them together
  • Functions are first-class entities, so can do functional programming
  • Used in games, htere's a modLUA for APache; handle data in blocks without touching the Apache system
    • Rather than create a web backend, it lets you create the entire web server
  • "Embeddable extension language"
  • There's a bootloader LUA for use before the OS loads in SysLinux
  • Kirk has used LUA and an conversion layer for allowing Apache to work with encryption sysstyem
  • Definitely a good language for testing
  • Bulit into Wireshark for decoding packets
  • How popular is LUA? People make stuff available on GitHub
  • LUA is used in games for event handling
  • Many apps have LUA built-in (on the LUA site)
  • Is scripting a desirable skillin job applications?
    • Python I sone of the most requested skills
    • But shell scripting is difficult, and
    • For security eg. Wireshark, SNORT, and others need scripting to identify network traffic


  • Associative arrays in AWK,
    • Mainstay of Python
    • C only has enumerative arrays, difficult to simulate associative arrays



AWK
  • Conrad Grebel prof Dave Huron used AWK to create a catalogue of music for Hewlett-Packard
    • "HumDrum Toolkit" may be the app name
    • Trying to analyze music, determine patterns among composer
    • Find out if people would be happy if music was two tones up or down
    • Two minutes of this analysis is equal to a human analysis of years
    • Dave Huron one of the first


  • Raymond cleans the data before processing it with AWK
    • Uses BASH to insert parameters begore printing.



  • Much better if data is available though an API, but these scripts were created because there were no APIs



List of scripting languages =

  • AWK
  • Perl
  • Python
  • BASH
  • PHP
  • JavaScript (ECMAScript)
  • TROFF
  • LUA lua.org, wiki, user groups

Other tools

  • Keystroke macros
    • Record and playback keystrokes
    • Bob wants this to be programmable, depending on input processed
    • AutoIT does this on Windows
  • NOt many tools in Linux


    • Muscore has LUA scripting built into it
      • Lilypond has SCHEME or GUILE built in
      • Jon Kulp of Arkansas Uni uses Lilypond (provide links)\


Future TOpics

Back to: Scripting Languages