Lua: The Programming Language. Some Things that Need to be Said Because of increasing demand for customizable applications, the trend nowadays is to split.

Slides:



Advertisements
Similar presentations
Software Development Languages and Environments. Programming languages High level languages are problem orientated contain many English words are easier.
Advertisements

Programming Languages and Paradigms
Portability and Safety Mahdi Milani Fard Dec, 2006 Java.
Lua By: Michael Coffman Peter Sussman. History Lua means ‘moon’ in Portuguese First appeared in 1993 Created by Roberto Ierusalimschy, Luiz Henrique de.
Remote Procedure Call Design issues Implementation RPC programming
Compiler Design PROJECT PRESENTATION : COMPILER FOR OBJECTIVE C Harshal Waghmare Jeet Kumar Nandan Kumar Vishal Agrawal.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM B. Bershad, S. Savage, P. Pardyak, E. G. Sirer, D. Becker, M. Fiuczynski, C. Chambers,
Abstract Data Types Data abstraction, or abstract data types, is a programming methodology where one defines not only the data structure to be used, but.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
1/18 CS 693/793 Lecture 09 Special Topics in Domain Specific Languages CS 693/793-1C Spring 2004 Mo, We, Fr 10:10 – 11:00 CH 430.
Executable XML Present by 吳昆澤. Outline  Introduction  Simkin  Jelly  o:XML  Conclusion.
Communication in Distributed Systems –Part 2
ASP.NET Programming with C# and SQL Server First Edition
C++ fundamentals.
Lua Matthew Spain | Kerry Zhao. Agenda Overview of Lua Language Details Application Areas Demo Conclusion.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Language Evaluation Criteria
Overview. Copyright © 2006 The McGraw-Hill Companies, Inc. Chapter 1 Overview A good programming language is a conceptual universe for thinking about.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Programming Languages and Paradigms Object-Oriented Programming.
CS 355 – Programming Languages
CISC6795: Spring Object-Oriented Programming: Polymorphism.
Workshop on Integrated Application of Formal Languages, Geneva J.Fischer Mappings, Use of MOF for Language Families Joachim Fischer Workshop on.
C++
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
1 Java Inheritance. 2 Inheritance On the surface, inheritance is a code re-use issue. –we can extend code that is already written in a manageable manner.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Chapter 7 Objects and Classes 1 Fall 2012 CS2302: Programming Principles.
SE: CHAPTER 7 Writing The Program
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Games Development 2 Lua Scripting CO3301 Week 6. Contents Introducing Lua –Comparison with Python Lua Language Overview Interfacing Lua with C++
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Ch. 5 Ch. 51 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (more notes) Dr. Carter Tiernan.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Object-Oriented Programming Chapter Chapter
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Ch. 5 Ch. 51 jcmt Summer 2003Programming Languages CSE3302 Programming Languages (more notes) Summer 2003 Dr. Carter Tiernan.
ISBN Object-Oriented Programming Chapter Chapter
Copyright © 2005 Elsevier Object-Oriented Programming Control or PROCESS abstraction is a very old idea (subroutines!), though few languages provide it.
PROGRAMMING IN C#. Collection Classes (C# Programming Guide) The.NET Framework provides specialized classes for data storage and retrieval. These classes.
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
Introduction Mehdi Einali Advanced Programming in Java 1.
Duke CPS From C++ to Java l Java history: Oak, toaster-ovens, internet language, panacea l What it is ä O-O language, not a hybrid (cf. C++)
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
BY: JAKE TENBERG & CHELSEA SHIPP PROJECT REVIEW: JGIBBERISH.
PYTHON FOR HIGH PERFORMANCE COMPUTING. OUTLINE  Compiling for performance  Native ways for performance  Generator  Examples.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
LLVM IR, File - Praakrit Pradhan. Overview The LLVM bitcode has essentially two things A bitstream container format Encoding of LLVM IR.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Database Application Development Chapter 6.
Prepared by Mustafa CAMURLI.  Lua was created in 1993 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, members of the Computer.
Object Based Programming Chapter 8. 2 Contrast ____________________ Languages –Action oriented –Concentrate on writing ________________ –Data supports.
Adding Concurrency to a Programming Language Peter A. Buhr and Glen Ditchfield USENIX C++ Technical Conference, Portland, Oregon, U. S. A., August 1992.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Cody Scoggins, Dion de Jong, Victor Reynolds References:  902/is-lua-interesting-from-a- programming-language-design-
Lecture 1 Runtime environments.
FP Foundations, Scheme In Text: Chapter 14.
What is Lua? Brandon Burgess Csc 415.
Catharine West Bo Aye Saljin LaRocca references
Java History, Editions, Version Features
Lecture 1 Runtime environments.
Introducing Java.
Presentation transcript:

Lua: The Programming Language

Some Things that Need to be Said Because of increasing demand for customizable applications, the trend nowadays is to split complex systems into two parts: Kernel & Configuration

Kernel VS Configuration Kernel implements the basic classes and objects of the system Usually written in a compiled, statically typed language Configuration connects the basic classes and objects to give the application its final shape Usually written in an interpreted, flexible language

Configuration Languages Range from simple languages for selecting preferences (usually implemented as parameter lists in command lines or as variable-value pairs read from configuration files) to embedded languages

Embedded Languages Used for extending applications with user- defined functions based on primitives provided by the application Can be quite powerful being sometimes simplified versions of mainstream programming languages – extension languages

Extension Languages Are called such because the allow the extension of the basic kernel semantics with new user defined capabilities Only work embedded in a host client, called the host program

Requirements for Extension Languages need good data description facilities, since they are frequently used as configuration languages should have a clear and simple syntax, because their main users are not professional programmers

More Requirements for Extension Languages should be small, and should have a small implementation; otherwise, the cost of adding the library to an application may be too high should also be extensible. Unlike conventional languages, extension languages are used in a very high abstraction level, adequate for interfacing with users in quite diverse domains

An Overview of Lua An extensible procedural language with data description facilities It is used to extend programs written in a full programming language

An Overview of Lua Incorporates facilities common to most procedural languages – control structures (whiles, ifs, etc.), assignments, subroutines, and infix operators – but abstracts out any facilities specific to any particular domain

An Overview of Lua Lua is not a stand-alone language thus it needs to be initialized and calledfrom another language like C and C++ In its design, the creation of a few meta mechanisms allow programmers to implement dynamic associative arrays, reflexive facilities, and fallbacks

Dynamic Associative Arrays Directly implement a multitude of data types like ordinary arrays, records, and sets Lever the data description power of Lua by means of constructors

Reflexive Facilities Allow the creation of highly polymorphic parts Persistence and multiple name spaces are not present in Lua, but can be easily implemented using these

Fallbacks Extend the meaning of many syntactical constructions e.g. fallbacks can be used to implement different kinds of inheritance, a feature not present in Lua

History of Lua Lua was raised by three people who call themselves collectively as a committee: Roberto Ierusalimschy,, Luiz Henrique de Figueiredo, Waldemar Celes Filho It was made with modest goals in mind and was finally ‘released’ in 1993

More on Lua’s History PETROBRAS, a Brazilian petroleum company, needed a program for data entry and asked TeCGraf to do it for them For this, the ‘committee’ created DEL

Continuing… After some time, users demanded more features from DEL and at about the same time, the three were working on a configurable report generator for lithology files: SOL

Moving On… By mid-1993, the authors of DEL and SOL realized that the two programming languages can be combined into one simpler language And because this language was a development of SOL (sun) they named it Lua (moon in Portugese)

General Characteristics of Lua Simple Fast Portable

Features of Lua Inherited SOL’s syntax Inherited Sol’s concept of being implemented as library Borrowed Modula’s while, if, and repeat until commands Used CLU’s multiple assignments and multiple returns

More Features… Adopted C++’s concept of allowing local variable declaration Used ‘..’ instead of the usual ‘+’ for string concatenation Optional semicolons:

Lua Languages Six Types Numbers Strings Associative Tables nil Userdata Functions

Lua Versions 1.1  faster compiler (just-in-time compiler)  New opcodes for contructors  Released in 1994

Lua version  from constructors  Fallbacks were introduced Allowed user-defined functions Several kinds of inheritance (including cross- inheritance) Allowed support for object-oriented programming  Released in 1994

Lua version  Main feature of this release was an external compiler: luac Pre-complies Lua codes and saves bytecode and string tables to a binary file Programs can avoid parsing and code generation at run-time, which can be costly  Released in 1996

Lua version  Replaced fallbacks with tag methods Essentially fallbacks that are selected according to the tag of the operator Different tables may now have different fallbacks for their operations A number that represents a new type  Support for conditional compilation  Released in 1997

Lua version  Application Program Interface (API) include explicit states of Lua and is now easier to use and is more efficient  For loop  Released in 2000

Applications made with Lua LucasArts’ Escape from Monkey Island and Grim Fandango PUC-Rio’s general aperture program (simulate the effects on incident photon stream of physical obstructions) Performance Technologies’ command line interface of CPC4400 (a hot swappable ethernet switch) Tollgrade’s DigiTest (telephony network testing)

Lua Examples A very simple configuration file: width = 420 height = width*3/2 -- ensures 3/2 aspect ratio color = "blue"

Another Example A configuration file using Functions: function Bound (w, h) if w < 20 then w = 20 elseif w > 500 then w = 500 end local minH = w*3/2 -- local variable if h < minH then h = minH end return w, h end width, height = Bound(420, 500) if monochrome then color = "black" else color = "blue" end

A Question that need to be Answered How does Lua apply the new configurations to the original program / application?

The Answer… Lua at runtime, calls out the C and C++ functions of the original programming language used and uses those functions to apply the new configurations

For More Information…

The End At last… ;)