http://timyang.net/category/erlang/
In the cloud era, we need to have a better programming language that leverages multicore capabilities and distributed capabilities, and Erlang has a natural edge, so we always keep a strong focus on it.
Press: This is guest article, the contributor is Sina Weibo basic research engineer Zhao Peng City (HTTP://WEIBO.COM/IAMZPC), the following is the original text.
In the process of studying a distributed KV storage system, I was fortunate to encounter the Erlang language. Therefore, the first goal of my research work is to get a quick introduction to the Erlang language and further understand the essence of Erlang in the actual research process. In one of the few Erlang Chinese books, I chose the Erlang Programming Guide book.
First of all, I think this book is a highly recommended introduction to Erlang books. In the first chapter, confused's Erlang layman was quickly brought into the Erlang culture, where I learned about Erlang's history, features, and why Erlang was used, as well as a few Erlang cases, which have increased my interest in Erlang. The next chapter to the 11th chapter is the basic part of Erlang, from which I learned the basic data types of Erlang, sequential and concurrent programming and its process design patterns, and in the process of reading Membase Ns_server, most of the knowledge points have been fully verified. In particular, the functions of Erlang are programming ideas and process design patterns, allowing me to clearly and quickly understand the basic flow of ns_server.
Second, I think this book is a very comprehensive and in-depth overview of the Erlang Advanced Reference Manual. In my study of the process of ns_server, encountered the use of the OTP behavior package, through the behaviour keyword, I quickly positioned to the 12th chapter of the book, the 12th chapter on the principle and use of the OTP detailed introduction, let me in practice quickly clear up the idea, The convenience of Erlang in distributed and concurrent development is deeply appreciated. In the further practice, I also encountered the problem of Mnesia database, this book with a special chapter of the content of the Mnesia in detail, greatly improve my research efficiency.
In short, this book is an authoritative book of Erlang that is suitable for both introductory learning and development reference.
Although the book is so excellent, but there are some shortcomings, mainly reflected in the individual Chinese translation, including the noun and some of the translation of some sentences, it is difficult to understand, hope that the future can be re-discretionary.
CN erlounge IV Tweetssaturday, Nov 14th, by Tim |
2 Comments
Filed Under:erlang | Tags:erlang, Erlounge Preface
This article has compiled a list of tweets for the Erlounge IV erlang Hangzhou Developer Conference site, and it is recommended to first download the presentation document to http://ecug.org/agenda/to understand the context.
Twitter's advantages are small beauty, organized into a large article rather messy, only hope to give not at the scene of the reader in the reading of the speech to provide some reference information.
The @user method represents the user's Twitter ID, and some of the instructor's Twitter ID @litaocheng @eric33yu @zoomq @sj_mackenzie @qiezi @bobcui @xushiwei @houm Ingyuan @aimingoo also welcome follow to my Twitter: @xmpp
(Erlounge IV first day participants photo)
Day 1
@litaocheng "Erlang Development Practice" If you want to do Erlang specific development (rather than the so-called "architecture"), it is recommended to look at the subsequent release of the video, this is a very good tutorial. Without the wireless IP, there was no Twitter record.
@eric33yu "Erlang system tuning" began, abandoned wireless internet, began to use mobile phone, thanks to BB typing fast
Erlang process Scheduling principle try to keep one CPU busy
It's all about actual combat, like the Zebra book mentions that the process dictionary is not a good programming habit, but Yufeng encourages the process dictionary from a combat perspective, because the process dictionary performs very well.
Pattern matches the same label as possible to put together as a tuple to improve efficiency
All the nodes in the Erlang cluster need to maintain a TCP connection with each other and maintain a 90s heartbeat with each other at a very high cost.
Talk about Erlang large data don't use Tuple,array,list to save the best with ETS
Linux Systemtap to observe Program (Profiler) very useful non-intrusive no need to modify the program
Erlang should preferably be more than 256 in length when sending binary, otherwise copy is required for each piece of data, such as sending multiple downstream data on a single broadcast.
Don't put ulimit-n too high on Erlang because each handler takes about 200 bytes of overhead, even if it doesn't work.
Yufeng said that every time he did a server program, he put in 30% times to write log code to record important parameters to observe during operation
Speak Erlang for cross-language communication recommended ASN.1 (many field students also tend to protocol buffers)
The config set/get in Erlang is not suitable for independent processes to recommend ETS
Discover that most of Erlang programmer is a C + + born, with particular focus on IO efficiency, CPU utilization, multicore, context switching overhead, memory allocation/recycling, all in all, performance, and perhaps @eric33yu flicker of success
The video of the Battle of wolves is very shocking, this is not seen on the PPT 2:20 PM Nov 7th
Erlang because there is no shared variable, the use of interprocess communication with message or ETS (memory db) is a feature of language 2:22 PM 7th
The project of the Wolf campaign is dedicated to beginners practiced hand, all using basic grammar, useless what advanced features 2:38 PM Nov 7th
Now the foreigner from Hong Kong Stewart Mackenzie speaking an Erlang implementation of RESTMS, Chinese and English mingled very humorous, cause laughter bursts 3:12 PM 7th
@sj_mackenzie said he chose Erlang's story, usually by Java make $3:14 PM 7th
@sj_mackenzie explained the role of the message queue and compared some of the deficiencies of XMPP, AMQP, atompub, so he suggested using Restms 3:34 PM Nov 7th
@sj_mackenzie also interested in key value store, he recommended another Erlang based Riak, also a dynamo clone http://riak.basho.com/3:47 PM Nov 7th
@sj_mackenzie began to introduce Dynamo theory, this is not on-line PPT, so yet another Dynamo fans. 3:49 5:00pm 7th
@sj_mackenzie Introduction Riak performance, stand-alone write 18k/s, read 25k/s 3:53 PM Nov 7th
@sj_mackenzie Introduction Riak also has a link feature, just like the HTML link, but also to the foreigner to understand some of the details of the link 3:59 PM Nov 7th
@sj_mackenzie is now trustno1 speaking Cuda into, prologue is the difference between parallel and concurrent 4:27 PM Nov 7th
Trustno1 concurrent is coarse-grained Parallelism 4:33 PM Nov 7th
Trustno1 "Premature optimization is the root of all evil" translates into "premature optimization is the source of all evils" is inaccurate, premature should be said to be sloppy optimization more accurate 4:45 PM 7th
Trustno1 today continue to "let the audience do not understand" route, said that if we understand him to the leadership of the resignation, is now talking about DC level shift to signed number, and then suddenly stopped to ask everyone in front of the content there is no doubt, no one responded, then the topic continues 5:17 PM Nov 7th
Day 1, Evening
Now is @bobcui and @qiezi to share the actor Erlang process model in C + + events, using 51.com Buddy interface service to do business Scenario description 8:10 PM Nov 7th
@bobcui is introducing 51.com bottom service concurrent implementation ideas, Coroutine can switch 2 million times per second, than the context switch has a great advantage 8:27 PM Nov 7th
@bobcui after the introduction of Coroutine spawn, causing the audience to discuss some of the shortcomings of the process, such as the scheduler can not be active scheduling, no isolation, a single process problem can not be isolated like Erlang protection, Pseudo Erlang fans and pure Erlang fans launched PK 8:51 PM Nov 7th
(Illustration: Lightweight process model implemented by 51.com C + +)
Pure Erlang fan Ery Lee questioned this set of C + + Ac_actor, "This model is commercial", @bobcui urgent, "we 51.com already have more than 100 servers running this" 9:05 PM Nov 7th
@xushiwei the difference between various server programming models, Process fork, Boost ASIO, lightweight process is very similar, regardless of the OS or application to manage the scheduling, the core issue is to see which process is light enough 9:27 PM 7th
@xushiwei talk about boost ASIO shortcomings are not elegant, business code is fragmented. But lightweight process implementation is simple, natural, easy to maintain and efficient, and inevitably the direction of server programming 9:35 PM 7th
Day 2
The popular @houmingyuan talk about the stress test of the network program, the use of ERLANG/OTP's client is much simpler and more convenient than the C++/python robot (quote: Too much comfort), an Erlang process a robot, code about 1500 lines, One weeks can be done very well, including traffic monitoring support 10:42 AM Nov 8th
(Illustration: The popular Erlang connection server)
After the popular connection server/gateway, changed from C + + to Erlang, the code reduced from 7924 to 2000 lines, and state machine state and events were reduced to less than half. and pattern matching is a lot more elegant and comfortable than C + +, performance and C + +, and Erlang is written by novice, C + + is veteran 11:02 am Nov 8th
The popular Erlang connection server/gateway, 6500 Concurrent, test traffic reached 3w-4w packet/s 11:18 AM Nov 8th
Speaking of Erlang connection Server 6500 Concurrent, test traffic reached 3w-4w packet/s, a lot of questions did not find defects, but also hurt the site a lot of C + +, boost ASIO fans fragile heart 11:26 AM 8th
@eric33yu to complement Erlang memory allocation, Erlang has more than 200 ways of allocating memory, which has an incomparable advantage over the memory pools that the average student writes. In addition, most of the Erlang Daniel is C++/erlang, so the majority of C + + fans questioned are easily dismissed 11:36 AM Nov 8th
Find Erlang missing a book like effective java/c++, field engineers have a lot of similar problems 12:48 PM Nov 8th
Attend the Erlang developer conference Some records Friday, Dec 26th, by Tim |
0 Comments
Filed Under:erlang | Tags:erlounge
The Erlang Developer Conference is one of the most intimate small-scale meetings I've ever participated in, no sponsor ads, no internet access, free lunch and afternoon tea (fruit), and a free midday meal the next day. Thank Xushiwei and sponsors (Shanda, Jinshan and Opengoss), so that we can communicate in such a warm place.
On the first day there are 2 sessions on the Web game, where Jackyz's Mahjong program business logic is done with JS, "writing business logic with Erlang is too cumbersome", he said. Another is Jinshan Han To Flash-based chess program, but also the realization of an AI robot, he this demo has been in Google Code on the open source, see erl-chess.
A speech previously mentioned Chen Jie on the backend technology of the online game server, the speech was on the first day of the afternoon breakout sessions. The regret of group discussion is that it is difficult to choose. Zhou Min's mapreduce and another topic Erlang VM are very interesting to me, but I can't participate at the same time.
There are also a few relatively esoteric topic, such as TrustNo1 talk about the shortcomings of the von Neumann machine, Mryufeng inside the Erlang Vm,e2dynomo, the name is very abstruse. The audience did not have the guts to ask questions after listening.
The epilogue is the Erlang Telecom network management software application in Ery.lee, Erylee, who has developed large-scale commercial software with Erlang. He recounts his experience of moving from cumbersome Java Ee,soa to lightweight Erlang backend +ruby on rails. Ery's point of view is radical, but I am more acceptable. He mentions that the current mainstream applications are actually processing data, which is actually a data flow, but using the popular OO approach to solve the problem, the first thing you often think about is how I write a class, or what kind of design pattern I want to use. But the FP language, such as Erlang, starts with the first line of data and is really business processing, which can be done with more streamlined tasks.
I am also honored to have an XMPP jabber topic in the General Assembly, which was explored and benefited a lot from the presence of the development experts.
Archive for the ' Erlang ' Category "Erlang Programming Guide"