the case for a functional internet of things...elixir (functional) version compared to ruby (oo)...

10
Till Hänisch, Baden Württemberg State University, www.tillh.de The Case for a Functional Internet of Things

Upload: others

Post on 17-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Till Hänisch, Baden Württemberg State University, www.tillh.de

The Case for a Functional Internet of Things

Page 2: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Till Hänisch, Baden Württemberg State University, www.tillh.de

The Case for a Functional Internet of Things

Page 3: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Overview of the system

Page 4: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Messages from the sensor nodes

Too many bugs !

•  Why ?• Mostly special case/error handling• Many special cases•  Complex code• Hard to test

•  Solution•  ???• Make it easier•  But how

Page 5: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Stream of messages

Sensor

Graphics

Database

File

Processing data from sensor nodes = transforming, duplicating, storing messages =applying functions to messages =functional programming

Page 6: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Shorter, simpler

ruby version

elixir version

# = comment| = non blank line{/} = open/close block

Analogue to: Ward Cunningham, Signature Survey: A Method for Browsing Unfamiliar Code

Page 7: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Typical functions

Most complex function

Page 8: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Elixir (functional) version compared to ruby (OO)

Elixir version is better in any metric, even size (50%)No bugs found till today

Page 9: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Key findings ….

•  Shorter, easier code by using a functional language

•  lower complexity

•  fewer bugs

•  Elixir is production ready

•  Functional programming might be a way to develop reliable IoT applications

Page 10: The Case for a Functional Internet of Things...Elixir (functional) version compared to ruby (OO) Elixir version is better in any metric, even size (50%) No bugs found till today. Key

Why is (low) complexity important

•  Complexity leads to bugs

•  Bugs reduce security

•  Availability

•  Integrity/Confidentiality

•  Internet of Things is

•  embedded, hard to patch

•  open, easy to access

Zero defect software is needed for the IoT���No general solution ! PROBLEM !