Upload
ken-pratt
View
1.462
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Quick overview of Erlang presented to the Vancouver Graph Database meetup on July 27, 2011.
Citation preview
Erlang
July 27, 2011
Ken Pratt
http://kenpratt.net/
Built for concurrent, distributed systems
Wednesday, July 27, 2011
The philosophy
"Erlang was designed for writingconcurrent programs that "run forever""
- Joe Armstrong
Wednesday, July 27, 2011
The philosophy
Simple language
Ultra-lightweight concurrency
No shared state
Local & remote communication via messaging
Wednesday, July 27, 2011
The language
Functional
Pattern matching
No variables! (well, they don’t vary, anyway)
Compiled to bytecode, runs on VM
Wednesday, July 27, 2011
The VM
Processes
Pre-emptive scheduler
Memory manager
Mesh networking
Wednesday, July 27, 2011
Erlang == distributed OS?
Erlang is not so much a programming language as it is a distributed Operating System.
It’s like an ant colony with thousands of ants performing all sorts of different tasks.
Erlang is to threads what garbage collection is to manual memory management -- it brings concurrent programming into the 21st century.
Wednesday, July 27, 2011
Local architecture
= light-weight process with a built-in mailbox
Wednesday, July 27, 2011
Distributed architecture
= light-weight process with a built-in mailbox
Wednesday, July 27, 2011
Interesting architectures
Having thousands of lightweight “threads” really opens up the architecture options.
The main example application on the “Erlang and OTP in Action” book is a cache using one process per cache entry!
Wednesday, July 27, 2011
Standard library
Common patterns do all the concurrency heavy lifting for you (gen_server, rpc)
Supervision trees
Hot code deployment
Wednesday, July 27, 2011
In production
Chat backend SimpleDB Orchestration ofRuby services
Routing mesh,logging system
Wednesday, July 27, 2011
Erlang + Neo4j
Erlang has graphs: http://www.erlang.org/doc/man/digraph.html
BUT, it’s no Graph DB
Wednesday, July 27, 2011
Erlang + Neo4j
Nerlo: http://github.com/nerlo/nerlo (Jinterface-based)
Cali: http://github.com/dmitriid/cali (Jinterface-based)
Both look pretty dead-in-the-water (no commits on either project in ~1 yr)
BUT, Jinterface works well, so does Mule ESB. So in the worst case you could write your Neo4j adapters in the JVM and bridge to Erlang with a biz-logic-level API.
Wednesday, July 27, 2011
Resources
Wednesday, July 27, 2011