The document discusses the programming language Pony. It notes that Pony uses actors and reference capabilities to allow the compiler to guarantee that a program is data-race-free. It provides an example of pseudo-code in another language that demonstrates a data race issue when incrementing a shared variable from multiple threads simultaneously. The value printed at the end is inconsistent due to threads overwriting each other's work.
Software Craftsmanship NYC Meetup: The Pony Programming Languageaturley_slides
This is the slideshow from the Pony talk I gave on October 27th at the Software Craftsmanship Meetup in NYC. It gives a basic overview of the Pony programming language and discusses the actor model and reference capabilities in detail, explaining how they are used to provide a compile-time guarantee that programs are data-race free.
The document describes the Pony programming language. Some key points:
- Pony is an open-source, object-oriented, actor-model language that allows the compiler to guarantee programs are data-race-free through the use of actors and reference capabilities.
- It supports classes, interfaces, traits but with nominal subtyping. Interfaces use structural subtyping.
- The document provides an example Pony program that calculates the areas of circles and squares to demonstrate traits, classes, interfaces, and the actor model.
This document provides an introduction to the C programming language in Chinese. It discusses downloading and installing Cygwin on Windows to get a development environment for C. It then covers basic C syntax like printf(), variables, conditions, loops, functions, pointers, arrays, and strings. Examples are provided like a program to evaluate poker card values using switches and if/else statements. The document emphasizes learning C through practical examples and exercises.
This is a talk I gave at Papers We Love NYC on April 12, 2017. The talk is based on some papers about this history of COBOL and how it relates to computer science.
The JVM, or Java Virtual Machine, is a software implementation that executes Java bytecode. It acts as an abstraction layer between Java applications and the underlying operating system. The JVM loads Java class files and interprets and executes the bytecode instructions they contain.
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Software Craftsmanship NYC Meetup: The Pony Programming Languageaturley_slides
This is the slideshow from the Pony talk I gave on October 27th at the Software Craftsmanship Meetup in NYC. It gives a basic overview of the Pony programming language and discusses the actor model and reference capabilities in detail, explaining how they are used to provide a compile-time guarantee that programs are data-race free.
The document describes the Pony programming language. Some key points:
- Pony is an open-source, object-oriented, actor-model language that allows the compiler to guarantee programs are data-race-free through the use of actors and reference capabilities.
- It supports classes, interfaces, traits but with nominal subtyping. Interfaces use structural subtyping.
- The document provides an example Pony program that calculates the areas of circles and squares to demonstrate traits, classes, interfaces, and the actor model.
This document provides an introduction to the C programming language in Chinese. It discusses downloading and installing Cygwin on Windows to get a development environment for C. It then covers basic C syntax like printf(), variables, conditions, loops, functions, pointers, arrays, and strings. Examples are provided like a program to evaluate poker card values using switches and if/else statements. The document emphasizes learning C through practical examples and exercises.
This is a talk I gave at Papers We Love NYC on April 12, 2017. The talk is based on some papers about this history of COBOL and how it relates to computer science.
The JVM, or Java Virtual Machine, is a software implementation that executes Java bytecode. It acts as an abstraction layer between Java applications and the underlying operating system. The JVM loads Java class files and interprets and executes the bytecode instructions they contain.
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Drona Infotech is a premier mobile app development company in Noida, providing cutting-edge solutions for businesses.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
What to do when you have a perfect model for your software but you are constrained by an imperfect business model?
This talk explores the challenges of bringing modelling rigour to the business and strategy levels, and talking to your non-technical counterparts in the process.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Malibou Pitch Deck For Its €3M Seed Roundsjcobrien
French start-up Malibou raised a €3 million Seed Round to develop its payroll and human resources
management platform for VSEs and SMEs. The financing round was led by investors Breega, Y Combinator, and FCVC.
Unveiling the Advantages of Agile Software Development.pdfbrainerhub1
Learn about Agile Software Development's advantages. Simplify your workflow to spur quicker innovation. Jump right in! We have also discussed the advantages.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Drona Infotech is a premier mobile app development company in Noida, providing cutting-edge solutions for businesses.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
Creative operations teams expect increased AI use in 2024. Currently, over half of tasks are not AI-enabled, but this is expected to decrease in the coming year. ChatGPT is the most popular AI tool currently. Business leaders are more actively exploring AI benefits than individual contributors. Most respondents do not believe AI will impact workforce size in 2024. However, some inhibitions still exist around AI accuracy and lack of understanding. Creatives primarily want to use AI to save time on mundane tasks and boost productivity.
Organizational culture includes values, norms, systems, symbols, language, assumptions, beliefs, and habits that influence employee behaviors and how people interpret those behaviors. It is important because culture can help or hinder a company's success. Some key aspects of Netflix's culture that help it achieve results include hiring smartly so every position has stars, focusing on attitude over just aptitude, and having a strict policy against peacocks, whiners, and jerks.
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
PepsiCo provided a safe harbor statement noting that any forward-looking statements are based on currently available information and are subject to risks and uncertainties. It also provided information on non-GAAP measures and directing readers to its website for disclosure and reconciliation. The document then discussed PepsiCo's business overview, including that it is a global beverage and convenient food company with iconic brands, $91 billion in net revenue in 2023, and nearly $14 billion in core operating profit. It operates through a divisional structure with a focus on local consumers.
Content Methodology: A Best Practices Report (Webinar)contently
This document provides an overview of content methodology best practices. It defines content methodology as establishing objectives, KPIs, and a culture of continuous learning and iteration. An effective methodology focuses on connecting with audiences, creating optimal content, and optimizing processes. It also discusses why a methodology is needed due to the competitive landscape, proliferation of channels, and opportunities for improvement. Components of an effective methodology include defining objectives and KPIs, audience analysis, identifying opportunities, and evaluating resources. The document concludes with recommendations around creating a content plan, testing and optimizing content over 90 days.
How to Prepare For a Successful Job Search for 2024Albert Qian
The document provides guidance on preparing a job search for 2024. It discusses the state of the job market, focusing on growth in AI and healthcare but also continued layoffs. It recommends figuring out what you want to do by researching interests and skills, then conducting informational interviews. The job search should involve building a personal brand on LinkedIn, actively applying to jobs, tailoring resumes and interviews, maintaining job hunting as a habit, and continuing self-improvement. Once hired, the document advises setting new goals and keeping skills and networking active in case of future opportunities.
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
The document provides career advice for getting into the tech field, including:
- Doing projects and internships in college to build a portfolio.
- Learning about different roles and technologies through industry research.
- Contributing to open source projects to build experience and network.
- Developing a personal brand through a website and social media presence.
- Networking through events, communities, and finding a mentor.
- Practicing interviews through mock interviews and whiteboarding coding questions.
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
1. Core updates from Google periodically change how its algorithms assess and rank websites and pages. This can impact rankings through shifts in user intent, site quality issues being caught up to, world events influencing queries, and overhauls to search like the E-A-T framework.
2. There are many possible user intents beyond just transactional, navigational and informational. Identifying intent shifts is important during core updates. Sites may need to optimize for new intents through different content types and sections.
3. Responding effectively to core updates requires analyzing "before and after" data to understand changes, identifying new intents or page types, and ensuring content matches appropriate intents across video, images, knowledge graphs and more.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
During this webinar, Anand Bagmar demonstrates how AI tools such as ChatGPT can be applied to various stages of the software development life cycle (SDLC) using an eCommerce application case study. Find the on-demand recording and more info at https://applitools.info/b59
Key takeaways:
• Learn how to use ChatGPT to add AI power to your testing and test automation
• Understand the limitations of the technology and where human expertise is crucial
• Gain insight into different AI-based tools
• Adopt AI-based tools to stay relevant and optimize work for developers and testers
* ChatGPT and OpenAI belong to OpenAI, L.L.C.
4. What Is Pony?
“Pony is an open-source, object-oriented, actor-model, capabilities-secure, high
performance programming language.” -- ponylang.org
5. What Is Pony?
“Pony is an open-source, object-oriented, actor-model, capabilities-secure, high
performance programming language.” -- ponylang.org
BSD license
Copyright (c) 2014-2015, Causality Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
6. What Is Pony?
“Pony is an open-source, object-oriented, actor-model, capabilities-secure, high
performance programming language.” -- ponylang.org
Classes, Interfaces, Traits
(but they may work a little differently than you expect)
7. What Is Pony?
“Pony is an open-source, object-oriented, actor-model, capabilities-secure, high
performance programming language.” -- ponylang.org
Actors communicate by
passing messages to other
actors
8. What Is Pony?
“Pony is an open-source, object-oriented, actor-model, capabilities-secure, high
performance programming language.” -- ponylang.org
The compiler enforces what
you can and cannot do with
an object
9. What Is Pony?
“Pony is an open-source, object-oriented, actor-model, capabilities-secure, high
performance programming language.” -- ponylang.org
Uses LLVM to compile to
native code
10. What Is Pony?
“Pony is an open-source, object-oriented, actor-model, capabilities-secure, high
performance programming language.” -- ponylang.org
Also:
● powerful type system (unions, intersections,
parameterized types and functions)
● fast actor-based garbage collection system
14. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
15. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
16. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
traits: nominal
subtyping
17. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
18. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
interfaces:
structural
subtyping
19. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
20. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
21. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
primitive: object
with no data and
only one
instance
22. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
23. more-interesting.pony
trait Shape
fun area(): F64
interface Named
fun name(): String
class Circle is Shape
let _radius: F64
new create(radius: F64) =>
_radius = radius
fun name(): String => "circle"
fun area(): F64 =>
3.14159 * _radius * _radius
class Square is Shape
let _side: F64
new create(side: F64) =>
_side = side
fun name(): String => "square"
fun area(): F64 =>
_side * _side
primitive AreaReporter
fun report(shape: (Shape & Named)): String =>
"The area of this " + shape.name() +
" is " + shape.area().string()
actor Main
new create(env: Env) =>
let s: F64 = 15.3
var area = AreaReporter.report(Circle(s))
env.out.print(area)
area = AreaReporter.report(Square(s))
env.out.print(area)
> ./ponyc src/more-interesting
> ./more-interesting
The area of this circle is 735.415
The area of this square is 234.09
>
25. Pony: The Really Interesting Parts
Pony uses actors and reference capabilities to allow the compiler to guarantee
that a program is data-race-free.
26. Pony: The Really Interesting Parts
Pony uses actors and reference capabilities to allow the compiler to guarantee
that a program is data-race-free.
27. Pony: The Really Interesting Parts
Pony uses actors and reference capabilities to allow the compiler to guarantee
that a program is data-race-free.
28. Pony: The Really Interesting Parts
Pony uses actors and reference capabilities to allow the compiler to guarantee
that a program is data-race-free.
29. Pony: The Really Interesting Parts
Pony uses actors and reference capabilities to allow the compiler to guarantee
that a program is data-race-free.
30. Pony: The Really Interesting Parts
Pony uses actors and reference capabilities to allow the compiler to guarantee
that a program is data-race-free.
31. Pony: The Really Interesting Parts
Pony uses actors and reference capabilities to allow the compiler to guarantee
that a program is
data-race-free.
32. Pony: The Really Interesting Parts
data-race-free
(this is the part you should remember)
34. Off To The Data Races!
Some pseudo code (not Pony) …
global int a = 0
function inc() {
for x in range(0, 1000001) {
a = a + 1
}
}
function main() {
inc()
print(“a = “ + a)
}
1000000
35. Off To The Data Races!
Some more pseudo code (not Pony) …
global int a = 0
function inc() {
for x in range(0, 1000001) {
a = a + 1
}
}
function main() {
thread thread1 = Thread(inc)
thread thread2 = Thread(inc)
thread1.run()
thread2.run()
thread1.join()
thread2.join()
print(“a = “ + a)
}
● Run “inc()” simultaneously in two
places
● wait for both runs to finish
● print the value of “a”
36. Off To The Data Races!
Some more pseudo code (not Pony) …
global int a = 0
function inc() {
for x in range(0, 1000001) {
a = a + 1
}
}
function main() {
thread thread1 = Thread(inc)
thread thread2 = Thread(inc)
thread1.run()
thread2.run()
thread1.join()
thread2.join()
print(“a = “ + a)
}
Expected (two threads each
incrementing a variable
1000000 times):
2000000
37. Off To The Data Races!
Some more pseudo code (not Pony) …
global int a = 0
function inc() {
for x in range(0, 1000001) {
a = a + 1
}
}
function main() {
thread thread1 = Thread(inc)
thread thread2 = Thread(inc)
thread1.run()
thread2.run()
thread1.join()
thread2.join()
print(“a = “ + a)
}
Expected:
2000000
Actual Run 1:
1987735
Actual Run 2:
1935010
Actual Run 3:
1941217
38. Off To The Data Races!
Some more pseudo code (not Pony) …
global int a = 0
function inc() {
for x in range(0, 1000001) {
a = a + 1
}
}
function main() {
thread thread1 = Thread(inc)
thread thread2 = Thread(inc)
thread1.run()
thread2.run()
thread1.join()
thread2.join()
print(“a = “ + a)
}
Expected:
2000000
Actual Run 1:
1987735
Actual Run 2:
1935010
Actual Run 3:
1941217
WHY?
39. Off To The Data Races!
In thread1 …
// get the value of “a”
// add 1 to that value
// write the new value back to “a”
a = a + 1
Meanwhile, in thread2...
// get the value of “a”
// add 1 to that value
// write the new value back to “a”
a = a + 1
a = 26
40. Off To The Data Races!
In thread1 …
// get the value of “a” 26
// add 1 to that value
// write the new value back to “a”
a = a + 1
Meanwhile, in thread2...
// get the value of “a” 26
// add 1 to that value
// write the new value back to “a”
a = a + 1
a = 26
41. Off To The Data Races!
In thread1 …
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a”
a = a + 1
Meanwhile, in thread2...
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a”
a = a + 1
a = 26
42. Off To The Data Races!
In thread1 …
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
Meanwhile, in thread2...
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
a = 27
43. Off To The Data Races!
In thread1 …
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
Meanwhile, in thread2...
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
a = 27
We wanted a = 28
44. Off To The Data Races!
In thread1 …
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
Meanwhile, in thread2...
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
a = 27
This may not happen every time, but each time it
happens it increases the error of the result.
We wanted a = 28
45. Off To The Data Races!
In thread1 …
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
Meanwhile, in thread2...
// get the value of “a” 26
// add 1 to that value 26 + 1 = 27
// write the new value back to “a” a = 27
a = a + 1
a = 27
This may not happen every time, but each time it
happens it increases the error of the result.
We wanted a = 28
“Shared mutable state is the root of all evil.”
-- several different people, all at the same time
46. Off To The Data Races!
Techniques various and sundry for avoiding data races ...
● Locks! → a unit of execution acquires a lock, no other unit of execution can
acquire the lock until it is released
○ C and C++
● Synchronized blocks/functions/methods! → somebody writes the locks for you
○ Java
● Everything is read-only! → don’t need to worry about writes anymore
○ Erlang
● There’s only one binding to an object at any time! → move, borrow, copy
○ Rust
48. Leaving The Data Races
Pony uses two rules to avoid data races:
● The Read Rule: If an actor can read an object then no other actor can modify
that object
● The Write Rule: If an actor can modify an object then no other actor can read
or modify it
61. Actors
a1.bar() a2.baz() a1.bar()
IDLE a1.baz() a3.doh()
a5.moo()
a8.fee() a7.foo()
a6.mee()
a7.fuz()
time
CPU1: thread1
CPU2: thread2
CPU3: thread3
CPU4: thread4
A idle thread
“steal” work from
another thread
Work for actor
a1 “stolen” by
thread2
62. Actors
a1.bar() a2.baz() a1.bar()
a1.buz() a4.doo() a3.doh()
a5.moo()
a8.fee() a7.foo()
a6.mee()
a7.fuz()
time
CPU1: thread1
CPU2: thread2
CPU3: thread3
CPU4: thread4
Actors process
one message at a
time (actors are
effectively
single-threaded)
64. Actors
a1 a3
a2
o1
Actors have references to objects and
other actors
References can be used to:
* read from an object
* write to an object
* send messages to another actor
65. Actors
a1 a3
a2
o1
Actors have references to objects and
other actors
References can be used to:
* read from an object
* write to an object
* send messages to another actor
Reference Capabilities control
whether reads and writes are
allowed via a given reference. Any
reference can be used to send a
message.
66. Actors
a1 a3
a2
o1
Actors have references to objects and
other actors
References can be used to:
* read from an object
* write to an object
* send messages to another actor
Reference Capabilities control whether
reads and writes are allowed via a
given reference. Any reference can be
used to send a message.
Note: send message ≠ read/write
68. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
69. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main
create(env)
run!
When the program starts, the
Main actor is instantiated and a
create message is sent to it.
70. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main
create(env)
The Main actor begins to process
the create message.
71. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
create(“howdy”)
create(env)
An instance of the Example actor
is instantiated and a create
message is sent to it with
“howdy” as the argument.
72. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
create(env)
o
create(“howdy)
create(env)
An instance of the the Other
actor is instantiated and a
create message is sent to it with
env as the argument.
73. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main
create(env)create(“howdy)
foo(o)
e
_text=”howdy”
o
_env=env
create(env)
The Main actor sends a foo
message to the Example actor.
The Example actor sets the value
of its _text field.
The Other actor sets the value of
its _env field
74. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
_text=”howdy”
o
_env=env
foo(o)1
foo(o)2
create(env)
The Main actor sends a foo
message to the Example actor.
The Example actor sets the value
of its _text field.
The Other actor sets the value of
its _env field
75. foo(o)1
Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
_text=”ydwoh”
o
_env=env
foo(o)2
The Example actor processes
the first foo message by first
calling its rev method, which
reverses the _text string.
76. foo(o)1
Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
_text=”ydwoh”
o
_env=env
foo(o)2 say(“ydwoh”)
The Example actor sends the
string to the Other actor in a say
message.
77. say(“ydwoh”)foo(o)2
Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
_text=”howdy”
o
_env=env
YDWOH
The Example actor processes
the second foo message, which
again reverses the _text string.
The Other actor processes the
say message by printing the
string that it received.
78. foo(o)2
Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
_text=”howdy”
o
_env=env
say(“howdy”)
YDWOH
The Example actor sends
another say message to the
Other actor.
79. say(“howdy”)
Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
_text=”howdy”
o
_env=env
YDWOH
HOWDY
The Other actor processes the
say message by printing the
string that it received.
80. Actors: An Example
actor Example
var _text: String
new create(text: String) =>
_text = text
be foo(o: Other) =>
o.say(rev())
fun ref rev(): String val =>
_text = recover
_text.reverse()
end
_text
actor Other
let _env: Env
new create(env: Env) =>
_env = env
be say(s: String) =>
_env.out.print(s)
actor Main
new create(env: Env) =>
let e = Example("howdy")
let o = Other(env)
e.foo(o) // prints “ydwoh”
e.foo(o) // prints “howdy”
Main e
_text=”howdy”
o
_env=env
YDWOH
HOWDY
All messages have been handled
so the program can exit.
82. Reference Capabilities
Remember the Read Rule and the Write Rule:
● The Read Rule: If an actor can read an object then no other actor can modify
that object
● The Write Rule: If an actor can modify an object then no other actor can read
or modify it
83. Reference Capabilities
Reference capabilities control whether a given alias can be used to read or modify
an object.
The collection of reference capabilities for aliases that refer to an object must be
consistent with the Read Rule and the Write Rule.
Any alias to an actor, regardless of reference capability, can be used to send
messages to that actor.
84. Reference Capabilities
There are six reference capabilities:
● iso - only one alias can be used to read or modify this object
● trn - only one alias can modify this object, but more than one alias can be
used to read it
● val - no alias can modify this object, but more than one alias can read from it
● ref - more than one alias can read from this object, and more than alias can
modify this object
● box - this alias can be used to read an object, there may more may not be
more than one other alias that can modify it
● tag - this alias cannot be used to read or modify this object (but it can be
used to send a message or do an identity comparison)
86. Reference Capabilities
Reference capabilities can appear in
● variable, parameter, and field declarations
○ let foo: Foo ref = Foo // foo’s reference capability is ref
● actor and class declarations
○ class val Foo // a “Foo” type means “Foo val” unless otherwise specified
87. Reference Capabilities
Reference capabilities can appear in
● variable, parameter, and field declarations
○ let foo: Foo ref = Foo // foo’s reference capability is ref
● actor and class declarations
○ class val Foo // a “Foo” type means “Foo val” unless otherwise specified
● constructor declarations
○ new val create() => // objects of this class will have a reference capability of val
88. Reference Capabilities
Reference capabilities can appear in
● variable, parameter, and field declarations
○ let foo: Foo ref = Foo // foo’s reference capability is ref
● actor and class declarations
○ class val Foo // a “Foo” type means “Foo val” unless otherwise specified
● constructor declarations
○ new val create() => // objects of this class will have a reference capability of val
● function declarations
○ fun ref bar() // bar()’s receiver must have a reference capability of ref
89. Reference Capabilities
Reference capabilities can appear in
● variable, parameter, and field declarations
○ let foo: Foo ref = Foo // foo’s reference capability is ref
● actor and class declarations
○ class val Foo // a “Foo” type means “Foo val” unless otherwise specified
● constructor declarations
○ new val create() => // objects of this class will have a reference capability of val
● function declarations
○ fun ref bar() // bar()’s receiver must have a reference capability of ref
● function return values
○ fun f(): String ref // the String will have a reference capability of ref
90. Reference Capabilities
Reference capabilities can appear in
● variable, parameter, and field declarations
○ let foo: Foo ref = Foo // foo’s reference capability is ref
● actor and class declarations
○ class val Foo // a “Foo” type means “Foo val” unless otherwise specified
● constructor declarations
○ new val create() => // objects of this class will have a reference capability of val
● function declarations
○ fun ref bar() // bar()’s receiver must have a reference capability of ref
● function return values
○ fun f(): String ref // the String will have a reference capability of ref
● recover blocks
○ recover iso … end // the reference capability of the returned object will be iso
91. Reference Capabilities
If no reference capability is specified, the default reference capability for the given
thing is used.
92. Reference Capabilities
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
93. Reference Capabilities
SPOT THE REFERENCE
CAPABILITIES!
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
94. Reference Capabilities
SPOT THE EXPLICIT REFERENCE
CAPABILITIES!
SPOT THE IMPLIED REFERENCE
CAPABILITIES!
class ref Foo
class val Bar
let v: U32 val
new val create(vv: U32 val) =>
v = vv
actor tag Main
new create(env: Env val) =>
let a: Foo iso = recover iso Foo end
var b: Bar val = Bar(1)
b = Bar(2)
baz(b)
fun box baz(c: Bar val): U32 val =>
c.v + 16
95. Reference Capabilities
Actors have a default reference
capability of tag, objects created
from classes have a default reference
capability of ref
class ref Foo
class val Bar
let v: U32 val
new val create(vv: U32 val) =>
v = vv
actor tag Main
new create(env: Env val) =>
let a: Foo iso = recover iso
Foo
end
var b: Bar val = Bar(1)
b = Bar(2)
baz(b)
fun box baz(c: Bar val): U32 val =>
c.v + 16
96. Reference Capabilities
You can change the implicit reference
capability of a class (normally it is
ref)
You can change the reference
capability of the object generated by
the constructor (normally it is ref)
class ref Foo
class val Bar
let v: U32 val
new val create(vv: U32 val) =>
v = vv
actor tag Main
new create(env: Env val) =>
let a: Foo iso = recover iso
Foo
end
var b: Bar val = Bar(1)
b = Bar(2)
baz(b)
fun box baz(c: Bar val): U32 val =>
c.v + 16
97. Reference Capabilities
You can specify the type of reference
capability that the receiver must have
to call a function
class ref Foo
class val Bar
let v: U32 val
new val create(vv: U32 val) =>
v = vv
actor tag Main
new create(env: Env val) =>
let a: Foo iso = recover iso
Foo
end
var b: Bar val = Bar(1)
b = Bar(2)
baz(b)
fun box baz(c: Bar val): U32 val =>
c.v + 16
98. Reference Capabilities
You can specify the type of reference
capability that the receiver must have
to call a function
This can get really tricky!
class ref Foo
class val Bar
let v: U32 val
new val create(vv: U32 val) =>
v = vv
actor tag Main
new create(env: Env val) =>
let a: Foo iso = recover iso
Foo
end
var b: Bar val = Bar(1)
b = Bar(2)
baz(b)
fun box baz(c: Bar val): U32 val =>
c.v + 16
99. Reference Capabilities
An alias is a name given to a particular object in
memory
Aliases are created when
● an object is assigned to a variable
● an object is passed as an argument to a
method
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
100. Reference Capabilities
An alias is a name given to a particular object in
memory
Aliases are created when
● an object is assigned to a variable
● an object is passed as an argument to a
method
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
101. Reference Capabilities
An alias is a name given to a particular object in
memory
Aliases are created when
● an object is assigned to a variable
● an object is passed as an argument to a
method
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
102. Reference Capabilities
An alias is a name given to a particular object in
memory
Aliases are created when
● an object is assigned to a variable
● an object is passed as an argument to a
method
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
103. Reference Capabilities
An alias is a name given to a particular object in
memory
Aliases are created when
● an object is assigned to a variable
● an object is passed as an argument to a
method
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
104. Reference Capabilities
An object may have more than one alias,
possibly in more than one actor, but the
combination of aliases must not violate the read
rule and write rule.
● The Read Rule: If an actor can
read an object then no other
actor can modify that object
● The Write Rule: If an actor can
modify an object then no other
actor can read or modify it
class Foo
class val Bar
let v: U32
new val create(vv: U32) =>
v = vv
actor Main
new create(env: Env) =>
let a: Foo iso = recover Foo end
var b = Bar(1)
b = Bar(2)
baz(b)
fun baz(c: Bar): U32 =>
c.v + 16
106. Reference Capabilities: iso (isolated)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
iso reference
can read and
modify an object.
No other
reference can
read or modify
the object.
object
alias1
alias2
alias3
Actor A Actor B
iso
107. Reference Capabilities: trn (transitional)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
trn reference
can read and
modify an object.
No other
reference can
modify the
object, but the
actor may have
other references
that can read the
object.
object
alias1
alias2
alias3
Actor A Actor B
trn
108. Reference Capabilities: ref (reference)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
ref reference
can read and
modify an object.
Other references
in the actor may
be able to read
or modify the
object, but no
other actor may
have a reference
that can read or
modify it.
object
alias1
alias2
alias3
Actor A Actor B
ref
109. Reference Capabilities: val (value)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
val reference
can read an
object. The actor
may have other
references that
can read the
object, and other
actors may have
references that
can read the
object, but no
actor may have
a reference that
can modify it.
object
alias1
alias2
alias3
Actor A Actor B
val
110. Reference Capabilities: box (box)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
object
alias1
alias2
alias3
Actor A Actor B
box
OR
object
alias1
alias2
alias3
Actor A Actor B
box
111. Reference Capabilities: box (box)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
object
alias1
alias2
alias3
Actor A Actor B
box
OR
object
alias1
alias2
alias3
Actor A Actor B
box
This
looks like
a val
This
looks like
a ref
A box capability is
used when you want to
create a new read-only
reference to an object
that is either val or ref.
113. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ???): I32 =>
x.v() + 1
What should the
reference capability
be?
114. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ref): I32 =>
x.v() + 1
115. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ref): I32 =>
x.v() + 1
ref doesn’t work
because a ref (x)
can’t alias a val (b)
116. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ref): I32 =>
x.v() + 1
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X val): I32 =>
x.v() + 1
ref doesn’t work
because a ref (x)
can’t alias a val (b)
117. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ref): I32 =>
x.v() + 1
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X val): I32 =>
x.v() + 1
ref doesn’t work
because a ref (x)
can’t alias a val (b)
val Doesn’t work
because a val (x)
can’t alias a ref (a)
118. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ref): I32 =>
x.v() + 1
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X val): I32 =>
x.v() + 1
ref doesn’t work
because a ref (x)
can’t alias a val (b)
val Doesn’t work
because a val (x)
can’t alias a ref (a)
119. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ref): I32 =>
x.v() + 1
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X val): I32 =>
x.v() + 1
ref doesn’t work
because a ref (x)
can’t alias a val (b)
val Doesn’t work
because a val (x)
can’t alias a ref (a)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X box): I32 =>
x.v() + 1
120. Reference Capabilities: box (box)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X ref): I32 =>
x.v() + 1
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X val): I32 =>
x.v() + 1
ref doesn’t work
because a ref (x)
can’t alias a val (b)
val Doesn’t work
because a val (x)
can’t alias a ref (a)
class X
let v: I32
new create(v': I32) =>
v = v'
actor Main
new create(env: Env) =>
let a: X ref = X(7)
let b: X val = recover
X(8)
end
bar(a)
bar(b)
fun bar(x: X box): I32 =>
x.v() + 1
box works because
a box (x) can alias
a ref (a) or a val (b)
121. Reference Capabilities: tag (tag)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
tag reference
cannot read or
modify an object,
but it can be
used to send the
object messages
if the object is an
actor, or to
compare
identity. Other
references may
read or modify
the object as
long as they do
not violate the
Read Rule and
the Write Rule.
object
alias1
alias2
alias3
Actor A Actor B
tag
122. Reference Capabilities: tag (tag)
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
object
alias1
alias2
alias3
Actor A Actor B
tag
Example:
alias2 can
be a ref
because this
does not
violate the
Read Rule or
Write Rule
tag reference
cannot read or
modify an object,
but it can be
used to send the
object messages
if the object is an
actor, or to
compare
identity. Other
references may
read or modify
the object as
long as they do
not violate the
Read Rule and
the Write Rule.
125. Reference Capabilities
Readable → iso, trn, ref, val, box
Writeable → iso, trn, ref
Sendable → iso, val, tag
Objects with sendable reference
capabilities can be sent to other
actors in messages
126. Reference Capabilities: Sending A val
class Bar
actor Foo
be baz(x: Bar val) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover val Bar end
f.baz(b)
127. Reference Capabilities: Sending A val
class Bar
actor Foo
be baz(x: Bar val) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover val Bar end
f.baz(b)
Main
128. Reference Capabilities: Sending A val
class Bar
actor Foo
be baz(x: Bar val) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover val Bar end
f.baz(b)
Main Foo
foo
129. Reference Capabilities: Sending A val
class Bar
actor Foo
be baz(x: Bar val) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover val Bar end
f.baz(b)
Main Foo
f
Bar
b
130. Reference Capabilities: Sending A val
class Bar
actor Foo
be baz(x: Bar val) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover val Bar end
f.baz(b)
Main Foo
f
Bar
b
baz( )
131. Reference Capabilities: Sending A val
class Bar
actor Foo
be baz(x: Bar val) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover val Bar end
f.baz(b)
Main Foo
f
Bar
b
baz( )
x
132. Reference Capabilities: Sending A val
class Bar
actor Foo
be baz(x: Bar val) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover val Bar end
f.baz(b)
Main Foo
f
Bar
b x
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
133. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
134. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
An actor’s default
reference
capability is tag
135. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
Main
136. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
Main Foo
foo
137. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
Main Foo
f
Bar
b
138. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
Main Foo
f
Bar
b
baz( )
139. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
Main Foo
f
Bar
b
baz( )
x
140. Reference Capabilities: Sending A tag
actor Bar
actor Foo
be baz(x: Bar tag) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = Bar
f.baz(b)
Main Foo
f
Bar
b x
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
141. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
142. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main
143. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main Foo
foo
144. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main Foo
f
Bar
b
145. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main Foo
f
Bar
b
consume
causes b to
give up it’s
reference
146. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main Foo
f
Bar
b
once we
consume b,
we can no
longer use it
147. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main Foo
f
Bar
b
baz( )
148. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main Foo
f
Bar
b
baz( )
x
149. Reference Capabilities: Sending An iso
class Bar
actor Foo
be baz(x: Bar iso) =>
// do something with x
actor Main
new create(env: Env) =>
let f = Foo
let b = recover iso Bar end
f.baz(consume b)
Main Foo
f
Bar
b x
● The Read Rule: If an
actor can read an
object then no other
actor can modify that
object
● The Write Rule: If an
actor can modify an
object then no other
actor can read or
modify it
151. No More Data Races
Remember this?
global int a = 0
function inc() {
for x in range(0, 1000001) {
a = a + 1
}
}
function main() {
thread thread1 = Thread(inc)
thread thread2 = Thread(inc)
thread1.run()
thread2.run()
thread1.join()
thread2.join()
print(“a = “ + a)
}
Expected:
2000000
Actual Run 1:
1987735
Actual Run 2:
1935010
Actual Run 3:
1941217
152. No More Data Races
Remember this?
global int a = 0
function inc() {
for x in range(0, 1000001) {
a = a + 1
}
}
function main() {
thread thread1 = Thread(inc)
thread thread2 = Thread(inc)
thread1.run()
thread2.run()
thread1.join()
thread2.join()
print(“a = “ + a)
}
This program violates the Read
Rule and Write Rule, because the
variable a can be read and
modified from multiple threads.
153. No More Data Races
A first pass at a Pony equivalent
use “collections”
class Counter
var v: U64 = 0
fun ref inc() => v = v + 1
actor Inc
be doit(c: Counter) =>
for x in range(0, 100001) do
c.inc()
end
actor Main
new create(env: Env) =>
let c = Counter
Inc.doit(c)
Inc.doit(c)
env.out.print(c.v.string())
154. No More Data Races
A first pass at a Pony equivalent
use “collections”
class Counter
var v: U64 = 0
fun ref inc() => v = v + 1
actor Inc
be doit(c: Counter) =>
for x in range(0, 100001) do
c.inc()
end
actor Main
new create(env: Env) =>
let c = Counter
Inc.doit(c)
Inc.doit(c)
env.out.print(c.v.string())
This doesn’t work because the
two Inc actors try to read and
write to the Counter
155. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
156. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
157. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
158. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
159. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
160. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
161. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
162. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
163. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
2000000
164. No More Data Races
use “collections”
actor Counter
var _count: U64 = 0
be increment() =>
_count = _count + 1
be print(env: Env) =>
env.out.print(_count.string())
actor Incrementer
new create(counter: Counter, main: Main) =>
for x in Range(0, 1_000_001) do
counter.increment()
end
main.finished(this)
actor Main
let _finished_count = 0
let _counter: Counter = Counter
let _env: Env
new create(env: Env) =>
_env = env
let inc1 = Incrementer(_counter, this)
let inc2 = Incrementer(_counter, this)
be finished() =>
_finished_count = _finished_count + 1
if _finished_count = 2 then
_counter.print(env)
end
The Counter
actor “protects”
the _count data
structure
167. Sendence’s Experience With Pony
It’s nice to catch errors a compile time rather than runtime
Pony is a young language (not even 1.0.0 yet)
168. Sendence’s Experience With Pony
It’s nice to catch errors a compile time rather than runtime
Pony is a young language (not even 1.0.0 yet)
● limited documentation
169. Sendence’s Experience With Pony
It’s nice to catch errors a compile time rather than runtime
Pony is a young language (not even 1.0.0 yet)
● limited documentation
● things change
170. Sendence’s Experience With Pony
It’s nice to catch errors a compile time rather than runtime
Pony is a young language (not even 1.0.0 yet)
● limited documentation
● things change
● there are some sharp edges (compiler bugs, runtime bugs)
171. Sendence’s Experience With Pony
It’s nice to catch errors a compile time rather than runtime
Pony is a young language (not even 1.0.0 yet)
● limited documentation
● things change
● there are some sharp edges (compiler bugs, runtime bugs)
“America is all about speed. Hot, nasty, badass speed.” -- Eleanor Roosevelt
PONY