Vous êtes sur la page 1sur 18

YOW!

2013

Dates
Melbourne: December 5-6
Brisbane: December 9-10
Sydney: December 12-13

Early bird tickets on sale early June!


Dont forget YOW! 2012
presentations, videos, interviews
and podcasts all available online

YOW! 2013 Ini-al Speakers

Confirmed Keynotes

Jeff Hawkins

Co-Founder of Palm, author of On Intelligence,


artificial intelligence & the brain

YOW! 2013 Ini-al Speakers

Confirmed Keynotes

Scott Hanselman

Microsoft Principal Project Manager, author of


numerous ASP .NET books, host of Hanselminutes and
other podcasts

YOW! 2013 Ini-al Speakers

Confirmed Keynotes

Philip Wadler

Computer Scientist known for his contributions to


programming languages and type theory

YOW! 2013 Ini-al Speakers


Kevlin Henney

Phillipe Kruchten

Doug Crockford

Jim Webber

Developer Best Practices

Architecture, creator 4+1 model

JavaScript guru, inventor of JSON

NoSQL, Neo4J, REST

Daniel Spiewak

Michael Nygard

Scala fanatic, functional devotee

DevOps, author of Release It

Scott Murray

Steve Vinoski

D3.js

Erlang, IEEE Internet Computing

Mike Dixon

Trish Gee

Big Data, google.gov

MongoDB, Java high performance

Jesper Richter-Reichhelm

Eric Evans

Elizabeth Keogh

Charles Nutter

Scalability of game servers at Wooga

Domain Driven Design

Agile expert, human psychology

Jruby

Aaron Bedra

Hadi Harri

Application Security at Braintree

JetBrains, Kotlin

Ben Christensen
RxJava, Netflix

JVM Demys*ed A Tour of the


LVM Engine Room
Thomas
Dave
www.davethomas.net
Bedarra Research Labs YOW! Conferences
Carleton University Queensland University of Technology

2013 Bedarra Research Labs. All rights reserved.

Outline
Hardware Machines
Virtual Machines
Essence of a Language Virtual Machine
700+ languages in 7 minutes
LVM Engineering Design Choices
LVM Speed and Space
Musings on Next Genera*on VMs
Discussion

2013 Bedarra Research Labs. All rights reserved.

Real Machines

2013 Bedarra Research Labs. All rights reserved.

Modern Hardware (Intel Sandy Bridge EP*)


C1
L1
L2

...
...
...

Cn

Registers/Buffers
<1ns

C1

L1

~4 cycles ~1ns

L1

L2

~12 cycles ~3ns

L2

~40 cycles ~15ns

L3
PCI-e 3

MC

QPI ~40ns

DRAM
40X
IO

DRAM
DRAM
DRAM

* Assumption: 3GHz Processor

Cn
L1
L2

L3

~60 cycles ~20ns


(dirty hit)

QPI

...
...
...

QPI

MC

PCI-e 3

DRAM
~65ns

DRAM
DRAM

40X
IO

DRAM
(c) Martin Thompson 2012 - 2013

Real Hardware a Moving Target

2013 Bedarra Research Labs. All rights reserved.

Real HW Virtual Machines (Virtualiza*on)


SoZware which seeks to eciently emulate a specic real machine
VM360, VMWare, XEN, VirtualBox , Azure, Parallels
Simplify deployment; isolate users; share resources

2013 Bedarra Research Labs. All rights reserved.

Real Language Machines


Hardware which seeks to directly support a high level language features -
Tags, Write Barriers, Contexts ..
ALGOL Burroughs 6700, APL IBM 5100, Lisp Symbolics, XPARC Dorado,
PICK, Prolog, ADA Intel 432, Smalltalk SOAR, Java Azul;

2013 Bedarra Research Labs. All rights reserved.

Virtual HW Machines
SoZware which seeks to eciently emulate an ideal abstract HW
machine on dierent real HW plajorms
IBM AS/400, Calusa B-RISC, Google Portable Na*ve Run*me

2013 Bedarra Research Labs. All rights reserved.

Language Virtual Machines (LVM)


SoZware which seeks to eciently implement a programming
language by emula*ng a language specic machine representa*on
such as byte codes
Pascal P-Code, SECD, LVMs for Smalltalk, Java, CLR, Perl, R, MalLab,
Erlang, PHP, Python, Ruby, JavaScript, Dart
Hardware Machines

Language Virtual Machines

Instruc*on Set

Abstract instruc*on set (AST,


byte Codes)

Stack + Memory

Registers and Memory

Fetch Decode Execute

Read Eval Print Loop (REPL)

Storage Manager (GC)


2013 Bedarra Research Labs. All rights reserved.

Why have LVMS? Just Compile It!

Compilers and Interpreters Easy


Security
Execu*on Time Op*miza*on


2013 Bedarra Research Labs. All rights reserved.

2013 Bedarra Research Labs. All rights reserved.

400+ Languages in 4 minutes

2013 Bedarra Research Labs. All rights reserved.

400+ Languages in 4 minutes


The READ EVAL PRINT LOOP aka REPL
Meta circular Interpreters and the meaning of Life

The Contour Model of Block Structure Processes

2013 Bedarra Research Labs. All rights reserved.

400+ Languages in 4 minutes


The READ EVAL PRINT LOOP aka REPL
What are the key execu*on *me dierences between these
languages?

2013 Bedarra Research Labs. All rights reserved.

VM Engineering Design Space







2013 Bedarra Research Labs. All rights reserved.

10

VM Instruc*on Sets








2013 Bedarra Research Labs. All rights reserved.

Essen*al or Exo*c?

2013 Bedarra Research Labs. All rights reserved.

11

Boxing and Tags


Boxed Languages
Na*ve machine types
No fully polymorphic collec*ons without boxing
Tagged Languages
Fully Polymorphic collec*ons
Tag bits take space and need checking (SOAR => Sparc)

2013 Bedarra Research Labs. All rights reserved.


VM Implementa*on
Interpreter, Compiler, Mixed, Mul*ple
Low Level Language C/C++ , C
Implement the LVM in a subset of the LVM language (self hos*ng)

Use an exis*ng implementa*on of language or a similar one


Use a your new language and manually translate implementa*on to low
level
Implement the reec*ve tower e.g. 3-Lisp

Base Types - implemented inside the LVM e.g. Integer, Object


How easy should it be for others?
Opera*ons, New types (CLR Value Types), New representa*ons
Access to HW

Core Libraries

Inside LVM or Open in Language?

2003 Bedarra Research Labs. All rights reserved.

12

Implementa*on - Core Libraries


Implement in the language or in the LVM?
Library in Language

Implement in LVM


2013 Bedarra Research Labs. All rights reserved.

Method/Func*on Dispatch

Tables, Dynamic Lookup/ Dynamic Transla*on


Polymorphic Inline Cache (PIC)
Run*me Type Feedback (Self-> Strongtalk-> Hotspot)
Prole Guided Inlining (also called tracing JIT)
Whole Program Compila*on Smart Eiel, Ahead-Of-Time (AOT) JIT IBM,
Excelsior Jet

2013 Bedarra Research Labs. All rights reserved.


13

Garbage Collec*on

2013 Bedarra Research Labs. All rights reserved.

Concurrency Model
Actors versus Data Parallel
Immutable Data Structures
Low level Threads and Locks (semaphores)
Na*ve OS Threads
versus Green Threads



2013 Bedarra Research Labs. All rights reserved.

14

Applica*on Performance versus Benchmark Lies


Very Few Know Where the Time and Space Really Goes!
Micro benchmarks such as SPEC, Sun Spider, Octane
Measure specic language features
Seldom a predictor for applica*on performance
1000000 timesRepeat[12 fibonacci]
Applica*on Performance
Dominated by macro behavior of applica*on
Time spent in OS or DB
Time spent in Framework/Library
Applica*on or Framework races GC
Applica*on or Framework thrashes cache

2013 Bedarra Research Labs. All rights reserved.

Your Mileage will Vary!


Client Centric Applica*on

Ample but limited memory 4 8G

Ample but limited CPU

Server Centric Applica*on

Signicant GUI overhead

Space per instance

Startup time per instance

Persistent Object/Record Serialization


and Materialization
Ample memory 64-1TB + cpu 32 128 cores

Embedded or Pervasive

Power Constrained and Instant On

Memory Constrained

Code in Flash

Trusted

Na*ve Code Interoperability

Real-*me GC

2013 Bedarra Research Labs. All rights reserved.

15

Java JVM Challenges Today


Java Developers s*ll face big challenges

Cloud - virtualiza*on, footprint/density, run*me dynamism
Big*.* - data, threads, memory, scale out, scale up
Security - cri*cal to connected soZware and hard to get right
Compa*bility need to innovate and protect exis*ng investment in
code and tools
Plus ... mobile , polyglot , development eciency, simplicity

John Duwimovich CTO IBM Java VMs We can do beler

2013 Bedarra Research Labs. All rights reserved.

Musings on Next Genera*on VMs


Challenges with JVM and CLR

Stacks easy for compiler, hard for JIT


Security dicult at best and limits access to some na*ve HW
features
Dicult to exploit major changes in HW e.g. memory models,
massive concurrency
LVM are always L Biased to the LVM family of languages
E.g. strong types, no tags, no call cc

Is it possible to have a UVM which lets interesOng languages


bloom and prosper to avoid bloaOng My Language PL/I, Ada,
Java 7+, C++ 11 ?

2013 Bedarra Research Labs. All rights reserved.

16

Further Reading
Structure and Interpreta*on of Computer Programs, Abelson and Sussman
The Lambda Papers, Guy Steele, MIT Technical Reports
Understanding Java Garbage Collec*on, Gil Tene
JVM JIT for Dummies, Charles Nuler
We Can Do Beler, IBMs Vision for Next Genera*on Java VMs, EclipseCon
Europe
Smalltalk-80: The Language and its Implementa*on, Goldberg, A., Robson.
I, Addison-Wesley, 1983.
Op*mizing Dynamically-Dispatched with Run-Time Type Feedback,
Urs Holzle
V8 A High Performance Open Source JavaScript Engine, Kasper Lund
Trace-based Just-in-Time Type Specializa*on for Dynamic Languages,
Andreas Gal et al

2013 Bedarra Research Labs. All rights reserved.

Musings on Next Genera*on VMs

Back to the Future? Virtual Instruc*on Set Computers (VISC)






AS/400, DAISY, B-RISC, Transmeta, LLDA, AMD HAS, Google
PNaCl
Supports many language using so7ware fault isola-on
Innite register machine
Single assignment 3 address instruc*ons
Op*onal data ow and control ow informa*on

2013 Bedarra Research Labs. All rights reserved.

17

Musings on Next Genera*on VMs


JIT Virtual Machine to Real Machine
LLVM low level infrastructure popular plajorm
Google PNaCl Pinnacle claim 7% overhead on Intel and 5% on
ARM for C/C++
AMD Heterogeneous System Architecture (HAS) VSIC for CPU+
GPU

2013 Bedarra Research Labs. All rights reserved.

Thanks! Please give them the applause

2013 Bedarra Research Labs. All rights reserved.

18

Vous aimerez peut-être aussi