SlideShare a Scribd company logo
ErlHive Safe Erlang Reloaded An angle on community web development Ulf Wiger, Ericsson AB
The Goal ,[object Object],[object Object],[object Object],[object Object]
The Frustration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Tuple Store ,[object Object],[object Object],[object Object],[object Object],[object Object],Authentication, etc. tuple store DB HTTP
Stored modules extend the vision Authentication, etc. erlhive DB Public code and data Private code and data Safe, web-based community web application development User A User E
Back-end Concepts ,[object Object],[object Object],[object Object]
Classes of Variable ,[object Object],[object Object],[object Object],[object Object]
Access control ,[object Object],[object Object],In the public area: Read/call Read/write/delete/call Modules Append Append/read/delete Streams Read Read/write/delete Scalars & arrays Other Users Owner
Safe code execution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Code example -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {time, calendar:universal_time()},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. Owned by user <<”ulf”>> Owned by user <<”joe”>> 1> erlhive:with_user(   <<”ulf”>>,   fun(M) ->   M:set_variable(ex3_pub, [{class, module},{area, public}]),   M:store_module(ex3_pub, ”-module(ex3_pub)....”)   end).
Code example -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {time, calendar:universal_time()},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. Package syntax for calling other users’ modules ” Meta functions” for introspection
Execution -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {time, calendar:universal_time()},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. 2> erlhive:with_user(   <<”joe”>>,   fun(M) ->   M:apply(erlhive.joe.ex3_joe, f, [])   end). [{’?MODULE’, ’erlhive.joe.ex3_joe’},  {caller, <<”joe”>>},  {from_module, ’erlhive.user’},  {owner, <<”joe”>>},  {ex3_pub, [{’?MODULE’, ’erlhive.ulf.ex3_pub’},   {time, {{2006,11,9},{16,53,17}},    {caller, <<”joe”>>},   {owner, <<”ulf”>>},   {ex3_priv, [{’?MODULE’, ’erlhive.ulf.ex3_priv’},   {caller, <<”ulf”>>},   {from_module, ’erlhive.ulf.ex3_pub’},   {owner, <<”ulf”>>}]}]}]
Execution -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. 2> erlhive:with_user(   <<”joe”>>,   fun(M) ->   M:apply(erlhive.ulf.ex3_priv, f, [])   end). ** exited: {aborted, {{undef,[{{’erlhive.ulf.ex3_priv’,   <<”joe”>>,   ’erlhive.user’}, f, 0},   {erlhive,with_watchdog,1},   ...]}, ...} Cannot call another user’s private modules. Restricted calls appear as undefs.
Profiling -module(ex3_joe). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...,   {ex3_pub,  erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   {caller,  erlhive.user:caller() },   {from_module,  erlhive.user:from_module() },   {owner,  erlhive.user:owner() },   {ex3_priv,  ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() ->   [{’?MODULE’, ?MODULE},   ...]. 2> erlhive:profile(   <<”joe”>>,   fun(M) ->   M:apply(ex3_joe, f, [])   end). { [{’?MODULE’,’erlhive.joe.ex3_joe’},   ...], [{trace,<0.403.0>,call,{erlhive_user,apply,4}},  {trace,<0.403.0>,call,{’erlhive.joe.ex3_joe’,f,1}},  {trace,<0.403.0>,call,{’erlhive.ulf.ex3_pub’,f,1}},  {trace,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}},  {trace ,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}}]} A censored call trace. Can be followed by a specific trace on ’visible’ modules. (work in progress...)
Status ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Questions?

More Related Content

Similar to ErlHive Safe Erlang Reloaded

Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
Mustafa TURAN
 
Django Good Practices
Django Good PracticesDjango Good Practices
Django Good Practices
Solution4Future
 
Unbundling the JavaScript module bundler - Road to Coderful
Unbundling the JavaScript module bundler - Road to CoderfulUnbundling the JavaScript module bundler - Road to Coderful
Unbundling the JavaScript module bundler - Road to Coderful
Luciano Mammino
 
Unbundling the JavaScript module bundler - DublinJS July 2018
Unbundling the JavaScript module bundler - DublinJS July 2018Unbundling the JavaScript module bundler - DublinJS July 2018
Unbundling the JavaScript module bundler - DublinJS July 2018
Luciano Mammino
 
Getting modular with OSGI
Getting modular with OSGIGetting modular with OSGI
Getting modular with OSGI
Andrii Krokhmalnyi
 
Global objects in Node.pdf
Global objects in Node.pdfGlobal objects in Node.pdf
Global objects in Node.pdf
SudhanshiBakre1
 
Hooks and Events in Drupal 8
Hooks and Events in Drupal 8Hooks and Events in Drupal 8
Hooks and Events in Drupal 8
Nida Ismail Shah
 
Requiring your own files.pptx
Requiring your own files.pptxRequiring your own files.pptx
Requiring your own files.pptx
Lovely Professional University
 
Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7 Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7
Dhinakaran Mani
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
Mage Guru
 
Mastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_argumentsMastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_arguments
Ruth Marvin
 
OOP in C#
OOP in C#OOP in C#
OOP in C#
DevMix
 
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptxINTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
DeepasCSE
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
Birol Efe
 
Drupal 8 Hooks
Drupal 8 HooksDrupal 8 Hooks
Java 7: Quo vadis?
Java 7: Quo vadis?Java 7: Quo vadis?
Java 7: Quo vadis?
Michal Malohlava
 

Similar to ErlHive Safe Erlang Reloaded (20)

Re-Design with Elixir/OTP
Re-Design with Elixir/OTPRe-Design with Elixir/OTP
Re-Design with Elixir/OTP
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Alfredo-PUMEX
Alfredo-PUMEXAlfredo-PUMEX
Alfredo-PUMEX
 
Django Good Practices
Django Good PracticesDjango Good Practices
Django Good Practices
 
Unbundling the JavaScript module bundler - Road to Coderful
Unbundling the JavaScript module bundler - Road to CoderfulUnbundling the JavaScript module bundler - Road to Coderful
Unbundling the JavaScript module bundler - Road to Coderful
 
Unbundling the JavaScript module bundler - DublinJS July 2018
Unbundling the JavaScript module bundler - DublinJS July 2018Unbundling the JavaScript module bundler - DublinJS July 2018
Unbundling the JavaScript module bundler - DublinJS July 2018
 
Getting modular with OSGI
Getting modular with OSGIGetting modular with OSGI
Getting modular with OSGI
 
Global objects in Node.pdf
Global objects in Node.pdfGlobal objects in Node.pdf
Global objects in Node.pdf
 
Hooks and Events in Drupal 8
Hooks and Events in Drupal 8Hooks and Events in Drupal 8
Hooks and Events in Drupal 8
 
Requiring your own files.pptx
Requiring your own files.pptxRequiring your own files.pptx
Requiring your own files.pptx
 
Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7 Introduction And Basics of Modules in Drupal 7
Introduction And Basics of Modules in Drupal 7
 
Mageguru - magento custom module development
Mageguru -  magento custom module development Mageguru -  magento custom module development
Mageguru - magento custom module development
 
Mastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_argumentsMastering Python lesson 4_functions_parameters_arguments
Mastering Python lesson 4_functions_parameters_arguments
 
OOP in C#
OOP in C#OOP in C#
OOP in C#
 
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptxINTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptx
 
Java - A broad introduction
Java - A broad introductionJava - A broad introduction
Java - A broad introduction
 
Drupal 8 Hooks
Drupal 8 HooksDrupal 8 Hooks
Drupal 8 Hooks
 
Java 7: Quo vadis?
Java 7: Quo vadis?Java 7: Quo vadis?
Java 7: Quo vadis?
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 

ErlHive Safe Erlang Reloaded

  • 1. ErlHive Safe Erlang Reloaded An angle on community web development Ulf Wiger, Ericsson AB
  • 2.
  • 3.
  • 4.
  • 5. Stored modules extend the vision Authentication, etc. erlhive DB Public code and data Private code and data Safe, web-based community web application development User A User E
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Code example -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {time, calendar:universal_time()}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. Owned by user <<”ulf”>> Owned by user <<”joe”>> 1> erlhive:with_user( <<”ulf”>>, fun(M) -> M:set_variable(ex3_pub, [{class, module},{area, public}]), M:store_module(ex3_pub, ”-module(ex3_pub)....”) end).
  • 11. Code example -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {time, calendar:universal_time()}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. Package syntax for calling other users’ modules ” Meta functions” for introspection
  • 12. Execution -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {time, calendar:universal_time()}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. 2> erlhive:with_user( <<”joe”>>, fun(M) -> M:apply(erlhive.joe.ex3_joe, f, []) end). [{’?MODULE’, ’erlhive.joe.ex3_joe’}, {caller, <<”joe”>>}, {from_module, ’erlhive.user’}, {owner, <<”joe”>>}, {ex3_pub, [{’?MODULE’, ’erlhive.ulf.ex3_pub’}, {time, {{2006,11,9},{16,53,17}}, {caller, <<”joe”>>}, {owner, <<”ulf”>>}, {ex3_priv, [{’?MODULE’, ’erlhive.ulf.ex3_priv’}, {caller, <<”ulf”>>}, {from_module, ’erlhive.ulf.ex3_pub’}, {owner, <<”ulf”>>}]}]}]
  • 13. Execution -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. 2> erlhive:with_user( <<”joe”>>, fun(M) -> M:apply(erlhive.ulf.ex3_priv, f, []) end). ** exited: {aborted, {{undef,[{{’erlhive.ulf.ex3_priv’, <<”joe”>>, ’erlhive.user’}, f, 0}, {erlhive,with_watchdog,1}, ...]}, ...} Cannot call another user’s private modules. Restricted calls appear as undefs.
  • 14. Profiling -module(ex3_joe). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ..., {ex3_pub, erlhive.ulf.ex3_pub:f() }]. -module(ex3_pub). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, {caller, erlhive.user:caller() }, {from_module, erlhive.user:from_module() }, {owner, erlhive.user:owner() }, {ex3_priv, ex3_priv:f() }]. -module(ex3_priv). -export([f/0]). f() -> [{’?MODULE’, ?MODULE}, ...]. 2> erlhive:profile( <<”joe”>>, fun(M) -> M:apply(ex3_joe, f, []) end). { [{’?MODULE’,’erlhive.joe.ex3_joe’}, ...], [{trace,<0.403.0>,call,{erlhive_user,apply,4}}, {trace,<0.403.0>,call,{’erlhive.joe.ex3_joe’,f,1}}, {trace,<0.403.0>,call,{’erlhive.ulf.ex3_pub’,f,1}}, {trace,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}}, {trace ,<0.403.0>,return_to,{’erlhive.ulf.ex3_pub’,f,1}}]} A censored call trace. Can be followed by a specific trace on ’visible’ modules. (work in progress...)
  • 15.