Pony A Brief Programming Language Overview! October 2017 - - PowerPoint PPT Presentation

pony
SMART_READER_LITE
LIVE PREVIEW

Pony A Brief Programming Language Overview! October 2017 - - PowerPoint PPT Presentation

Pony A Brief Programming Language Overview! October 2017 Disclaimer! I am a fan of some of the ideas in Pony! I am not a Pony programmer Pony contributor etc Disclaimer! Most of the content of these slides is from Deny


slide-1
SLIDE 1

Pony

A Brief Programming Language Overview! October 2017

slide-2
SLIDE 2

Disclaimer! I am a fan of some of the ideas in Pony! I am not a

  • Pony programmer
  • Pony contributor
  • etc
slide-3
SLIDE 3

Disclaimer! Most of the content of these slides is from

  • Deny Capabilities for Fast, Safe Actors

(by Clebsch, Drossopoulou, Blessing, and McNeil)

  • A blog post by Adrian Colyer on that paper

(https://blog.acolyer.org/2016/02/17/deny-capabilities/) Check those out for more info!

slide-4
SLIDE 4

Pony is an open-source, object-oriented, actor-model, capabilities- secure, high-performance programming language

slide-5
SLIDE 5

Pony describes itself as

  • Type safe
  • Memory safe
  • Exception safe
  • Data-race free
  • Deadlock free
  • Native code compiled
  • Compatible with C
slide-6
SLIDE 6

Other bullets about Pony (from a podcast in July):

  • Pony has no locks!
  • Scales from a Raspberry Pi through a 64 core half terabyte machine to

a 4096 core SGI beast

  • Actors have 256-byte overhead, so creating hundreds of thousands of

actors is possible

  • Actors GC their own heaps – no global stop-the-world pauses
  • Because the type system is data-race free, it’s impossible to have

[many common] concurrency problems in Pony

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9

class def

field constructor methods

slide-10
SLIDE 10

actor def

field constructor methods behaviors

slide-11
SLIDE 11

reference of type ‘S’ with capability ‘k’ a possibly “unaliased” type Reference capabilities (i.e. deny properties)

slide-12
SLIDE 12
slide-13
SLIDE 13

Image and descriptions borrowed from https://blog.acolyer.org/2016/02/17/deny-capabilities/

slide-14
SLIDE 14

iso: Isolated references form static regions: mutable references reachable via the iso reference can only be reached via the iso reference, and immutable references reachable via the iso reference are either globally immutable

  • r only reachable via the iso reference.

Image and descriptions borrowed from https://blog.acolyer.org/2016/02/17/deny-capabilities/

slide-15
SLIDE 15

trn: allows an object to be written to

  • nly via the trn reference, but read from

via other aliases held by the same actor. This allows the object to be mutable while still allowing it to transition to an immutable reference capability in the future, in order to share it with another actor.

Image and descriptions borrowed from https://blog.acolyer.org/2016/02/17/deny-capabilities/

slide-16
SLIDE 16

Image and descriptions borrowed from https://blog.acolyer.org/2016/02/17/deny-capabilities/

ref: a ref variable can be used to read and write the object within an actor, and

  • ther variables within the same actor

can also be used to read and write the

  • bject, but access (both read and write)

is denied to any other (global) actor.

slide-17
SLIDE 17

val: a val variable is a bit like const, it denotes a variable that is globally immutable – it denies write capabilities both locally and globally (and hence by implication, allows reading from anywhere).

Image and descriptions borrowed from https://blog.acolyer.org/2016/02/17/deny-capabilities/

slide-18
SLIDE 18

box: a box variable denies any other actors (global actors) the right to use a variable to write to the object. Other variables within the same actor may be used to write to the object, and other actors may be able to read it (but not both).

Image and descriptions borrowed from https://blog.acolyer.org/2016/02/17/deny-capabilities/

slide-19
SLIDE 19

tag: we can alias a tag (pass it as a parameter, assign it to other tag variables), and we can also invoke behaviors on it. (i.e. to send messages to another another actor, you only need a tag reference to it) Note! A tag reference is opaque, i.e. we can only invoke behaviors or compare for identity equality.

Image and descriptions borrowed from https://blog.acolyer.org/2016/02/17/deny-capabilities/

slide-20
SLIDE 20

Recall -- Pony is

  • Data-race free
  • Deadlock free (i.e. no locks in runtime)
  • GC’d with no global stop-the-world pauses

(since actors GC their own heaps)

Made possible by reference capabilities

slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25

Mutable, Doubly Linked List

slide-26
SLIDE 26

Persistent list (our old friend)

slide-27
SLIDE 27

Persistent list (our old friend)

slide-28
SLIDE 28

Persistent list (our old friend)

slide-29
SLIDE 29
slide-30
SLIDE 30

Pony today?

  • Version 0.20.0 (breaking changes occur occasionally)
  • One of the Pony team members is VP of Engineering at Wallaroo Labs,

where they use Pony daily.

  • Under active development (e.g. generalized runtime backpressure is a

feature currently being worked on)

slide-31
SLIDE 31

To learn more: https://www.ponylang.org