SlideShare a Scribd company logo
It's a Jungle Out There
Matúš Tomlein
PhD Fellow at Aarhus University
@matus_tomlein
Aarhus.rb meetup, 5.1.2015
The Internet of Things Is
• A buzzword
• Connecting every-day devices to the Internet
• Washing machines, doors, shoes, ...
Charts From Every Talk About IoT
The Old Internet
twitter.com spotify.com
Clients
Servers
POST /tweet GET /songs/next
The New Internet
twitter.com
Clients
Servers
POST /tweet
FE80::0202:B3FF
:FE1E:8329
GET /fuel POST /activate
AB78::1378:F3B
B:FE1E:8329
GET /status
Well, actually...
twitter.com
Clients
Servers
POST /tweet
FE80::0202:B3FF
:FE1E:8329
GET /fuel POST /lamps/12/activate
AB78::1378:F3B
B:FE1E:8329
GET /status
What is the development
for the IoT like?
We, Web developers, Are Spoiled
• Deploying/updating our apps is easy
• Only have to care about a few of servers in the production
• We can always SSH into a server and see what's wrong
• Our servers run in the comfort of the cloud
• Testing/debugging also easy
• We have all the computing power we want
• We can use any technology we want
Meanwhile on Embedded Devices
• Deploying/updating is a nightmare
• There can be dozens/thousands of embedded systems running your app
• Little power, sometimes constrained battery life
• Testing/debugging on the device takes effort
• You have no control of the environment they are in
• The added trouble of communication with and between devices
• Security...
• You are stuck with C, C++, maybe Java (unless you run on Unix)
At least the last point
is not true
MRuby
• Another interpreter for Ruby
• The other ones won't run without OS or on RTOS
• Also a compiler and VM
• Very lightweight (<128kb)
• Compatible with Ruby 1.9 syntax
• Runs on anything that can run C
MRuby is Lightweight
• Only platform independent functionality
• Everything else is a gem (mrbgem)
• e.g. IO, threads, require
mrbgems
• Defined in build_config.rb
• Can be:
• Pure Ruby – Defines the extension class in Ruby
• Pure C – Builds the class in C
• C and Ruby – Defines some methods in C and
some in Ruby
MRuby is Embeddable
• Can be run inside other applications
• Great for scripting, configuration
*.rb
/usr/bin/ruby
C/C++ app
*.rb
bytecode
libmruby.a
Source: http://www.slideshare.net/yamanekko/rubyconf2013?qid=dd845db4-dda5-44a5-81c3-0fa63ca520f2&v=qf1&b=&from_search=8
4 Ways to Run MRuby
1. Interpreted
2. Interactive shell
3. Bytecode
4. Generating C code
Source: http://blog.mruby.sh/201207020720.html
Interpreted
• Just like any other Ruby app
$ mruby hello_world.rb
Hello World
• Good for testing
• Overhead
Interactive Shell
• Just like irb
$ mirb
mirb - Embeddable Interactive Ruby Shell
> puts "Hello"
Hello
=> nil
Bytecode
$ mrbc hello_world.rb
• Will produce platform independent bytecode in
hello_world.mrb
$ mruby -b hello_world.mrb
Hello World
• Will run the bytecode in a VM
• Less overhead – no parsing
• Still need the mruby program to run it
Generating C Code
• Integrate Ruby code in a C application
• Generates C files containing the Ruby code
• A standalone app – without any requirements
• The user doesn't see the source code
Performance
• Performance of C compared to MRuby is about

100 : 1
• Probably slower than the latest Ruby
But That's OK
• There is a trend in IoT:
• Dumb devices that only provide resources/
services
• Most of the application logic in the cloud
• MRuby fits this use case well despite performance
issues
• Besides it's very young and will improve
One Less Issue
• Deploying/updating is a nightmare
• There can be dozens/thousands of embedded systems running your app
• Little power, sometimes constrained battery life
• Testing/debugging on the device takes effort
• You have no control of the environment they are in
• The added trouble of communication with and between devices
• Security...
• You are stuck with C, C++, maybe Java (unless you run on Unix)
So, now we have the
MRuby, we just need the
MRuby on Rails
My PhD Project
• A platform/framework for deploying apps to embedded devices
• Define some conventions and architecture
• App Store like software ecosystem
• Secure environment for apps
• Open interfaces and communication
• I'm just starting my PhD
• Any feedback is very appreciated

More Related Content

What's hot (20)

PPTX
Ruby JIT Compilation
Amoniac OÜ
 
PPTX
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Charlie Gracie
 
ODP
Os Grossupdated
oscon2007
 
PDF
Where is LLVM Being Used Today?
Samsung Open Source Group
 
PPTX
Pyhug zmq
芳本 林
 
PDF
Os Rego
oscon2007
 
PPTX
One VM to Rule Them All
Tianxiang Xiong
 
PDF
Os Paesdosreistutorial
oscon2007
 
PDF
Building a Network IP Camera using Erlang
Frank Hunleth
 
PDF
LAS16-108: JerryScript and other scripting languages for IoT
Linaro
 
PDF
Ola Bini J Ruby Power On The Jvm
deimos
 
PDF
Embedded Erlang, Nerves, and SumoBots
Frank Hunleth
 
PDF
Using Erlang on the RaspberryPi to interact with the physical world
Brian Chamberlain
 
PDF
Swift for back end: A new generation of full stack languages?
Koombea
 
PDF
Aspect Orientated Programming in Ruby
deimos
 
PDF
(phpconftw2012) PHP as a Middleware in Embedded Systems
sosorry
 
PDF
GraalVM - MadridJUG 2019-10-22
Jorge Hidalgo
 
PPT
Java begin so we win
IT
 
PDF
Venkat Subramaniam Building DSLs In Groovy
deimos
 
PDF
GraalVM - JBCNConf 2019-05-28
Jorge Hidalgo
 
Ruby JIT Compilation
Amoniac OÜ
 
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Charlie Gracie
 
Os Grossupdated
oscon2007
 
Where is LLVM Being Used Today?
Samsung Open Source Group
 
Pyhug zmq
芳本 林
 
Os Rego
oscon2007
 
One VM to Rule Them All
Tianxiang Xiong
 
Os Paesdosreistutorial
oscon2007
 
Building a Network IP Camera using Erlang
Frank Hunleth
 
LAS16-108: JerryScript and other scripting languages for IoT
Linaro
 
Ola Bini J Ruby Power On The Jvm
deimos
 
Embedded Erlang, Nerves, and SumoBots
Frank Hunleth
 
Using Erlang on the RaspberryPi to interact with the physical world
Brian Chamberlain
 
Swift for back end: A new generation of full stack languages?
Koombea
 
Aspect Orientated Programming in Ruby
deimos
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
sosorry
 
GraalVM - MadridJUG 2019-10-22
Jorge Hidalgo
 
Java begin so we win
IT
 
Venkat Subramaniam Building DSLs In Groovy
deimos
 
GraalVM - JBCNConf 2019-05-28
Jorge Hidalgo
 

Similar to It's a Jungle Out There – IoT and MRuby (20)

PDF
Stackato v3
Jonas Brømsø
 
PDF
Android Services Skill Sprint
Jim McKeeth
 
PPTX
DESIGN West 2013 Presentation: Accelerating Android Development and Delivery
David Rosen
 
PDF
Stackato v6
Jonas Brømsø
 
PPTX
OnAndroidConf 2013: Accelerating the Android Platform Build
David Rosen
 
PDF
re7olabini
guest6850dd
 
PDF
Stackato
Jonas Brømsø
 
PDF
Running TFLite on Your Mobile Devices, 2020
Koan-Sin Tan
 
PDF
Stackato v4
Jonas Brømsø
 
PPTX
Free Mongo on OpenShift
Steven Pousty
 
PPTX
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Adam Dunkels
 
PPTX
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Alex Blom
 
PDF
EKON27-FrameworksExpressiveness.pdf
Arnaud Bouchez
 
PDF
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
PDF
Stackato v5
Jonas Brømsø
 
PPTX
Comparison of Programming Platforms
Anup Hariharan Nair
 
PDF
A call to JS Developers - Let’s stop trying to impress each other and start b...
Christian Heilmann
 
PPTX
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
Crocodile WebRTC SDK and Cloud Signalling Network
 
PPTX
Lec 01 Introduction.pptx
AhmadMahmood62
 
Stackato v3
Jonas Brømsø
 
Android Services Skill Sprint
Jim McKeeth
 
DESIGN West 2013 Presentation: Accelerating Android Development and Delivery
David Rosen
 
Stackato v6
Jonas Brømsø
 
OnAndroidConf 2013: Accelerating the Android Platform Build
David Rosen
 
re7olabini
guest6850dd
 
Stackato
Jonas Brømsø
 
Running TFLite on Your Mobile Devices, 2020
Koan-Sin Tan
 
Stackato v4
Jonas Brømsø
 
Free Mongo on OpenShift
Steven Pousty
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Adam Dunkels
 
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Alex Blom
 
EKON27-FrameworksExpressiveness.pdf
Arnaud Bouchez
 
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
Stackato v5
Jonas Brømsø
 
Comparison of Programming Platforms
Anup Hariharan Nair
 
A call to JS Developers - Let’s stop trying to impress each other and start b...
Christian Heilmann
 
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
Crocodile WebRTC SDK and Cloud Signalling Network
 
Lec 01 Introduction.pptx
AhmadMahmood62
 
Ad

Recently uploaded (20)

PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PDF
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Sound the Alarm: Detection and Response
VICTOR MAESTRE RAMIREZ
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
Introducing and Operating FME Flow for Kubernetes in a Large Enterprise: Expe...
Safe Software
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Draugnet: Anonymous Threat Reporting for a World on Fire
treyka
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Wondershare Filmora Crack Free Download 2025
josanj305
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Sound the Alarm: Detection and Response
VICTOR MAESTRE RAMIREZ
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
Introducing and Operating FME Flow for Kubernetes in a Large Enterprise: Expe...
Safe Software
 
Ad

It's a Jungle Out There – IoT and MRuby

  • 1. It's a Jungle Out There Matúš Tomlein PhD Fellow at Aarhus University @matus_tomlein Aarhus.rb meetup, 5.1.2015
  • 2. The Internet of Things Is • A buzzword • Connecting every-day devices to the Internet • Washing machines, doors, shoes, ...
  • 3. Charts From Every Talk About IoT
  • 4. The Old Internet twitter.com spotify.com Clients Servers POST /tweet GET /songs/next
  • 5. The New Internet twitter.com Clients Servers POST /tweet FE80::0202:B3FF :FE1E:8329 GET /fuel POST /activate AB78::1378:F3B B:FE1E:8329 GET /status
  • 6. Well, actually... twitter.com Clients Servers POST /tweet FE80::0202:B3FF :FE1E:8329 GET /fuel POST /lamps/12/activate AB78::1378:F3B B:FE1E:8329 GET /status
  • 7. What is the development for the IoT like?
  • 8. We, Web developers, Are Spoiled • Deploying/updating our apps is easy • Only have to care about a few of servers in the production • We can always SSH into a server and see what's wrong • Our servers run in the comfort of the cloud • Testing/debugging also easy • We have all the computing power we want • We can use any technology we want
  • 9. Meanwhile on Embedded Devices • Deploying/updating is a nightmare • There can be dozens/thousands of embedded systems running your app • Little power, sometimes constrained battery life • Testing/debugging on the device takes effort • You have no control of the environment they are in • The added trouble of communication with and between devices • Security... • You are stuck with C, C++, maybe Java (unless you run on Unix)
  • 10. At least the last point is not true
  • 11. MRuby • Another interpreter for Ruby • The other ones won't run without OS or on RTOS • Also a compiler and VM • Very lightweight (<128kb) • Compatible with Ruby 1.9 syntax • Runs on anything that can run C
  • 12. MRuby is Lightweight • Only platform independent functionality • Everything else is a gem (mrbgem) • e.g. IO, threads, require
  • 13. mrbgems • Defined in build_config.rb • Can be: • Pure Ruby – Defines the extension class in Ruby • Pure C – Builds the class in C • C and Ruby – Defines some methods in C and some in Ruby
  • 14. MRuby is Embeddable • Can be run inside other applications • Great for scripting, configuration *.rb /usr/bin/ruby C/C++ app *.rb bytecode libmruby.a Source: http://www.slideshare.net/yamanekko/rubyconf2013?qid=dd845db4-dda5-44a5-81c3-0fa63ca520f2&v=qf1&b=&from_search=8
  • 15. 4 Ways to Run MRuby 1. Interpreted 2. Interactive shell 3. Bytecode 4. Generating C code Source: http://blog.mruby.sh/201207020720.html
  • 16. Interpreted • Just like any other Ruby app $ mruby hello_world.rb Hello World • Good for testing • Overhead
  • 17. Interactive Shell • Just like irb $ mirb mirb - Embeddable Interactive Ruby Shell > puts "Hello" Hello => nil
  • 18. Bytecode $ mrbc hello_world.rb • Will produce platform independent bytecode in hello_world.mrb $ mruby -b hello_world.mrb Hello World • Will run the bytecode in a VM • Less overhead – no parsing • Still need the mruby program to run it
  • 19. Generating C Code • Integrate Ruby code in a C application • Generates C files containing the Ruby code • A standalone app – without any requirements • The user doesn't see the source code
  • 20. Performance • Performance of C compared to MRuby is about
 100 : 1 • Probably slower than the latest Ruby
  • 21. But That's OK • There is a trend in IoT: • Dumb devices that only provide resources/ services • Most of the application logic in the cloud • MRuby fits this use case well despite performance issues • Besides it's very young and will improve
  • 22. One Less Issue • Deploying/updating is a nightmare • There can be dozens/thousands of embedded systems running your app • Little power, sometimes constrained battery life • Testing/debugging on the device takes effort • You have no control of the environment they are in • The added trouble of communication with and between devices • Security... • You are stuck with C, C++, maybe Java (unless you run on Unix)
  • 23. So, now we have the MRuby, we just need the MRuby on Rails
  • 24. My PhD Project • A platform/framework for deploying apps to embedded devices • Define some conventions and architecture • App Store like software ecosystem • Secure environment for apps • Open interfaces and communication • I'm just starting my PhD • Any feedback is very appreciated