170 likes | 175 Views
This presentation by Craig R. Kuehn explores the concepts of message passing, concurrency, and parallelism in Erlang. It covers the basics of variables, data types, modules, functions, conditions/controls, and more. It also delves into advanced topics such as process handling, message passing tools, handling errors, and the future of concurrency-oriented programming. Presented by the University of Wisconsin-Platteville CS Department.
E N D
Message Passing, Concurrency, And Parallelism with Erlang Presented By: Craig R. Kuehn Department of Computer Science and Software Engineering University of Wisconsin-Platteville kuehnc@uwplatt.edu
R&D @ Ellemtel CS Lab History • 1985 – Tried 20 Different Languages • 1987 – First Experiments with Erlang • 1991 – First Project in Erlang • 1993 – BOS • 1996 – OTP! • 1999 – OPEN SOURCE!!! • 2003 – Workshop Joins ACM SIGPLAN ICPF • 2006 – SMP Capable
Ready! • Most Important Rule: • Programming Is Fun!! • AI class? • Functional Programming? • Concurrency-Oriented Programming?
GO!!! Set!
We Have to Start Somewhere The Basics… Variables • Start With a Capital Letter • Single Assignment – Not Like C++ or Java (I told you to forget about them) • “=“ -> Lhs = Rhs • Bound v.s. Unbound • “_” the anonymous variable • Why Single Assignment? • Scope
…The Basics Continued… Data Types • Integers • Floats • Atoms • Tuples • Records • Lists • Strings • Binaries
…The Basics Continued Still… Modules • Basic Unit • moduleName.erl • Compiled • moduleName.beam • Module • Import • Export
…The Basics Continued Still More… Functions • Clauses • Head -> Body • “Tried” In Order • Arity • fun Anonymous Function • Higher-Order Functions • List Comprehensions • BIFs
…The Basics Continued And Still More… Conditions/Controls • Not really needed • Guards (semicolon and comma delimited) • Case • If • Exceptions
A Tidbit About Erlang Intermission From The Heavy Stuff Targets or Goals In Mind During The Design • Fault Tolerant • Continuous • Concurrent • Distributed, Heterogeneous • Highly Reliable, “Soft”Real-time • Scalable • Tail Recursive • Process-Oriented
The Advanced Part… Marching Onward Process Stuff • Process Dictionary • Pure Message Passing Language • Detriment To Your Health • Bad Horror Movies • Relax
…The Advanced Part Continued… Message Passing, Concurrency, and Parallelism Tools • Spawn() • “!” The Send Operator • Receive…end (Blocking and Non-Blocking)
…The Advanced Part Continued Still… The Intricate Parts of Receive • Timer • First Message • Not A Match • No More Messages • It Is A Match!!! • Timer Elapses
…The Advanced Part Continued Still More… Message Passing, Concurrency, and Parallelism Specs • Publishing a Process Identifier • Spawning with MFA • “Hot Swapping”
…The Advanced Part Continued And Still More… Message Passing, Concurrency, and Parallelism Errors • Exit Signals • Linking • Monitors
Gosh, Finally! The Future: • Concurrency-Oriented Programming • Erlang • UW-Platteville CS Department
So You Think You Have A Question, Do You? Well Do You?