Study of Erlang for Building Real-Time SystemsByDinesh RajpootRoll no. 09305043Under the guidance of Prof. Kavi AryaAugust  20, 2010
OutlineIntroduction to Erlang
Erlang Highlights
Declarative
Concurrency
Fault-tolerant
Hot Code Swapping
Multi Core Programming Applications of ErlangRobot Programming in Erlang
Challenges and Solutions
Case Study(Adaptive Cruise Control)
Conclusion and Future Work
ReferencesIntroduction to ErlangErlang was designed by Ericcson.It is a functional programming language.Variables are immutable.No side- effect(pure functions)Referential Transparency Int G =1; \\ G is globalintplusG(int x){  return x + G;}intplusOne(int x){  return x+1;}
DeclarativeConcentrate on “What” rather  than  “How”.The programs are concise.qsort([])               ->  [];qsort([Pivot|T]) ->  qsort([X || X <- T, X =< Pivot]) ++ [Pivot] ++ qsort([X || X <- T, X > Pivot]).Programs are readable and easy to maintain.It increases productivity.
ConcurrencyEach concurrent  activity is called “process”.Processes  don’t share data.Processes belong to language not operating system.Processes communicate through “message passing”not shared memory.Less  process creation and message passing time.
ConcurrencyCreate  a  processPid = spawn(Module, fun, [Arguments])Send and receivePid ! message      receive            message1  -> actions1;		message2 -> actions2;		……		after   Time -> time out actions;	 end.
An example	-module(echo).	-export([start/0, loop/o]).	start() -> Pid = spawn (echo, loop, [ ] ),Pid ! { self (), hello},	   receive 	         { Pid, Msg } ->io:format ( “~w~n”, [Msg])	  end,Pid ! stop.loop() ->    receive       { From, Msg } ->	From ! { self(), Msg},	loop();   stop -> true   end.{<0.1.0>, hello}{<0.1.0>, hello}shellPid{<0.2.0>, hello}stop<0.1.0><0.2.0>
1,000erlangjavaC#100Microseconds/process101101001,00010,000100,000Number of processesProcess creation times (LOG/LOG scale)> 200,000processesSource:Joe ArmstrongSICS
100,000erlangjava10,000C#1,000Microseconds/message1001011101001,00010,000100,000Number of processesMessage passing times (LOG/LOG scale)> 200,000processesSource:Joe ArmstrongSICS
Fault TolerantErlang provides fault tolerance through isolating errors and ensuring nonstop operation.            {‘EXIT’, Pid, Reason}                                                        {‘EXIT’, Pid, Reason}                   {‘EXIT’, Pid, Reason}
Hot Code SwappingEmbedded  systems  are reactive.How can I update my system without shutting down?In Erlang , we can change code on-the-fly. We can keep 2 version of same module running.

More Related Content

PPTX
Isorc18 keynote
PPT
The Erlang Programming Language
PDF
Analysis of Algorithms II - PS5
PDF
Analysis of Algorithms II - PS2
PPS
Programming in Arduino (Part 2)
PPT
Introduction to synchronous programming langauges
PPS
Programming in Arduino (Part 1)
ODP
Commutative Short Circuit Operators
Isorc18 keynote
The Erlang Programming Language
Analysis of Algorithms II - PS5
Analysis of Algorithms II - PS2
Programming in Arduino (Part 2)
Introduction to synchronous programming langauges
Programming in Arduino (Part 1)
Commutative Short Circuit Operators

What's hot (20)

PDF
Parallelising Dynamic Programming
ODP
QVT Traceability: What does it really mean?
PDF
08. graph traversal
PPTX
Introduction To Algorithms
PDF
01. introduction to C++
PPSX
Symbolic mathematics
PDF
A General Framework for Electronic Circuit Verification
ODP
The OCLforUML Profile
PPTX
Arduino Programming
ODP
OCL 2.4. (... 2.5)
ODP
Safe navigation in OCL
PPT
Bakery algorithm
PPTX
Algo analysis
ODP
Aligning OCL and UML
PDF
Python in a physics lab
ODP
Embedded OCL Integration and Debugging
PPTX
Principal source of optimization in compiler design
PPTX
Functional coverages
DOCX
Ppt on fft
ODP
OCL Integration and Code Generation
Parallelising Dynamic Programming
QVT Traceability: What does it really mean?
08. graph traversal
Introduction To Algorithms
01. introduction to C++
Symbolic mathematics
A General Framework for Electronic Circuit Verification
The OCLforUML Profile
Arduino Programming
OCL 2.4. (... 2.5)
Safe navigation in OCL
Bakery algorithm
Algo analysis
Aligning OCL and UML
Python in a physics lab
Embedded OCL Integration and Debugging
Principal source of optimization in compiler design
Functional coverages
Ppt on fft
OCL Integration and Code Generation
Ad

Similar to Erlang real time (20)

PPT
Erlang OTP
PDF
Choosing the Erlang Ecosystem for Developing the Applications of the Future!
PPTX
Erlang os
PPT
Erlang For Five Nines
PDF
FunctionalConf '16 Robert Virding Erlang Ecosystem
ODP
An introduction to erlang
PPT
The Erlang Programming Language
PDF
Introduction To Erlang Final
PDF
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
 
PDF
Erlang from behing the trenches by Francesco Cesarini
PDF
Erlang, an overview
PDF
Let it crash! The Erlang Approach to Building Reliable Services
PDF
The design and implementation of a scalable concurrent virtual machine (Rober...
PDF
The design and implementation of a scalable concurrent virtual machine (Rober...
KEY
Osdc 2011 michael_neale
PDF
Erlang in 10 minutes
PDF
Erlang Lightning Talk
PDF
Why Erlang? - Bar Camp Atlanta 2008
PDF
Erlang: Bult for concurrent, distributed systems
PDF
Erlang - Concurrent Language for Concurrent World
Erlang OTP
Choosing the Erlang Ecosystem for Developing the Applications of the Future!
Erlang os
Erlang For Five Nines
FunctionalConf '16 Robert Virding Erlang Ecosystem
An introduction to erlang
The Erlang Programming Language
Introduction To Erlang Final
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
 
Erlang from behing the trenches by Francesco Cesarini
Erlang, an overview
Let it crash! The Erlang Approach to Building Reliable Services
The design and implementation of a scalable concurrent virtual machine (Rober...
The design and implementation of a scalable concurrent virtual machine (Rober...
Osdc 2011 michael_neale
Erlang in 10 minutes
Erlang Lightning Talk
Why Erlang? - Bar Camp Atlanta 2008
Erlang: Bult for concurrent, distributed systems
Erlang - Concurrent Language for Concurrent World
Ad

More from Akshar Desai (6)

PDF
Kakodkar committeereport 05132011
PDF
E yantra robot abstractions
PDF
Android and Hard Real Time
PDF
Making a screencast for CS308 project setup
PDF
Template for cs308 project setup screencast
PPTX
Scratch: Programming for everyone
Kakodkar committeereport 05132011
E yantra robot abstractions
Android and Hard Real Time
Making a screencast for CS308 project setup
Template for cs308 project setup screencast
Scratch: Programming for everyone

Recently uploaded (20)

PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PPT
What is a Computer? Input Devices /output devices
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Unlock new opportunities with location data.pdf
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
STKI Israel Market Study 2025 version august
Module 1.ppt Iot fundamentals and Architecture
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Enhancing emotion recognition model for a student engagement use case through...
observCloud-Native Containerability and monitoring.pptx
Zenith AI: Advanced Artificial Intelligence
What is a Computer? Input Devices /output devices
Taming the Chaos: How to Turn Unstructured Data into Decisions
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
A novel scalable deep ensemble learning framework for big data classification...
Group 1 Presentation -Planning and Decision Making .pptx
1 - Historical Antecedents, Social Consideration.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
Unlock new opportunities with location data.pdf
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Chapter 5: Probability Theory and Statistics
CloudStack 4.21: First Look Webinar slides
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
O2C Customer Invoices to Receipt V15A.pptx
STKI Israel Market Study 2025 version august

Erlang real time

  • 1. Study of Erlang for Building Real-Time SystemsByDinesh RajpootRoll no. 09305043Under the guidance of Prof. Kavi AryaAugust 20, 2010
  • 8. Multi Core Programming Applications of ErlangRobot Programming in Erlang
  • 12. ReferencesIntroduction to ErlangErlang was designed by Ericcson.It is a functional programming language.Variables are immutable.No side- effect(pure functions)Referential Transparency Int G =1; \\ G is globalintplusG(int x){  return x + G;}intplusOne(int x){  return x+1;}
  • 13. DeclarativeConcentrate on “What” rather than “How”.The programs are concise.qsort([]) -> [];qsort([Pivot|T]) -> qsort([X || X <- T, X =< Pivot]) ++ [Pivot] ++ qsort([X || X <- T, X > Pivot]).Programs are readable and easy to maintain.It increases productivity.
  • 14. ConcurrencyEach concurrent activity is called “process”.Processes don’t share data.Processes belong to language not operating system.Processes communicate through “message passing”not shared memory.Less process creation and message passing time.
  • 15. ConcurrencyCreate a processPid = spawn(Module, fun, [Arguments])Send and receivePid ! message receive message1 -> actions1; message2 -> actions2; …… after Time -> time out actions; end.
  • 16. An example -module(echo). -export([start/0, loop/o]). start() -> Pid = spawn (echo, loop, [ ] ),Pid ! { self (), hello}, receive { Pid, Msg } ->io:format ( “~w~n”, [Msg]) end,Pid ! stop.loop() -> receive { From, Msg } -> From ! { self(), Msg}, loop(); stop -> true end.{<0.1.0>, hello}{<0.1.0>, hello}shellPid{<0.2.0>, hello}stop<0.1.0><0.2.0>
  • 17. 1,000erlangjavaC#100Microseconds/process101101001,00010,000100,000Number of processesProcess creation times (LOG/LOG scale)> 200,000processesSource:Joe ArmstrongSICS
  • 18. 100,000erlangjava10,000C#1,000Microseconds/message1001011101001,00010,000100,000Number of processesMessage passing times (LOG/LOG scale)> 200,000processesSource:Joe ArmstrongSICS
  • 19. Fault TolerantErlang provides fault tolerance through isolating errors and ensuring nonstop operation. {‘EXIT’, Pid, Reason} {‘EXIT’, Pid, Reason} {‘EXIT’, Pid, Reason}
  • 20. Hot Code SwappingEmbedded systems are reactive.How can I update my system without shutting down?In Erlang , we can change code on-the-fly. We can keep 2 version of same module running.
  • 21. Multi-core ProgrammingHow to achieve?Use lots of processes.Avoid side effects.Avoid sequential bottleneck.Write “small message, big computation”.What is special about Erlang?Message passing system.No mutable data structure = No lock.No mutable data structure = Easy to parallelize.
  • 22. Applications of ErlangErlang is useful when applications are concurrent, distributed and soft-real time.It is used in telecommunication systems from Ericsson. Some other commercial applications are:Facebook uses Erlang to power the backend of its chat service, handling more than 100 million active users. Mobile arts (GSM and UMTS services) T-Mobile uses Erlang in its SMS and authentication systems.
  • 24. Challenges & SolutionsChallengesErlang can’t directly interact with hardware.Erlang can’t be converted into it’s equivalent C code.Communication latency between PC and Firebird-V.SolutionsUse C as middle-layer between Erlang and Micro-controller.Use PC as master and Firebird as slave mode.We can use small, low cost, fan-less processor and run Erlang on it.
  • 25. Case StudyAdaptive Cruise ControlRobot will follow white line while maintaining safe distance from other robots. Robot usingFireBird V (8051 micro-controller)Sensors usingWhiteline sensors(Left, Middle, Right)Front sharp sensor
  • 26. Communication ModelErlangPC Micro-controllerread_sensorSensingvalue C programActuatingTake corrective measure
  • 27. Conclusion & Future WorkPrograms in functional languages are concise and readable.Concurrency model of Erlang helps in making concurrent programs without worrying about deadlocks.We have seen the possibility of implementing robotic system using Erlang.Since concurrency is crucial in building autonomous robotics applications, Erlang can be used in building such applications.
  • 28. ReferencesJoe Armstrong “Programming Erlang”, May 2007John Hughes "Why Functional programming Matters", 1984, revised in 1989 and 1990.Francesco Cesarini and Simon Thompson, "Erlang Programming, O'Reilly, June 2009 .Philip wadler "Functional Programming in the Real World“ http://homepages.inf.ed.ac.uk/wadler/realworld/ .Video lectures by Erlang- Training Consultancy