The heavyweight parts of lightweight languages

Slides:



Advertisements
Similar presentations
Programming for Beginners
Advertisements

Chapt.2 Machine Architecture Impact of languages –Support – faster, more secure Primitive Operations –e.g. nested subroutine calls »Subroutines implemented.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Parrot in a nutshell1 Parrot in a Nutshell Dan Sugalski
PhD/Master course, Uppsala  Understanding the interaction between your program and computer  Structuring the code  Optimizing the code  Debugging.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
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.
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
Software Overview. Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program.
Introduction 1-1 Introduction to Virtual Machines From “Virtual Machines” Smith and Nair Chapter 1.
1 Names, Scopes and Bindings Aaron Bloomfield CS 415 Fall
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.
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
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.
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.
The heavyweight parts of lightweight languages LL1 Workshop November 17, 2001.
Introduction to Operating Systems Concepts
Chapter 4: Threads Modified by Dr. Neerja Mhaskar for CS 3SH3.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
COMP 2100 From Python to Java
Lecture 1b- Introduction
Introduction to Operating Systems
CE 454 Computer Architecture
Assembly language.
Chapter 1 Introduction.
CSE 120 Principles of Operating
PROGRAMMING LANGUAGES
CASE STUDY 1: Linux and Android
Chapter 1 Introduction.
Lecture 1 Runtime environments.
Introduction Enosis Learning.
Chapter 2: Operating-System Structures
Introduction Enosis Learning.
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
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
CSc 453 Interpreters & Interpretation
JIT Compiler Design Maxine Virtual Machine Dhwani Pandya
Presentation transcript:

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

What the heavy lifting is The generic bits What the heavy lifting is

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

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 Workshop

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 Workshop

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

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

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

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…)

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 Workshop

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 Workshop

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 Workshop

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 Workshop

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 Workshop

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 Workshop

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 Workshop

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 Workshop

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 Workshop

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 LL1 Workshop