没有合适的资源?快使用搜索试试~ 我知道了~
首页Erlang与Opt实战:代码实例与进阶指南
Erlang与Opt实战:代码实例与进阶指南
![](https://csdnimg.cn/release/wenkucmsfe/public/img/star.98a08eaa.png)
《Erlang与OTP实战》是一本深入讲解Erlang编程语言及其开放电信平台(Open Telecom Platform, OTP)的实践指南。这本书由经验丰富的作者团队如Martin Logan、Eric Merritt和Richard Carlsson共同编著,专为那些已经具备Erlang基础知识但希望获得实际项目应用案例的学生和开发者设计。Erlang是一种强大的并发、分布式的函数式编程语言,因其在高并发、容错性和实时系统中的出色表现而闻名。OTP则为其提供了丰富的框架和工具,使得构建高效、可靠的分布式应用程序变得简单。 本书内容涵盖了从基础概念到高级技术的全方位介绍,包括但不限于进程管理、消息传递、错误处理、模块化设计、并发控制和分布式计算等方面。通过书中提供的实例,读者将有机会看到如何在实际场景中运用Erlang进行系统设计和编程,比如处理复杂的网络通信、实时数据处理或构建高性能的服务端应用。 书中的每个章节都围绕着实际项目的开发流程展开,让读者能够边学边做,快速提升自己的实战能力。此外,它还适合那些希望通过学习Erlang和OTP来应对现代分布式系统挑战的专业人士,例如云计算、物联网和微服务架构的开发者。 作者们不仅分享了他们的专业知识,还提供了宝贵的经验教训和最佳实践,帮助读者避免常见陷阱并优化代码性能。同时,Manning出版社的在线资源和折扣政策也为读者提供了进一步学习的支持。 《Erlang与OTP实战》是一本极具价值的参考资料,无论是初学者还是有经验的Erlang开发者,都能从中收获实用的知识和技能,从而在IT行业中更好地利用Erlang这一强大工具。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/4772155/bg10.jpg)
CONTENTS
xv
12
Integrating with foreign code using ports and NIFs 291
12.1 Ports and NIFs 292
Plain ports 294
■
Linked-in port drivers 295
Natively implemented functions (NIFs) 295
12.2 Integrating with the parser through a port 296
The Erlang side of the port 297
■
The C side of the
port 300
■
Compiling and running the code 312
12.3 Making a linked-in driver 313
Understanding linked-in drivers 313
■
The C side of
the driver 315
■
Compiling the driver code 320
The Erlang side of the driver 321
12.4 Implementing the parser as a NIF 322
The Erlang side of the NIF 322
■
The C side of
the NIF 323
■
Compiling and running the code 330
12.5 Summary 331
13
Communication between Erlang and Java via Jinterface 332
13.1 Integrating Erlang with Java using Jinterface 334
The OtpNode class 334
■
The OtpMbox class 334
Mapping Erlang data structures onto Java 335
Message-handling example in Java 337
■
Talking to
the Java node from Erlang 339
13.2 Installing and configuring HBase 340
Downloading and installing 340
■
Configuring HBase 341
13.3 Building the bridge between Simple Cache
and HBase 342
The Erlang side: sc_hbase.erl 342
The HBaseConnector class 344
■
Java message
handling 346
■
The HBaseTask class 349
13.4 Integrating HBase with Simple Cache 351
Lookup 352
■
Insert 352
■
Delete 353
13.5 Running the integrated system 353
13.6 Summary 356
![](https://csdnimg.cn/release/download_crawler_static/4772155/bg11.jpg)
CONTENTS
xvi
14
Optimization and performance 357
14.1 How to approach performance tuning 358
Determining your performance goals 358
■
Establishing a
baseline 359
■
Profiling the system 359
■
Decide which
problems to attack 360
■
Measure the results 360
14.2 Profiling Erlang code 360
Counting calls with cprof 361
■
Profiling execution
time with fprof 363
14.3 Erlang programming language caveats 368
Performance aspects of the primitive data types 369
Performance of built-in functions and operators 373
Functions 374
■
Processes 376
14.4 Summary 378
appendix A Installing Erlang 379
appendix B Lists and referential transparency 381
index 383
![](https://csdnimg.cn/release/download_crawler_static/4772155/bg12.jpg)
xvii
foreword
For a long time, the world of Erlang programming had only one book—The Book,
1
released in 1993 and revised in 1996. Fanatics can still find it in print, at a price of
over $100. A decade or so after its publication, The Book was getting long in the
tooth, to say the least. The language had evolved to include several new and powerful
programming constructs. Higher-order functions, list comprehensions, and the bit
syntax are found everywhere in modern Erlang programs but weren’t described in
The Book. But the most notable omission was the Open Telecom Platform (
OTP),
Erlang’s application development framework, which was first released in 1996. Erlang
was rather easy to learn;
OTP wasn’t, and early adopters like Martin Logan, who
started using Erlang in 1999, pretty much had to learn it the hard way through trial
and error.
In the past few years, as an indication that Erlang had become interesting enough
to justify it, a number of books was released, and we were told that other books were
being written. Erlang and
OTP in Action by Martin Logan, Eric Merritt, and Richard
Carlsson was the one most talked about. And now it is here.
I started programming Erlang in 1993, when I was designing disaster response sys-
tems in Anchorage, Alaska. I bought a precompiled version of Erlang for
HP-UX, deliv-
ered on a magnetic
QIC tape. The language was smaller back then, as were the
number of support libraries. I had to start designing my own data-access structures,
1
Robert Virding, Claes Wikstrom, and Mike Williams, Concurrent Programming in Erlang (Prentice Hall,
1993, 1996).
![](https://csdnimg.cn/release/download_crawler_static/4772155/bg13.jpg)
FOREWORD
xviii
database managers, protocol parsers, and error-handling frameworks—but I enjoyed
myself thoroughly. After all, this was a different time: the web was emerging with the
release of the Mosaic browser that same year, and the term open source wouldn’t be
used for another five years; if you wanted a programming framework with support for
distributed computing and fault tolerance, you had to be prepared to pay dearly, both
in time and money. I had scoured the market for such tools and felt well-informed
about the commercial alternatives. Erlang was raw and unassuming, with a weird-
looking syntax and practically no documentation, but its core concepts felt right in a
way that no other tools had.
Three years later, I found myself in Sweden, working for Ericsson and chief
designer of the largest Erlang-based project to date. We would build what is known as
a telecom-class
ATM switch using Erlang, as well as a new framework called the Open
Telecom Platform. The name was intended to make decision makers in the company
feel warm and fuzzy—Telecom was our core business, Open was the buzzword of the day,
and the prevailing wisdom was that if you wanted to build a robust complex product,
you had to have a Platform that provided things like redundancy, support for remote
configuration, live software upgrade, and real-time tracing and debugging.
Ericsson isn’t in the business of selling development tools, but it has designed pro-
gramming languages by necessity since the early 1970s. To its credit (but also to its
own benefit), Ericsson released Erlang/
OTP as open source in 1998. Enthusiasts
across the world picked it up and used it, mainly in the telecom field at first, but later
also in other areas. We made several attempts in the ’90s to pitch Erlang to web devel-
opers, but the challenge facing web developers back then wasn’t how to make redun-
dant, scalable, and highly responsive e-commerce sites; the time for such systems
hadn’t yet come, nor had the time when concurrency would be a conversation topic
for mainstream programmers. Concurrency was hard—everyone knew that. Concur-
rency was something to be avoided. Why, then, choose a programming language
where you could hardly even write “hello world” without introducing concurrency?
The explosive growth of the web and the emergence of increasingly interactive
web applications eventually brought Erlang in from the cold. Unexpected help also
came from the laws of physics, which finally made it impossible to keep cranking up
the clock frequency on our
CPUs to produce faster and faster single-core chips. The
message “The free lunch is over” from the hardware vendors, urging developers to
start learning how to make their programs scale across many weaker cores rather than
one very fast
CPU, was wonderful news for Erlang. This meant many clever program-
mers would at least look at Erlang, to figure out what supposedly made it so special.
Many would simply look, and others would borrow concepts and implement them in
their favorite language. This was wonderful too, because it meant the market value of
knowing and loving Erlang and the principles behind it would increase rapidly.
OTP has by now been proven in several problem domains other than telecom and
is highly regarded by those who have learned to master it. Erlang/
OTP is an amazingly
powerful platform, but it does take time to learn, not least when you try to apply it to a
![](https://csdnimg.cn/release/download_crawler_static/4772155/bg14.jpg)
FOREWORD
xix
new niche. Interestingly, even programmers who have worked for years in OTP-based
projects may be fairly ignorant of how to build an
OTP-based system from scratch,
because the application programmer is exposed only to a fairly small part of the total
framework. This is exactly what you want in a large project, but the entrepreneur in a
small startup can’t rely on someone else burning the midnight oil and figuring out the
subtleties of
OTP release-handling and other dark corners without helpful examples
and tutorials.
A good book on
OTP has been sorely needed, and it’s with great pleasure that we
welcome Erlang and
OTP in Action. Martin Logan, Eric Merritt, and Richard Carlsson
represent an enormous amount of experience combined, and they have contributed
greatly to the Erlang community. I’m convinced that this book will help boost the
already impressive trend of Erlang adoption.
Enjoy!
U
LF WIGER
CTO, ERLANG SOLUTIONS LTD
剩余430页未读,继续阅读
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/77339af942994ded8a9ddf42fa57459e_maclaren001.jpg!1)
maclaren001
- 粉丝: 11
- 资源: 30
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- Hadoop生态系统与MapReduce详解
- MDS系列三相整流桥模块技术规格与特性
- MFC编程:指针与句柄获取全面解析
- LM06:多模4G高速数据模块,支持GSM至TD-LTE
- 使用Gradle与Nexus构建私有仓库
- JAVA编程规范指南:命名规则与文件样式
- EMC VNX5500 存储系统日常维护指南
- 大数据驱动的互联网用户体验深度管理策略
- 改进型Booth算法:32位浮点阵列乘法器的高速设计与算法比较
- H3CNE网络认证重点知识整理
- Linux环境下MongoDB的详细安装教程
- 压缩文法的等价变换与多余规则删除
- BRMS入门指南:JBOSS安装与基础操作详解
- Win7环境下Android开发环境配置全攻略
- SHT10 C语言程序与LCD1602显示实例及精度校准
- 反垃圾邮件技术:现状与前景
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)