The heavyweight parts of lightweight languages LL1 Workshop November 17, 2001.

Slides:



Advertisements
Similar presentations
Parrot in a nutshell1 Parrot in a Nutshell Dan Sugalski
Advertisements

Chapter 3.2 C++, Java, and Scripting Languages “The major programming languages used in game development.”
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Parrot in detail1 Parrot in Detail Dan Sugalski
SB ScriptBasic Introduction to ScriptBasic There are more people writing programs in BASIC than the number of people capable programming.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Threads, Thread management & Resource Management.
COMP25212: Virtualization Learning Objectives: a)To describe aims of virtualization - in the context of similar aims in other software components b)To.
Why Java? A brief introduction to Java and its features Prepared by Mithat Konar.
Introduction 1-1 Introduction to Virtual Machines From “Virtual Machines” Smith and Nair Chapter 1.
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Processes Introduction to Operating Systems: Module 3.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
CS 346 – Chapter 2 OS services –OS user interface –System calls –System programs How to make an OS –Implementation –Structure –Virtual machines Commitment.
Introduction Why are virtual machines interesting?
The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.
Parrot in a nutshell1 Parrot in a Nutshell Dan Sugalski
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Lecture9 Page 1 CS 236 Online Operating System Security, Con’t CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Language Based Operating Systems by Sean Olson What is a virtual machine? What is managed code? Kernels. Memory and security models. What is a language.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
CINAPTUS Technology Consulting Programming Concepts Simulating Computer Programming with Legos.
Lecture 1 Page 1 CS 111 Summer 2013 Important OS Properties For real operating systems built and used by real people Differs depending on who you are talking.
CS703 - Advanced Operating Systems By Mr. Farhan Zaidi.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
MET4750 Techniques for Earth System Modeling MET 5990 Techniques for Earth System Modeling and Research (
Smalltalk Implementation Harry Porter, October 2009 Smalltalk Implementation: Optimization Techniques Prof. Harry Porter Portland State University 1.
Introduction to Operating Systems Concepts
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
COMP 2100 From Python to Java
Lecture 1b- Introduction
Introduction to Operating Systems
CE 454 Computer Architecture
Assembly language.
CSE 120 Principles of Operating
PROGRAMMING LANGUAGES
The heavyweight parts of lightweight languages
CASE STUDY 1: Linux and Android
Lecture 1 Runtime environments.
Parallel Programming in Contemporary Programming Languages (Part 2)
Introduction to Operating Systems
Virtual Machines (Introduction to Virtual Machines)
Lecture Topics: 11/1 General Operating System Concepts Processes
CSE 451: Operating Systems Autumn 2005 Memory Management
Trace-based Just-in-Time Type Specialization for Dynamic Languages
Outline Chapter 2 (cont) OS Design OS structure
Prof. Leonardo Mostarda University of Camerino
All assignments and information is posted on web site
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Introduction to Computer Systems
Java Programming Introduction
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Introduction to Virtual Machines
Lecture 1 Runtime environments.
Parrot in the Real World
System calls….. C-program->POSIX call
Introduction to Virtual Machines
CSE 153 Design of Operating Systems Winter 2019
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Presentation transcript:

The heavyweight parts of lightweight languages LL1 Workshop November 17, 2001

The generic bits What the heavy lifting is

LL1 Workshop3 Resource Management Proper destruction of dead objects Memory collection and management OS ‘object’ management (threads, files, signals, and suchlike things)

LL1 Workshop4 OS independence The whole world isn’t uniform Provides an abstract interface to OS Allows transparent emulation of features not easily available Frees the programmer from having to worry about the grotty details

LL1 Workshop5 Rich type systems Interpreter’s job to make complex data types behave like simple ones Easy extendibility requires a lot of work under the hood Makes non-traditional types easier for the programmer

LL1 Workshop6 Dynamic behaviour changes Dynamic recompilation Dynamic type behaviour changes Makes classic optimizations somewhat difficult

LL1 Workshop7 High-level programming concept support Closures Continuations Curried functions Runtime class and method autogeneration Matrix operations

LL1 Workshop8 Safe execution Resource quotas External access restrictions Paranoid runtime control-flow checking Static checking possible, but very restrictive

The Parrot bits How we’re doing the heavy lifting for Perl 6. (And Python, Ruby, and Scheme, though they don’t know it yet…)

LL1 Workshop10 Parrot’s design goals Run perl code fast Portable Clean up the grotty bits A good base for perl’s language features Longevity of core design Multi-language capable

LL1 Workshop11 We assume modern hardware Good-sized L1 & L2 caches Main memory access expensive Unpredictable branches expensive A reasonable number of CPU registers Lots of RAM handy

LL1 Workshop12 Parrot’s a register machine Reduces memory load/stores Reduces by-name lookups of variables Translates well to modern hardware Avoids a lot of the common stack twiddling time wasters Can be treated as a large named temp cache for the register-phobic

LL1 Workshop13 Simple and complex types native Native int, native float, strings, and PMCs PMCs are ‘everything else’ Support for arbitrary-precision numbers Interface abstract to make adding new types easy Simple types basically builtin shortcuts for the optimizer

LL1 Workshop14 Split DOD & GC We check for dead objects and collect memory in separate phases Memory tends to get chewed up faster than objects die Most objects don’t need to do anything when they die

LL1 Workshop15 Easy extendability and embeddability Stable binary API Clean interface for extenders Simple and small interface for embedders Internal details hidden Embedders have control over the interpreter’s environment (I/O & %ENV)

LL1 Workshop16 Portable Perl 5 runs (or has run) on 70+ platforms Support for many Unices, Win32, VMS, and Mac Everyone’s got something broken about them Not shooting for lowest common denominator

LL1 Workshop17 High-level I/O model Async I/O everywhere Bulk read support Byte, line, and record access supported where appropriate All I/O can be run through filters Finally dump C’s stdio

LL1 Workshop18 Language-specific features are generally abstract We don’t mandate variable types or behaviours We don’t mandate method dispatch Generic fallbacks provided Lets us punt on the design and put it off for later

LL1 Workshop19 Sort of OO under the hood OO (of sorts--it’s still in C) where appropriate The whole world’s not OO Neither are any CPUs to speak of OO support semi-abstract We use it as an abstraction layer