SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
Prolog	
  to	
  Erlang	
  

First	
  version	
  of	
  Erlang	
  was	
  wri2en	
  in	
  
                       Prolog	
  
Examples	
  
hello_mod.erl	
  
1.  -­‐module(hello_mod).	
  
2.  -­‐export([say_hello/0]).	
  

3.  say_hello()	
  -­‐>	
  
4.  	
  	
  	
  	
  io:format("Hello~n",	
  []).	
  
hello_mod:say_hello().	
  
1.  $	
  erl	
  
2.  Erlang	
  R14B04	
  (erts-­‐5.8.5)	
  [source]	
  [64-­‐bit]	
  [smp:4:4]	
  
    [rq:4]	
  [async-­‐threads:0]	
  [hipe]	
  [kernel-­‐poll:false]	
  

3.    Eshell	
  V5.8.5	
  	
  (abort	
  with	
  ^G)	
  
4.    1>	
  c(hello_mod).	
  
5.    {ok,hello_mod}	
  
6.    2>	
  hello_mod:say_hello().	
  
7.    Hello	
  
8.    ok	
  
9.    3>	
  	
  
fact_mod.erl	
  
1.  -­‐module(fact_mod).	
  
2.  -­‐export([fact/1]).	
  

3.  fact(0)	
  -­‐>	
  1;	
  
4.  fact(N)	
  -­‐>	
  N	
  *	
  fact(N	
  -­‐	
  1).	
  
fact_mod:fact(4).	
  
1.  $	
  erl	
  
2.  Erlang	
  R14B04	
  (erts-­‐5.8.5)	
  [source]	
  [64-­‐bit]	
  [smp:4:4]	
  
    [rq:4]	
  [async-­‐threads:0]	
  [hipe]	
  [kernel-­‐poll:false]	
  

3.    Eshell	
  V5.8.5	
  	
  (abort	
  with	
  ^G)	
  
4.    1>	
  c(fact_mod).	
  
5.    {ok,fact_mod}	
  
6.    2>	
  fact_mod:fact(4).	
  
7.    24	
  
8.    3>	
  	
  
qsort_mod.erl	
  
1.  -­‐module(qsort_mod).	
  
2.  -­‐export([qsort/1]).	
  

3.    qsort([])	
  -­‐>	
  
4.    	
  	
  	
  	
  [];	
  
5.    qsort([H	
  |	
  T])	
  -­‐>	
  	
  
6.    	
  	
  	
  	
  qsort([	
  X	
  ||	
  X	
  <-­‐	
  T,	
  X	
  <	
  H	
  ])	
  ++	
  	
  
7.              	
   [H]	
  ++	
  	
  
8.              	
   qsort([	
  X	
  ||	
  X	
  <-­‐	
  T,	
  X	
  >=	
  H	
  ]).	
  
qsort_mod:qsort([3,	
  2,	
  1,	
  6,	
  4,	
  5]).	
  
                      	
  
1.  $	
  erl	
  
2.  Erlang	
  R14B04	
  (erts-­‐5.8.5)	
  [source]	
  [64-­‐bit]	
  [smp:4:4]	
  
    [rq:4]	
  [async-­‐threads:0]	
  [hipe]	
  [kernel-­‐poll:false]	
  

3.    Eshell	
  V5.8.5	
  	
  (abort	
  with	
  ^G)	
  
4.    1>	
  c(qsort_mod).	
  
5.    {ok,qsort_mod}	
  
6.    2>	
  qsort:qsort([3,	
  2,	
  1,	
  6,	
  4,	
  5]).	
  
7.    [1,2,3,4,5,6]	
  
8.    3>	
  	
  
History	
  
§  1986	
  -­‐	
  Joe	
  Armstong	
  (Ericsson)	
  
   §  Prolog	
  
§  1988	
  -­‐	
  Ericsson	
  AXD301	
  ATM	
  telco	
  switch	
  
   §  1	
  million	
  lines	
  of	
  Erlang	
  
   §  99.9999999	
  
§  1995	
  -­‐	
  Open	
  Telecom	
  Plalorm	
  
§  1998	
  -­‐	
  Open	
  source	
  
§  2011	
  -­‐	
  Release	
  14B03	
  
What s	
  Erlang?	
  
Programming	
  Language	
  
§  General-­‐purpose	
  
§  Funcponal	
  	
  
   §  Like	
  LISP,	
  Haskell	
  
§  Garbage-­‐collected	
  
§  Dynamic	
  typing	
  
§  Single	
  assignment	
  
§  Erlang	
  runpme	
  system	
  
   §  STDLIB	
  
Features	
  
§  Massive	
  concurrency	
  and	
  message	
  passing	
  
     §    Actor	
  model	
  
     §    Sos-­‐real-­‐pme	
  
     §    Thousands	
  of	
  processes	
  under	
  single	
  VM	
  
     §    Short	
  GC	
  pauses	
  
§  Distributed	
  
     §  Erlang	
  nodes	
  
§  Fault-­‐tolerant	
  
     §  99.9999999%	
  
§  Powerful	
  error	
  handling	
  
     §  Supervisors	
  
     §  Recovery	
  from	
  errors	
  
§  Non-­‐stop	
  systems	
  
     §  Hot	
  code	
  swapping	
  in	
  producpon	
  
Data	
  types	
  
§  Atoms	
  
     §  open,	
  close,	
  `empty	
  
§  Integers	
  
§  Floats	
  
§  Tuples	
  
     §  {price,	
  12.34}	
  
§  Lists	
  
     §  [1,	
  2,	
  3,	
  4]	
  
§  PIDs	
  
Control	
  Structures	
  
§  Pa2ern	
  matching	
  
§  Guards	
  
§  Higher	
  order	
  funcpons	
  
§  List	
  comprehension	
  
Actors:Message	
  Passing	
  
§  Send	
  message	
  (client	
  process)	
  
   §  ServerProcessId	
  !	
  Message.	
  
§  Receiving	
  a	
  message	
  (server	
  process)	
  
   §  receive	
  
        	
  pa2ern2	
  -­‐>	
  …;	
  
        	
  pa2ern2	
  -­‐>	
  …	
  
       end.	
  
Erlang	
  VM	
  
§  Thousands	
  of	
  processes	
  under	
  single	
  VM	
  
§  Lightweight	
  processes	
  
§  Garbage	
  collecpon	
  per	
  process	
  
§  BEAM	
  files	
  
§  Napve	
  code	
  compiler	
  
Anywhere	
  
§  OS	
  /	
  Hardware	
  independent	
  
   §  UNIX/Linux	
  
   §  Windows	
  
   §  Mac	
  
   §  Embedded	
  
   §  Android	
  
Open	
  Telecom	
  Plalorm	
  

            OTP	
  
OTP	
  Design	
  Principles	
  
§  Supervision	
  trees	
  
    §  Supervisors	
  
    §  Workers	
  
§  Behaviours	
  
    §  gen_server	
  
         §  The	
  server	
  in	
  client-­‐server	
  
    §  fsm_server	
  
         §  Finite	
  state	
  machines	
  
    §  gen_event	
  
         §  Event	
  handling	
  
§  Applicapons	
  
    §  Applicapon	
  
§  Releases	
  
Web	
  Development	
  
Web	
  Development	
  
§  Web	
  Servers	
  
     §  Inets	
  
            §  Build-­‐in	
  
     §  Yaws	
  
            §  80,000	
  concurrent	
  connecpons	
  (2002)	
  
     §  MochiWeb	
  
            §  Lightweight	
  HTTP	
  
§  Web	
  Frameworks	
  
     §  ErlyWeb	
  
            §  MVC	
  for	
  Yaws	
  
     §  Erlang	
  Web	
  
            §  MVC	
  for	
  Yaws	
  and	
  Inets	
  
     §  Nitrogen	
  
            §  An	
  event-­‐driven	
  2.0	
  framework	
  (cometd)	
  
Wri2en	
  in	
  Erlang	
  
§  Apache	
  CouchDB	
  
    §  Document-­‐oriented	
  database	
  (replicapon)	
  
§  RabbitMQ	
  
    §  Message-­‐oriented	
  middleware	
  
§  Riak	
  
    §  NoSQL	
  database	
  (ring)	
  
§  Ejabberd	
  
    §  XMPP	
  applicapon	
  server	
  
Development	
  Tools	
  
§  IDEs	
  
    §  Eclipse	
  
    §  Emacs	
  +	
  Distel	
  
    §  Vim	
  
§  Tools	
  
    §  MOEBIUS	
  
         §  CI	
  Server	
  
    §  rebar	
  
         §  Build	
  and	
  packaging	
  tool	
  
Erlang	
  in	
  Producpon	
  
§  Ericsson	
  AXD301	
  telco	
  switch	
  
     §    160	
  GB/s	
  
     §    1	
  million	
  lines	
  of	
  Erlang	
  
     §    Hundreds	
  of	
  programmers	
  
     §    99.9	
  999	
  999%	
  reliability	
  
§  GPRS	
  
     §  GSM	
  cell	
  telco	
  network	
  
§  Facebook	
  Chat	
  
     §  800+	
  million	
  messages	
  /	
  day	
  
§  GitHub	
  
§  Goldman	
  Sachs	
  ???	
  
     §  High-­‐frequency	
  trading	
  
§  Deutsche	
  Bank	
  

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Twisted Introduction
Twisted IntroductionTwisted Introduction
Twisted Introduction
 
Golang Performance : microbenchmarks, profilers, and a war story
Golang Performance : microbenchmarks, profilers, and a war storyGolang Performance : microbenchmarks, profilers, and a war story
Golang Performance : microbenchmarks, profilers, and a war story
 
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
 
[En] IPVS for Docker Containers
[En] IPVS for Docker Containers[En] IPVS for Docker Containers
[En] IPVS for Docker Containers
 
Plmce2k15 15 tips galera cluster
Plmce2k15   15 tips galera clusterPlmce2k15   15 tips galera cluster
Plmce2k15 15 tips galera cluster
 
How to monitor NGINX
How to monitor NGINXHow to monitor NGINX
How to monitor NGINX
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
 
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
Mасштабирование микросервисов на Go, Matt Heath (Hailo)Mасштабирование микросервисов на Go, Matt Heath (Hailo)
Mасштабирование микросервисов на Go, Matt Heath (Hailo)
 
Altitude SF 2017: Advanced VCL: Shielding and Clustering
Altitude SF 2017: Advanced VCL: Shielding and ClusteringAltitude SF 2017: Advanced VCL: Shielding and Clustering
Altitude SF 2017: Advanced VCL: Shielding and Clustering
 
Rapid Application Design in Financial Services
Rapid Application Design in Financial ServicesRapid Application Design in Financial Services
Rapid Application Design in Financial Services
 
Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례
 
How we use Twisted in Launchpad
How we use Twisted in LaunchpadHow we use Twisted in Launchpad
How we use Twisted in Launchpad
 
Redis And python at pycon_2011
Redis And python at pycon_2011Redis And python at pycon_2011
Redis And python at pycon_2011
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consul
 
DIY Java Profiler
DIY Java ProfilerDIY Java Profiler
DIY Java Profiler
 
Advanced percona xtra db cluster in a nutshell... la suite plsc2016
Advanced percona xtra db cluster in a nutshell... la suite plsc2016Advanced percona xtra db cluster in a nutshell... la suite plsc2016
Advanced percona xtra db cluster in a nutshell... la suite plsc2016
 
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
High Availability with Galera Cluster - SkySQL Road Show 2013 in BerlinHigh Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
 
Tales Of The Black Knight - Keeping EverythingMe running
Tales Of The Black Knight - Keeping EverythingMe runningTales Of The Black Knight - Keeping EverythingMe running
Tales Of The Black Knight - Keeping EverythingMe running
 
Aaron Mildenstein - Using Logstash with Zabbix
Aaron Mildenstein - Using Logstash with ZabbixAaron Mildenstein - Using Logstash with Zabbix
Aaron Mildenstein - Using Logstash with Zabbix
 
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Clu...
 

Destacado (9)

Groovy and Grails
Groovy and GrailsGroovy and Grails
Groovy and Grails
 
Clojure Lightning Talk
Clojure Lightning TalkClojure Lightning Talk
Clojure Lightning Talk
 
Scala for the web Lightning Talk
Scala for the web Lightning TalkScala for the web Lightning Talk
Scala for the web Lightning Talk
 
CoffeeScript Lightning Talk
CoffeeScript Lightning TalkCoffeeScript Lightning Talk
CoffeeScript Lightning Talk
 
Real World Cassandra
Real World CassandraReal World Cassandra
Real World Cassandra
 
Couchdb at AMEX
Couchdb at AMEXCouchdb at AMEX
Couchdb at AMEX
 
Gotszling mogo db-membase
Gotszling mogo db-membaseGotszling mogo db-membase
Gotszling mogo db-membase
 
Riak a successful failure
Riak   a successful failureRiak   a successful failure
Riak a successful failure
 
tvOS, The Focus Engine, and Swift
tvOS, The Focus Engine, and SwifttvOS, The Focus Engine, and Swift
tvOS, The Focus Engine, and Swift
 

Similar a Erlang Lightning Talk

Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
Enkitec
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
Enkitec
 

Similar a Erlang Lightning Talk (20)

Evergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival Skills
 
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
[OpenStack Days Korea 2016] Track1 - All flash CEPH 구성 및 최적화
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
Strata Singapore: GearpumpReal time DAG-Processing with Akka at ScaleStrata Singapore: GearpumpReal time DAG-Processing with Akka at Scale
Strata Singapore: Gearpump Real time DAG-Processing with Akka at Scale
 
Rails hosting
Rails hostingRails hosting
Rails hosting
 
AsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) Hypervisor
AsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) HypervisorAsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) Hypervisor
AsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) Hypervisor
 
"How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics."How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics.
 
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
End to End Processing of 3.7 Million Telemetry Events per Second using Lambda...
 
Linked Process
Linked ProcessLinked Process
Linked Process
 
Oracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture PerformanceOracle GoldenGate Architecture Performance
Oracle GoldenGate Architecture Performance
 
Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014Next Generation DevOps in Drupal: DrupalCamp London 2014
Next Generation DevOps in Drupal: DrupalCamp London 2014
 
Netflix Global Applications - NoSQL Search Roadshow
Netflix Global Applications - NoSQL Search RoadshowNetflix Global Applications - NoSQL Search Roadshow
Netflix Global Applications - NoSQL Search Roadshow
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
 
Ingesting hdfs intosolrusingsparktrimmed
Ingesting hdfs intosolrusingsparktrimmedIngesting hdfs intosolrusingsparktrimmed
Ingesting hdfs intosolrusingsparktrimmed
 
Elixir Into Production
Elixir Into ProductionElixir Into Production
Elixir Into Production
 
Egearmand: an Erlang Gearman daemon
Egearmand: an Erlang Gearman daemonEgearmand: an Erlang Gearman daemon
Egearmand: an Erlang Gearman daemon
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
 
Going to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific LanguagesGoing to Mars with Groovy Domain-Specific Languages
Going to Mars with Groovy Domain-Specific Languages
 
De Java 8 ate Java 14
De Java 8 ate Java 14De Java 8 ate Java 14
De Java 8 ate Java 14
 
OGG Architecture Performance
OGG Architecture PerformanceOGG Architecture Performance
OGG Architecture Performance
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Erlang Lightning Talk

  • 1. Prolog  to  Erlang   First  version  of  Erlang  was  wri2en  in   Prolog  
  • 3. hello_mod.erl   1.  -­‐module(hello_mod).   2.  -­‐export([say_hello/0]).   3.  say_hello()  -­‐>   4.         io:format("Hello~n",  []).  
  • 4. hello_mod:say_hello().   1.  $  erl   2.  Erlang  R14B04  (erts-­‐5.8.5)  [source]  [64-­‐bit]  [smp:4:4]   [rq:4]  [async-­‐threads:0]  [hipe]  [kernel-­‐poll:false]   3.  Eshell  V5.8.5    (abort  with  ^G)   4.  1>  c(hello_mod).   5.  {ok,hello_mod}   6.  2>  hello_mod:say_hello().   7.  Hello   8.  ok   9.  3>    
  • 5. fact_mod.erl   1.  -­‐module(fact_mod).   2.  -­‐export([fact/1]).   3.  fact(0)  -­‐>  1;   4.  fact(N)  -­‐>  N  *  fact(N  -­‐  1).  
  • 6. fact_mod:fact(4).   1.  $  erl   2.  Erlang  R14B04  (erts-­‐5.8.5)  [source]  [64-­‐bit]  [smp:4:4]   [rq:4]  [async-­‐threads:0]  [hipe]  [kernel-­‐poll:false]   3.  Eshell  V5.8.5    (abort  with  ^G)   4.  1>  c(fact_mod).   5.  {ok,fact_mod}   6.  2>  fact_mod:fact(4).   7.  24   8.  3>    
  • 7. qsort_mod.erl   1.  -­‐module(qsort_mod).   2.  -­‐export([qsort/1]).   3.  qsort([])  -­‐>   4.         [];   5.  qsort([H  |  T])  -­‐>     6.         qsort([  X  ||  X  <-­‐  T,  X  <  H  ])  ++     7.    [H]  ++     8.    qsort([  X  ||  X  <-­‐  T,  X  >=  H  ]).  
  • 8. qsort_mod:qsort([3,  2,  1,  6,  4,  5]).     1.  $  erl   2.  Erlang  R14B04  (erts-­‐5.8.5)  [source]  [64-­‐bit]  [smp:4:4]   [rq:4]  [async-­‐threads:0]  [hipe]  [kernel-­‐poll:false]   3.  Eshell  V5.8.5    (abort  with  ^G)   4.  1>  c(qsort_mod).   5.  {ok,qsort_mod}   6.  2>  qsort:qsort([3,  2,  1,  6,  4,  5]).   7.  [1,2,3,4,5,6]   8.  3>    
  • 9. History   §  1986  -­‐  Joe  Armstong  (Ericsson)   §  Prolog   §  1988  -­‐  Ericsson  AXD301  ATM  telco  switch   §  1  million  lines  of  Erlang   §  99.9999999   §  1995  -­‐  Open  Telecom  Plalorm   §  1998  -­‐  Open  source   §  2011  -­‐  Release  14B03  
  • 11. Programming  Language   §  General-­‐purpose   §  Funcponal     §  Like  LISP,  Haskell   §  Garbage-­‐collected   §  Dynamic  typing   §  Single  assignment   §  Erlang  runpme  system   §  STDLIB  
  • 12. Features   §  Massive  concurrency  and  message  passing   §  Actor  model   §  Sos-­‐real-­‐pme   §  Thousands  of  processes  under  single  VM   §  Short  GC  pauses   §  Distributed   §  Erlang  nodes   §  Fault-­‐tolerant   §  99.9999999%   §  Powerful  error  handling   §  Supervisors   §  Recovery  from  errors   §  Non-­‐stop  systems   §  Hot  code  swapping  in  producpon  
  • 13. Data  types   §  Atoms   §  open,  close,  `empty   §  Integers   §  Floats   §  Tuples   §  {price,  12.34}   §  Lists   §  [1,  2,  3,  4]   §  PIDs  
  • 14. Control  Structures   §  Pa2ern  matching   §  Guards   §  Higher  order  funcpons   §  List  comprehension  
  • 15. Actors:Message  Passing   §  Send  message  (client  process)   §  ServerProcessId  !  Message.   §  Receiving  a  message  (server  process)   §  receive    pa2ern2  -­‐>  …;    pa2ern2  -­‐>  …   end.  
  • 16. Erlang  VM   §  Thousands  of  processes  under  single  VM   §  Lightweight  processes   §  Garbage  collecpon  per  process   §  BEAM  files   §  Napve  code  compiler  
  • 17. Anywhere   §  OS  /  Hardware  independent   §  UNIX/Linux   §  Windows   §  Mac   §  Embedded   §  Android  
  • 19. OTP  Design  Principles   §  Supervision  trees   §  Supervisors   §  Workers   §  Behaviours   §  gen_server   §  The  server  in  client-­‐server   §  fsm_server   §  Finite  state  machines   §  gen_event   §  Event  handling   §  Applicapons   §  Applicapon   §  Releases  
  • 21. Web  Development   §  Web  Servers   §  Inets   §  Build-­‐in   §  Yaws   §  80,000  concurrent  connecpons  (2002)   §  MochiWeb   §  Lightweight  HTTP   §  Web  Frameworks   §  ErlyWeb   §  MVC  for  Yaws   §  Erlang  Web   §  MVC  for  Yaws  and  Inets   §  Nitrogen   §  An  event-­‐driven  2.0  framework  (cometd)  
  • 22. Wri2en  in  Erlang   §  Apache  CouchDB   §  Document-­‐oriented  database  (replicapon)   §  RabbitMQ   §  Message-­‐oriented  middleware   §  Riak   §  NoSQL  database  (ring)   §  Ejabberd   §  XMPP  applicapon  server  
  • 23. Development  Tools   §  IDEs   §  Eclipse   §  Emacs  +  Distel   §  Vim   §  Tools   §  MOEBIUS   §  CI  Server   §  rebar   §  Build  and  packaging  tool  
  • 24. Erlang  in  Producpon   §  Ericsson  AXD301  telco  switch   §  160  GB/s   §  1  million  lines  of  Erlang   §  Hundreds  of  programmers   §  99.9  999  999%  reliability   §  GPRS   §  GSM  cell  telco  network   §  Facebook  Chat   §  800+  million  messages  /  day   §  GitHub   §  Goldman  Sachs  ???   §  High-­‐frequency  trading   §  Deutsche  Bank