SlideShare a Scribd company logo
1 of 24
Download to read offline
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

Ruby JIT Compilation
Ruby JIT CompilationRuby JIT Compilation
Ruby JIT CompilationAmoniac OÜ
 
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot RuntimesJfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot RuntimesCharlie Gracie
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdatedoscon2007
 
Os Paesdosreistutorial
Os PaesdosreistutorialOs Paesdosreistutorial
Os Paesdosreistutorialoscon2007
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using ErlangFrank Hunleth
 
LAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLinaro
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvmdeimos
 
Embedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsFrank Hunleth
 
Using Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical worldUsing Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical worldBrian Chamberlain
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Koombea
 
Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Rubydeimos
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systemssosorry
 
GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22Jorge Hidalgo
 
Java begin so we win
Java begin so we winJava begin so we win
Java begin so we winIT
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovydeimos
 
GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28Jorge Hidalgo
 

What's hot (20)

Ruby JIT Compilation
Ruby JIT CompilationRuby JIT Compilation
Ruby JIT Compilation
 
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot RuntimesJfokus 2016 - A JVMs Journey into Polyglot Runtimes
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
Where is LLVM Being Used Today?
Where is LLVM Being Used Today? Where is LLVM Being Used Today?
Where is LLVM Being Used Today?
 
Pyhug zmq
Pyhug zmqPyhug zmq
Pyhug zmq
 
Os Rego
Os RegoOs Rego
Os Rego
 
One VM to Rule Them All
One VM to Rule Them AllOne VM to Rule Them All
One VM to Rule Them All
 
Os Paesdosreistutorial
Os PaesdosreistutorialOs Paesdosreistutorial
Os Paesdosreistutorial
 
Building a Network IP Camera using Erlang
Building a Network IP Camera using ErlangBuilding a Network IP Camera using Erlang
Building a Network IP Camera using Erlang
 
LAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoT
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
Embedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBotsEmbedded Erlang, Nerves, and SumoBots
Embedded Erlang, Nerves, and SumoBots
 
Using Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical worldUsing Erlang on the RaspberryPi to interact with the physical world
Using Erlang on the RaspberryPi to interact with the physical world
 
Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?Swift for back end: A new generation of full stack languages?
Swift for back end: A new generation of full stack languages?
 
Aspect Orientated Programming in Ruby
Aspect Orientated Programming in RubyAspect Orientated Programming in Ruby
Aspect Orientated Programming in Ruby
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22
 
Java begin so we win
Java begin so we winJava begin so we win
Java begin so we win
 
Venkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In GroovyVenkat Subramaniam Building DSLs In Groovy
Venkat Subramaniam Building DSLs In Groovy
 
GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28GraalVM - JBCNConf 2019-05-28
GraalVM - JBCNConf 2019-05-28
 

Similar to MRuby for IoT Development

Android Services Skill Sprint
Android Services Skill SprintAndroid Services Skill Sprint
Android Services Skill SprintJim McKeeth
 
DESIGN West 2013 Presentation: Accelerating Android Development and Delivery
DESIGN West 2013 Presentation: Accelerating Android Development and DeliveryDESIGN West 2013 Presentation: Accelerating Android Development and Delivery
DESIGN West 2013 Presentation: Accelerating Android Development and DeliveryDavid Rosen
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildDavid Rosen
 
Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020Koan-Sin Tan
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShiftSteven Pousty
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Adam Dunkels
 
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps TipsPhonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps TipsAlex Blom
 
EKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdfEKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdfArnaud Bouchez
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraLINAGORA
 
Comparison of Programming Platforms
Comparison of Programming PlatformsComparison of Programming Platforms
Comparison of Programming PlatformsAnup Hariharan Nair
 
A call to JS Developers - Let’s stop trying to impress each other and start b...
A call to JS Developers - Let’s stop trying to impress each other and start b...A call to JS Developers - Let’s stop trying to impress each other and start b...
A call to JS Developers - Let’s stop trying to impress each other and start b...Christian Heilmann
 
Lec 01 Introduction.pptx
Lec  01 Introduction.pptxLec  01 Introduction.pptx
Lec 01 Introduction.pptxAhmadMahmood62
 

Similar to MRuby for IoT Development (20)

Stackato v3
Stackato v3Stackato v3
Stackato v3
 
Android Services Skill Sprint
Android Services Skill SprintAndroid Services Skill Sprint
Android Services Skill Sprint
 
DESIGN West 2013 Presentation: Accelerating Android Development and Delivery
DESIGN West 2013 Presentation: Accelerating Android Development and DeliveryDESIGN West 2013 Presentation: Accelerating Android Development and Delivery
DESIGN West 2013 Presentation: Accelerating Android Development and Delivery
 
Stackato v6
Stackato v6Stackato v6
Stackato v6
 
OnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform BuildOnAndroidConf 2013: Accelerating the Android Platform Build
OnAndroidConf 2013: Accelerating the Android Platform Build
 
re7olabini
re7olabinire7olabini
re7olabini
 
Stackato
StackatoStackato
Stackato
 
Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020
 
Stackato v4
Stackato v4Stackato v4
Stackato v4
 
Free Mongo on OpenShift
Free Mongo on OpenShiftFree Mongo on OpenShift
Free Mongo on OpenShift
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
 
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps TipsPhonegap Day 2016: Ember/JS & Hybrid Apps Tips
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
 
EKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdfEKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdf
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Comparison of Programming Platforms
Comparison of Programming PlatformsComparison of Programming Platforms
Comparison of Programming Platforms
 
SPDY
SPDYSPDY
SPDY
 
A call to JS Developers - Let’s stop trying to impress each other and start b...
A call to JS Developers - Let’s stop trying to impress each other and start b...A call to JS Developers - Let’s stop trying to impress each other and start b...
A call to JS Developers - Let’s stop trying to impress each other and start b...
 
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
WebRTC Summit (June 2014) - WebRTC Interoperability (and why it is important)
 
Lec 01 Introduction.pptx
Lec  01 Introduction.pptxLec  01 Introduction.pptx
Lec 01 Introduction.pptx
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

MRuby for IoT Development

  • 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