Design of the Parrot Virtual Machine The OO-ish bits

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

An Overview Of Virtual Machine Architectures Ross Rosemark.
Introduction to .NET Framework
Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
OO in Parrot Dan Sugalski April 14, 2003.
Object-Oriented Programming Python. OO Paradigm - Review Three Characteristics of OO Languages –Inheritance It isn’t necessary to build every class from.
Inheritance Lakshmish Ramaswamy. Example A Rectangle class with area method A Circle class with area method Array containing references to circles & rectangles.
Parrot in a nutshell1 Parrot in a Nutshell Dan Sugalski
Chapter 9 Subprograms Sections 1-5 and 9. Copyright © 2007 Addison-Wesley. All rights reserved. 1–2 Introduction Two fundamental abstraction facilities.
CSE341: Programming Languages Lecture 22 Multiple Inheritance, Interfaces, Mixins Dan Grossman Fall 2011.
The successes and failures of a language as a language extension. Kasper B. Graversen presented at ECOOP’03 workshop 15.
File Systems and Databases
Memory Management 2010.
16/22/2015 2:54 PM6/22/2015 2:54 PM6/22/2015 2:54 PMObject-Oriented Development Concept originated with simulating objects and their interactions. Adapted.
12.1 Exceptions The limitations of traditional methods of exception handling Error conditions are a certainty in programming Programmers make.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
Source Code Basics. Code For a computer to execute instructions, it needs to be in binary Each instruction is given a number Known as “operation code”
Chair of Software Engineering Beyond Eiffel these slides contain advanced material and are optional.
Introduction to .Net Framework
BIT 1003 – Presentation 7. Contents GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
CSC 142 O 1 CSC 142 Java More About Inheritance & Interfaces [Reading: chapter 13]
CS 403 – Programming Languages Class 25 November 28, 2000.
1 Chapter 10: Data Abstraction and Object Orientation Aaron Bloomfield CS 415 Fall 2005.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Chapter 2 Introducing Interfaces Summary prepared by Kirk Scott.
OOP and Dynamic Method Binding Chapter 9. Object Oriented Programming Skipping most of this chapter Focus on 9.4, Dynamic method binding – Polymorphism.
Introduction to Object Oriented Programming CMSC 331.
Object Oriented Software Development
Scaling Heterogeneous Databases and Design of DISCO Anthony Tomasic Louiqa Raschid Patrick Valduriez Presented by: Nazia Khatir Texas A&M University.
.NET Security and MSIL Tom Roeder CS fa. MSIL Common intermediate language really CIL in ECMA standard MSIL is common name Very close to C# (and.
Implementing an Interpreter Dan Sugalski
Lecture 10 Concepts of Programming Languages Arne Kutzner Hanyang University / Seoul Korea.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
What’s new in Perl 6 (The short form) Dan Sugalski
Object-Oriented Programming Chapter Chapter
Concepts of programming languages Chapter 5 Names, Bindings, and Scopes Lec. 12 Lecturer: Dr. Emad Nabil 1-1.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
Software Development Introduction
Parrot in a nutshell1 Parrot in a Nutshell Dan Sugalski
DBS201: Data Modeling. Agenda Data Modeling Types of Models Entity Relationship Model.
CSCE 240 – Intro to Software Engineering Lecture 3.
HIGH-LEVEL LANGUAGE PROGRAMMING PARADIGMS. Programming languages come in many forms or 'paradigms'. Each form of language offers advantages over other.
CSE 413 Programming Languages & Implementation Hal Perkins Autumn 2012 Multiple Inheritance, Interfaces, Mixins 1.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
The heavyweight parts of lightweight languages LL1 Workshop November 17, 2001.
The Object-Oriented Thought Process Chapter 03
Topic: Java Class Loader
.NET Security and MSIL Tom Roeder CS fa.
The heavyweight parts of lightweight languages
Types of Programming Languages
File Systems and Databases
CSE341: Programming Languages Lecture 23 Multiple Inheritance, Mixins, Interfaces, Abstract Methods Dan Grossman Spring 2016.
More Object-Oriented Programming
CSE341: Programming Languages Lecture 23 Multiple Inheritance, Mixins, Interfaces, Abstract Methods Dan Grossman Spring 2017.
More About Inheritance & Interfaces
Variable Length Data and Records
Subject : T0152 – Programming Language Concept
Inheritance and Polymorphism
Introduction to Virtual Machines
Parrot in the Real World
Introduction to Virtual Machines
CS703 - Advanced Operating Systems
Type Systems Terms to learn about types: Related concepts: Type
Lecture 10 Concepts of Programming Languages
CSc 453 Interpreters & Interpretation
CSE341: Programming Languages Lecture 23 Multiple Inheritance, Mixins, Interfaces, Abstract Methods Dan Grossman Spring 2019.
Presentation transcript:

Design of the Parrot Virtual Machine The OO-ish bits Dan Sugalski dan@sidhe.org

Important notes The OO parts of the design aren’t complete This is not a pure OO system I am not an OO guy We care about speed We don’t care about theoretical purity July 22, 2019 Design of the Parrot VM

Quick parrot design recap Register based Bytecode driven Mostly language neutral July 22, 2019 Design of the Parrot VM

Multiple language support Perl 6 Perl 5 Ruby Python JVM .NET Z-Machine July 22, 2019 Design of the Parrot VM

Challenges of the design Several conflicting object systems Runtime instantiation of much of the system Dynamic redefinition of classes, methods, and types of objects Dynamic redefinition of inheritance hierarchies Object system differences must be invisible to user code July 22, 2019 Design of the Parrot VM

Programmer view of objects Programmer shouldn’t care about the source of an object Programmer shouldn’t have to make any allowances for the source of an object when calling its methods It all ought to just work July 22, 2019 Design of the Parrot VM

Required end-user functionality Check for Class parentage Method existence Call method Get property Set property July 22, 2019 Design of the Parrot VM

Implementation of objects Objects are an opaque and fundamental variable type All variables have a core set of vtable functions Call method and the other minimal functionality is shared across all variables Since it all looks the same at this level, usage is consistent regardless of object type July 22, 2019 Design of the Parrot VM

Usage example my $foo; $foo = Some::Class.new(); $foo.a_method(12, 15); July 22, 2019 Design of the Parrot VM

Advantages of this scheme Programs are isolated from the implementation details Doesn’t place many real restrictions on the implementation of objects Offers class authors plenty of flexibility July 22, 2019 Design of the Parrot VM

Disadvantages of this scheme Programs are isolated from the implementation details Doesn’t place many real restrictions on the implementation of objects Offers class authors plenty of flexibility July 22, 2019 Design of the Parrot VM

Parrot’s object model requirements Support at least two wildly different implementation models Be more efficient than perl 5’s object system July 22, 2019 Design of the Parrot VM

Required functionality Untyped variables Runtime class changes on objects Runtime class mutation Runtime inheritance hierarchy changes Multiple inheritance Signature-based dispatch Cross-class-scheme inheritance July 22, 2019 Design of the Parrot VM

Requirements for classes More stringent Need: List of methods in class List of immediate parent classes Parent class method search list Duplication capabilities Parent class method search scheme Redispatch scheme Attribute count Duplication capabilities mean whether the class can be really in the class hierarchy twice, or if multiple occurrences are thrown away so only one is in there July 22, 2019 Design of the Parrot VM

Easy Answer Do all inheritance with delegation At least conceptually Does allow for inheritance from disparate object systems Performance is potentially an issue Shortcuts are definitely in order July 22, 2019 Design of the Parrot VM

Calling convention provides Real self Current self Class offset Attribute start offset July 22, 2019 Design of the Parrot VM