pony - github pageswonks.github.io/slides/kent-october-20-2017.pdfother bullets about pony (from a...

31
Pony A Brief Programming Language Overview! October 2017

Upload: others

Post on 04-Jan-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

PonyABriefProgrammingLanguageOverview!

October2017

Disclaimer!

IamafanofsomeoftheideasinPony!

Iamnota• Ponyprogrammer• Ponycontributor• etc

Disclaimer!

Mostofthecontentoftheseslidesisfrom

• DenyCapabilitiesforFast,SafeActors(byClebsch,Drossopoulou,Blessing,andMcNeil)

• AblogpostbyAdrianColyer onthatpaper(https://blog.acolyer.org/2016/02/17/deny-capabilities/)

Checkthoseoutformoreinfo!

Ponyisanopen-source,object-oriented,actor-model,capabilities-secure,high-performanceprogramminglanguage

Ponydescribesitselfas

• Typesafe• Memorysafe• Exceptionsafe• Data-racefree• Deadlockfree• Nativecodecompiled• CompatiblewithC

OtherbulletsaboutPony(fromapodcastinJuly):

• Ponyhasnolocks!• ScalesfromaRaspberryPithrougha64corehalfterabytemachinetoa4096coreSGIbeast• Actorshave256-byteoverhead,socreatinghundredsofthousandsofactorsispossible• ActorsGCtheirownheaps– noglobalstop-the-worldpauses• Becausethetypesystemisdata-racefree,it’simpossibletohave[manycommon]concurrencyproblemsinPony

classdef

field

constructor

methods

actordef

field

constructor

methods

behaviors

referenceoftype‘S’withcapability‘k’

apossibly“unaliased”type

Referencecapabilities(i.e.denyproperties)

Imageanddescriptionsborrowedfromhttps://blog.acolyer.org/2016/02/17/deny-capabilities/

iso:Isolatedreferencesformstaticregions:mutablereferencesreachableviatheiso referencecanonlybereachedviatheiso reference,andimmutablereferencesreachableviatheisoreferenceareeithergloballyimmutableoronlyreachableviatheiso reference.

Imageanddescriptionsborrowedfromhttps://blog.acolyer.org/2016/02/17/deny-capabilities/

trn:allowsanobjecttobewrittentoonlyviathetrn reference,butreadfromviaotheraliasesheldbythesameactor.Thisallowstheobjecttobemutablewhilestillallowingittotransitiontoanimmutablereferencecapabilityinthefuture,inordertoshareitwithanotheractor.

Imageanddescriptionsborrowedfromhttps://blog.acolyer.org/2016/02/17/deny-capabilities/

Imageanddescriptionsborrowedfromhttps://blog.acolyer.org/2016/02/17/deny-capabilities/

ref:arefvariablecanbeusedtoreadandwritetheobjectwithinanactor,andothervariableswithinthesameactorcanalsobeusedtoreadandwritetheobject,butaccess(bothreadandwrite)isdeniedtoanyother(global)actor.

val:aval variableisabitlikeconst,itdenotesavariablethatisgloballyimmutable– itdenieswritecapabilitiesbothlocallyandglobally(andhencebyimplication,allowsreadingfromanywhere).

Imageanddescriptionsborrowedfromhttps://blog.acolyer.org/2016/02/17/deny-capabilities/

box:aboxvariabledeniesanyotheractors(globalactors)therighttouseavariabletowritetotheobject.Othervariableswithinthesameactormaybeusedtowritetotheobject,andotheractorsmaybeabletoreadit(butnotboth).

Imageanddescriptionsborrowedfromhttps://blog.acolyer.org/2016/02/17/deny-capabilities/

tag:wecanaliasatag(passitasaparameter,assignittoothertagvariables),andwecanalsoinvokebehaviorsonit.

(i.e.tosendmessagestoanotheranotheractor,youonlyneedatagreferencetoit)

Note!Atagreferenceisopaque,i.e.wecanonlyinvokebehaviorsorcompareforidentityequality.

Imageanddescriptionsborrowedfromhttps://blog.acolyer.org/2016/02/17/deny-capabilities/

Recall-- Ponyis

• Data-racefree• Deadlockfree(i.e.nolocksinruntime)• GC’d withnoglobalstop-the-worldpauses(sinceactorsGCtheirownheaps)

Madepossiblebyreferencecapabilities

Mutable,DoublyLinkedList

Persistentlist(ouroldfriend)

Persistentlist(ouroldfriend)

Persistentlist(ouroldfriend)

Ponytoday?

• Version0.20.0(breakingchangesoccuroccasionally)• OneofthePonyteammembersisVPofEngineeringatWallaroo Labs,wheretheyusePonydaily.• Underactivedevelopment(e.g.generalizedruntime backpressureisafeaturecurrentlybeingworkedon)

Tolearnmore: https://www.ponylang.org