This document discusses Julia's use of multimethod dispatch and generic functions to provide both data abstraction and high performance. Julia bridges the divide between computer science and computational science by allowing users to write generic code that can also achieve native machine performance when applicable. Its type system and multimethods allow methods to be specialized for different argument types, enabling both abstraction and optimized implementations.
Slides for a 20 minute presentation about Julia, with a brief introduction to multiple dispatch/multimethods and how it is used for numerical linear algebra
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...robocupathomeedu
RoboCup@Home Education
Online Classroom: Invited Lecture Series
= Robot Localisation: An Introduction =
Speaker: Luis Contreras | Tamagawa University
Date and Time:
- June 09, 2020 (Tue) 09:00~11:00 (GMT+8 China/Malaysia)
- June 08, 2020 (Mon) 21:00~23:00 (EDT New York)
- June 08, 2020 (Mon) 03:00~05:00 (CEST Italy/France)
https://www.robocupathomeedu.org/learn/online-classroom/invited-lecture-series
The Incredible Disappearing Data ScientistRebecca Bilbro
The last decade saw advances in compute power combine with an avalanche of open source software development, resulting in a revolution in machine learning and scalable analytics. “Data science” and “data product” are now household terms. This led to a new job description, the Data Scientist, which quickly became one of the most significant, exciting, and misunderstood jobs of the 21st century. One part statistician, one part computer scientist, and one part domain expert, data scientists seem poised to become the most pivotal value creators of the information age. And yet, danger (supposedly) lies ahead: human decisions are increasingly outsourced to algorithms of questionable ethical design; we’re putting everything on the blockchain; and perhaps most disturbingly, data science salaries are dropping precipitously as new graduates and Machine Learning as a Service (MLaaS) offerings flood the market. As we move into a future where predictive analytics is no longer a differentiator but instead a core business function, will data scientists proliferate or be automated out of a job?
In this talk, one humble data scientist attempts to cut through the hype to present an alternate vision of what data science is and can become. If not the “Sexiest Job of the 21st Century" as the Harvard Business Review once quipped, what is it like to be a workaday data scientist? What problems are we solving? How do we integrate with mature engineering teams? How do we engage with clients and product owners? How do we deploy non-deterministic models in production? In particular, we’ll examine critical integration points — technological and otherwise — we are currently tackling, which will ultimately determine our success, and our viability, over the next 10 years.
Experience Mazda Zoom Zoom Lifestyle and Culture by Visiting and joining the Official Mazda Community at http://www.MazdaCommunity.org for additional insight into the Zoom Zoom Lifestyle and special offers for Mazda Community Members. If you live in Arizona, check out CardinaleWay Mazda's eCommerce website at http://www.Cardinale-Way-Mazda.com
Slides for a 20 minute presentation about Julia, with a brief introduction to multiple dispatch/multimethods and how it is used for numerical linear algebra
Robot Localisation: An Introduction - Luis Contreras 2020.06.09 | RoboCup@Hom...robocupathomeedu
RoboCup@Home Education
Online Classroom: Invited Lecture Series
= Robot Localisation: An Introduction =
Speaker: Luis Contreras | Tamagawa University
Date and Time:
- June 09, 2020 (Tue) 09:00~11:00 (GMT+8 China/Malaysia)
- June 08, 2020 (Mon) 21:00~23:00 (EDT New York)
- June 08, 2020 (Mon) 03:00~05:00 (CEST Italy/France)
https://www.robocupathomeedu.org/learn/online-classroom/invited-lecture-series
The Incredible Disappearing Data ScientistRebecca Bilbro
The last decade saw advances in compute power combine with an avalanche of open source software development, resulting in a revolution in machine learning and scalable analytics. “Data science” and “data product” are now household terms. This led to a new job description, the Data Scientist, which quickly became one of the most significant, exciting, and misunderstood jobs of the 21st century. One part statistician, one part computer scientist, and one part domain expert, data scientists seem poised to become the most pivotal value creators of the information age. And yet, danger (supposedly) lies ahead: human decisions are increasingly outsourced to algorithms of questionable ethical design; we’re putting everything on the blockchain; and perhaps most disturbingly, data science salaries are dropping precipitously as new graduates and Machine Learning as a Service (MLaaS) offerings flood the market. As we move into a future where predictive analytics is no longer a differentiator but instead a core business function, will data scientists proliferate or be automated out of a job?
In this talk, one humble data scientist attempts to cut through the hype to present an alternate vision of what data science is and can become. If not the “Sexiest Job of the 21st Century" as the Harvard Business Review once quipped, what is it like to be a workaday data scientist? What problems are we solving? How do we integrate with mature engineering teams? How do we engage with clients and product owners? How do we deploy non-deterministic models in production? In particular, we’ll examine critical integration points — technological and otherwise — we are currently tackling, which will ultimately determine our success, and our viability, over the next 10 years.
Experience Mazda Zoom Zoom Lifestyle and Culture by Visiting and joining the Official Mazda Community at http://www.MazdaCommunity.org for additional insight into the Zoom Zoom Lifestyle and special offers for Mazda Community Members. If you live in Arizona, check out CardinaleWay Mazda's eCommerce website at http://www.Cardinale-Way-Mazda.com
A very short tour through the Julia community and how key features of the language interact to produce an expressive syntax that users like without sacrificing performance
LESSON 3B. FOCUS: FOR LOOPS, NESTED LOOPS, TASKS AND CHALLENGES.
Introduction to, with examples, For loops. Challenges and tasks included with solutions (predict the output). Compare ‘while’ and ‘for’ loops. Use the break statement and explore how it works in different scenarios. Learn about Nested Loops. Learn about the need for initialisation (set starting value). Create your own for loops. Create the beginnings of an arithmetic quiz using a random function and for loops. Big ideas discussion: Is the universe digital. A program? Introducing Gottfried Leibniz and Konrad Zuse. Includes a suggested videos, ‘Big ideas’ discussion, and HW/research projects section.
Seven Ineffective Coding Habits of Many ProgrammersKevlin Henney
Presented at Build Stuff (20th November 2014)
Habits help you manage the complexity of code. You apply existing skill and knowledge automatically to the detail while focusing on the bigger picture. But because you acquire habits largely by imitation, and rarely question them, how do you know your habits are effective? Many of the habits and conventions programmers have for naming, formatting, commenting and unit testing do not stand up as rational and practical on closer inspection.
This session examines seven coding habits that are not as effective as many programmers — whether working with Java, .NET, native or scripting languages — might believe, and suggests alternatives.
A Gentle Introduction to Coding ... with PythonTariq Rashid
A gentle introduction to coding (programming) for complete beginners. Starting from then basics - electrical wires - proceeding through variables, data structures, loops, functions, and exploring libraries for visualisation and specialist tools. Finally we use flask to make a very simple twitter clone web application.
Have you ever seen a Java course that is 'visual' in nature? The kind of lessons where you can see what happens when you are creating an object, doing method overloading, and using run-time polymorphism. I bet you haven't. Welcome to the most 'visual' Java course you will ever take.
This course teaches you everything you need to get started with Java programming. It divides each topic into explanation and example.
The explanation section deals with how a particular concept works in Java and covers the following:
Data Types & Variables, Typecasting,
Operators & Conditional statements such as if, if else, switch
Loops such as for, for each, while, and do while
Methods, Types of methods, Call by Value vs. Call by Reference, Variable Scope, Method Overloading,
Arrays and ArrayLists,
Classes and objects, How classes and objects work, and How primitive types vs. reference types are stored
Swing classes to take input from the user and command line methods to take input from the user such as BufferedReader, Scanner, Console,
Static variables, static methods, this keyword, super keyword, method overriding,
What is inheritance
And a real world example of run-time polymorphism that actually demonstrates what happens with vs. without polymorphism.
The example section covers an example for every concept discussed above. The course will be updated constantly to keep in sync with the real world developments in Java. So, are you ready to become a Java PRO?
LESSON 3A. INTRODUCTION TO ITERATION: LOOPS, TRACE TABLES, WHILE LOOPS
Introduction to Iteration and loops. The theory behind loops and how they work. Create and adapt programs using loops. Intro to the random number generator. Learn about trace tabling (white box testing). Example of a trace table and dry run. Wonders of the Fibonacci sequence. Examples of Iteration in game design. Focus on While loops. Challenges, tasks (with solutions), suggested videos, big ideas discussion and research and HW included. Introducing Ada Lovelace and Charles Babbage.
FP vs OOP : Design Methodology by Harshad NawatheChandulal Kavar
Abstract Data Types and Object Oriented Programming are two prominent methods of software design. Abstract Data Types used in Functional Programming paradigm employ type abstraction and are centred around the operations. While objects use procedural abstraction and organised around the constructors. In this talk, we will analyse differences between these orthogonal implementation techniques and their effects on extensibility, efficiency and typing. The talk includes code examples for illustration purpose but it doesn't emphasises on specific programming language or implementation method.
A very short tour through the Julia community and how key features of the language interact to produce an expressive syntax that users like without sacrificing performance
LESSON 3B. FOCUS: FOR LOOPS, NESTED LOOPS, TASKS AND CHALLENGES.
Introduction to, with examples, For loops. Challenges and tasks included with solutions (predict the output). Compare ‘while’ and ‘for’ loops. Use the break statement and explore how it works in different scenarios. Learn about Nested Loops. Learn about the need for initialisation (set starting value). Create your own for loops. Create the beginnings of an arithmetic quiz using a random function and for loops. Big ideas discussion: Is the universe digital. A program? Introducing Gottfried Leibniz and Konrad Zuse. Includes a suggested videos, ‘Big ideas’ discussion, and HW/research projects section.
Seven Ineffective Coding Habits of Many ProgrammersKevlin Henney
Presented at Build Stuff (20th November 2014)
Habits help you manage the complexity of code. You apply existing skill and knowledge automatically to the detail while focusing on the bigger picture. But because you acquire habits largely by imitation, and rarely question them, how do you know your habits are effective? Many of the habits and conventions programmers have for naming, formatting, commenting and unit testing do not stand up as rational and practical on closer inspection.
This session examines seven coding habits that are not as effective as many programmers — whether working with Java, .NET, native or scripting languages — might believe, and suggests alternatives.
A Gentle Introduction to Coding ... with PythonTariq Rashid
A gentle introduction to coding (programming) for complete beginners. Starting from then basics - electrical wires - proceeding through variables, data structures, loops, functions, and exploring libraries for visualisation and specialist tools. Finally we use flask to make a very simple twitter clone web application.
Have you ever seen a Java course that is 'visual' in nature? The kind of lessons where you can see what happens when you are creating an object, doing method overloading, and using run-time polymorphism. I bet you haven't. Welcome to the most 'visual' Java course you will ever take.
This course teaches you everything you need to get started with Java programming. It divides each topic into explanation and example.
The explanation section deals with how a particular concept works in Java and covers the following:
Data Types & Variables, Typecasting,
Operators & Conditional statements such as if, if else, switch
Loops such as for, for each, while, and do while
Methods, Types of methods, Call by Value vs. Call by Reference, Variable Scope, Method Overloading,
Arrays and ArrayLists,
Classes and objects, How classes and objects work, and How primitive types vs. reference types are stored
Swing classes to take input from the user and command line methods to take input from the user such as BufferedReader, Scanner, Console,
Static variables, static methods, this keyword, super keyword, method overriding,
What is inheritance
And a real world example of run-time polymorphism that actually demonstrates what happens with vs. without polymorphism.
The example section covers an example for every concept discussed above. The course will be updated constantly to keep in sync with the real world developments in Java. So, are you ready to become a Java PRO?
LESSON 3A. INTRODUCTION TO ITERATION: LOOPS, TRACE TABLES, WHILE LOOPS
Introduction to Iteration and loops. The theory behind loops and how they work. Create and adapt programs using loops. Intro to the random number generator. Learn about trace tabling (white box testing). Example of a trace table and dry run. Wonders of the Fibonacci sequence. Examples of Iteration in game design. Focus on While loops. Challenges, tasks (with solutions), suggested videos, big ideas discussion and research and HW included. Introducing Ada Lovelace and Charles Babbage.
FP vs OOP : Design Methodology by Harshad NawatheChandulal Kavar
Abstract Data Types and Object Oriented Programming are two prominent methods of software design. Abstract Data Types used in Functional Programming paradigm employ type abstraction and are centred around the operations. While objects use procedural abstraction and organised around the constructors. In this talk, we will analyse differences between these orthogonal implementation techniques and their effects on extensibility, efficiency and typing. The talk includes code examples for illustration purpose but it doesn't emphasises on specific programming language or implementation method.
ScalaDays 2013 Keynote Speech by Martin OderskyTypesafe
Scala gives you awesome expressive power, but how to make best use of it? In my talk I will discuss the question what makes good Scala style. We will start with syntax and continue with how to name things, how to mix objects and functions, where (and where not) to use mutable state, and when to use which design pattern. As most questions of style, the discussion will be quite subjective, and some of it might be controversial. I am looking forward to discuss these topics with the conference attendees.
(video and more at http://fsharpforfunandprofit.com/fppatterns)
In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID. The functional programming community has design patterns and principles as well. This talk will provide an overview of some of these patterns (such as currying, monads), and present some demonstrations of FP design in practice. We'll also look at some of the ways you can use these patterns as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
4. Alan Edelman Andreas Noack Xianyi Zhang Jarrett Revels
Oscar BlumbergDavid Sanders
The
Julia Lab
at MIT
Simon Danisch
Jiahao Chen
Weijian Zhang
U. Manchester
Jake Bolewski
USAP
Shashi GowdaAmit Murthy Tanmay Mohapatra
Eka Palamadai
Collaborators
Joey Huchette
Isaac Virshup
Steven Johnson
MIT Mathematics
Yes Sian Ng Miles Lubin Iain Dunning
Jon Malmaud Simon Kornblith
Yichao Yu
Harvard
Jeremy Kepner
Lincoln Labs
Stavros
Papadopoulos
Intel Labs
Nikos
Patsopoulos
Brigham Woman’s
Hospital
Pete Szolovits
CSAIL
Alex Townsend
MIT Mathematics
Jack Poulson
Stanford
5. Mike Innes
Julia Computing
Summer of
Code alums
Keno Fischer
Julia Computing
Jameson Nash
Julia Computing
Simon Danisch
Julia Lab
Shashi Gowda
Julia Lab
Leah Hanson
Stripe
John Myles White
Facebook
Jarrett Revels
Julia Lab
2013
2014
2015
Jacob Quinn
Domo
Kenta Sato
U. Tokyo
Rohit Varkey Thankachan
Nat’l Inst. Tech. Karnataka
Simon Danish
Julia Lab
David Gold
U. Washington
Keno FischerJameson NashStefan KarpinskiJeff Bezanson Viral B. Shah
Alums at
Mike Innes
8. What’s the big deal about Julia ?
A high level language
with C-like speed
julialang.org/benchmarks
9. What’s the big deal about Julia ?
Normalized average lines of code (shortest = 0, longest = 1)
Execution time (C = 1)
https://groups.google.com/d/msg/julia-users/BYRAeQJuvTw/O7VK7-vp1EEJ
fast and expressive
11. It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
12. It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
data abstraction
performance
13. It bridges the divide between computer science
and computational science
What’s the big deal about Julia ?
data abstraction
performance
What if you didn’t have to choose between
data abstraction and performance?
14. Thesis:
Users want to write generic code.
Users also want native machine performance (when available).
Julia’s generic function system with multimethods (multiple
dispatch) lets you have both.
15. Is Julia object oriented?
Yes, but maybe not in a way you’re familiar with.*
Generic functions** like in CLOS,
unlike C++ classes.
*G. Castagna, Object Oriented Programming: A Unified Foundation, http://link.springer.com/book/10.1007/978-1-4612-4138-6
**L. G. DeMichiel and R. P. Gabriel, §3.2 of The Common Lisp Object System: An Overview, http://www.dreamsongs.com/Files/ECOOP.pdf
23. methods objects
Object-oriented programming with classes
What can I do with/to a thing?
top up
pay fare
lose
buy
classes are more
fundamental
than methods
top up
pay fare
lose
buy
pay fare
lose
buy
24. OOP with classes multimethods
What can I do with/to a thing?
top up
pay fare
lose
buy
generic
function
objectsmethods
multimethods
relationships between
objects and functions
25. Multimethods for linear algebra
What can I do with/to a thing?
compute spectral factorization
compute singular values
compute singular values and vectors
compute eigenvalues
generic
function
objectsmethods
Methods can take advantage of special matrix structures
eigvals
eigfact
svdvals
svdfact
Matrix
SymTridiagonal
Bidiagonal
26. Data types as a lattice
D. Scott, “Data types as lattices”, SIAM J. Comput. 5: 522-87, 1976, doi:10.1137/0205037
Real
Number
FloatingPoint Rational
Complex
Float64 BigFloat…
…
Integer
is a parameter of
is a subtype of
Signed BigInt
Any
Int64…
…
27. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
28. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
29. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
30. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
31. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
no method here either
super(Signed) = Integer
32. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
no method here
try supertype
super(Int64) = Signed
no method here either
super(Signed) = Integer
found a method
33. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
34. Signed
Multimethods with type lattice traversal
Real
Number
FloatingPoint Rational
Float64 BigFloat…
Integer
is a parameter of
is a subtype of
BigInt
Any
Int64…
…
35.
36.
37.
38.
39.
40.
41.
42. easy to call external C
functions, e.g. CLAPACK
sstev, dstev…
43. So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings
44. So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings textbook algorithm
45. So how does this help us with linear algebra?
Multi-method dispatch with generic fallbacks
Matrix operations on general rings
52. In summary,
Types helps users express scientific computations
and helps the compiler specialize code for performance
Other advanced features for genericness and performance:
metaprogramming with macros and generated functions,
parametric polymorphism, native parallel computing, …
try Julia today!
juliabox.org
JuliaCon - June 21-25 at MIT CSAIL
juliacon.org
53. Other references
B. Liskov, The Power of Abstraction, Turing Award lecture,
OOPSLA’09. https://www.youtube.com/watch?
v=qAKrMdUycb8
J. Sammet, Programming Languages: History and
Fundamentals, Prentice-Hall, 1969.
54. Are classes really that bad?
Yes, when you break their abstraction.
http://okmij.org/ftp/Computation/Subtyping/
57. The circle-ellipse problem (aka the square-rectangle problem)
Is a circle an ellipse?
Yes: it is a special case of an ellipse with
degenerate foci
zero eccentricity
etc.
58. The circle-ellipse problem (aka the square-rectangle problem)
Is a circle an ellipse?
Yes: it is a special case of an ellipse with
degenerate foci
zero eccentricity
etc.
No: it makes no sense to change the second focus of a circle.
61. The circle-ellipse problem
#Program A
foo = Ellipse(r1 = 0.5, r2 = 1.0)
get_r2(foo)
Circle(r = 0.5)
You can make this program work: define
get_r2(x::Circle) = x.r
62. #Program B
foo = Ellipse()
set_r1(foo, 0.5)
set_r2(foo, 1.0)
get_r1(foo)*get_r2(foo) == 0.5
The circle-ellipse problem
#Program A
foo = Ellipse(r1 = 0.5, r2 = 1.0)
get_r2(foo)
Circle(r = 0.5)
You can make this program work: define
get_r2(x::Circle) = x.r
63. #Program B
foo = Ellipse()
set_r1(foo, 0.5)
set_r2(foo, 1.0)
get_r1(foo)*get_r2(foo) == 0.5
The circle-ellipse problem
#Program A
foo = Ellipse(r1 = 0.5, r2 = 1.0)
get_r2(foo)
Circle()
Circle(r = 0.5)
You can make this program work: define
get_r2(x::Circle) = x.r
64. #Program B
foo = Ellipse()
set_r1(foo, 0.5)
set_r2(foo, 1.0)
get_r1(foo)*get_r2(foo) == 0.5
The circle-ellipse problem
#Program A
foo = Ellipse(r1 = 0.5, r2 = 1.0)
get_r2(foo)
Circle()
Circle(r = 0.5)
You can’t substitute a Circle for an Ellipse in this program.
You can make this program work: define
get_r2(x::Circle) = x.r
65. #Program B
foo = Ellipse()
set_r1(foo, 0.5)
set_r2(foo, 1.0)
get_r1(foo)*get_r2(foo) == 0.5
The circle-ellipse problem
#Program A
foo = Ellipse(r1 = 0.5, r2 = 1.0)
get_r2(foo)
Circle()
Circle(r = 0.5)
You can’t substitute a Circle for an Ellipse in this program.
You can make this program work: define
get_r2(x::Circle) = x.r
If you can mutate objects (“covariant context”)*, then circles
are not ellipses because of the Liskov substitution
principle** (one of the SOLID principles).
*G. Castagna, Covariance and contravariance : conflict without a cause.
In Object Oriented Programming: A Unified Foundation, http://link.springer.com/book/10.1007/978-1-4612-4138-6
**B. Liskov, Keynote address - data abstraction and hierarchy, OOPSLA '87 Proceedings Addendum, 17-34.
B. Liskov and J. M. Wing. "A Behavioral Notion of Subtyping," ACM Trans. Programming Languages and Systems 16(6):1811-1841, Nov 1994.
68. n-ary operations
Methods are associated with classes.
mylist = ListOfNumbers();
mylist.push!(1.0);
A unary operation on a class can be implemented as a
method of that class.
The abstraction of classes can break down for functions
involving multiple classes.
69. n-ary operations
Neither. Matrix + DiagonalMatrix needs to access private
fields, thus breaking encapsulation*.
*A loaded term; see D. J. Armstrong, The quarks of object-oriented development, Commun. ACM 49 (2): 123-8, Feb 2006, doi:10.1145/1113034.1113040
70. n-ary operations
Adding a diagonal matrix and an ordinary (dense) matrix:
is it a method of Matrix or DiagonalMatrix?
Neither. Matrix + DiagonalMatrix needs to access private
fields, thus breaking encapsulation*.
*A loaded term; see D. J. Armstrong, The quarks of object-oriented development, Commun. ACM 49 (2): 123-8, Feb 2006, doi:10.1145/1113034.1113040
71. n-ary operations
Adding a diagonal matrix and an ordinary (dense) matrix:
is it a method of Matrix or DiagonalMatrix?
class Matrix {
private:
int m, n;
float *data;
// …
friend Matrix operator+(Matrix M, DiagonalMatrix D); //non-member function
};
class DiagonalMatrix{
private:
int n;
//store only the diagonals
float *diagonaldata;
// …
friend Matrix operator+(Matrix M, DiagonalMatrix D); //non-member function
};
Neither. Matrix + DiagonalMatrix needs to access private
fields, thus breaking encapsulation*.
*A loaded term; see D. J. Armstrong, The quarks of object-oriented development, Commun. ACM 49 (2): 123-8, Feb 2006, doi:10.1145/1113034.1113040