Erlang-China

erlang 中文社区

[译]What’s all this fuss about Erlang


作者:Joe Armstrong
原文:What’s all this fuss about Erlang
译者:朱照远(Joshua Zhu) 许式伟(XuShiWei)

朱照远和许式伟同学我们都很熟悉,这一次,他们给大家带来了《三言两语话Erlang》(个人感觉,这个中文译名抓住了原文的精髓啊),这是 Joe Armstong 在 pragprog 上的文章。在这一篇中,对于那些初次接触 Erlang 的读者, Joe “三言两语”就把 Erlang 这个 Fuss 给说了个明明白白清清楚楚。

实际上,当我们头一次从“并发、容错、分布、负载”这些“链接”点到 Erlang 的某一个网页里时,从来也没有想过这个语言竟然可以如此的简单。对我来说,在半信半疑之间做完 Getting Started 教程时,我还在想:“怎么就没了?这么简单,怎么可能?”。是啊,我们从来都是被这些大词给吓大的嘛,专门用来解决那些难题的语言竟然会这么简单,这个现实确实让人难以接受。

而 Joe 的这篇文章就是专门来讲“这是怎么成为可能的”——我们从来就没有想过“编程思想”有局限的可能。

让我们对 朱照远(Joshua Zhu) 和 许式伟(XuShiWei) 向 erlang 中文社区作出的贡献表示感谢!

老规矩,在线版和 PDF 版一起放送。


[blah] Amazon SimpleDB and CouchDB


正所谓,无巧不成书。这边厢刚八卦完 CouchDB ,那边立马就传出了 SimpleDB 的消息,这年头,貌似随随便便就能捣鼓捣鼓搞个 DB 出来,而且,貌似就算你想低调的搞个 DB 也有可能一不留神被推到风口浪尖上演一回某个大人物。

Amazon 刚刚宣布了它 SimpleDB 的 Limited Beta 计划,与 E2C 等等一起,这毫无疑问是意味着 Amazon 朝着 “云计算” 目标的步步逼近。它和 IBM 之流打着的如意算盘就是 “买机时挣钱” ,商业模式非常强啊(直逼学校看机房的老大爷)。先来看看 features :

* Simple to use
Amazon SimpleDB provides streamlined access to the lookup and query functions that traditionally are achieved using a relational database cluster - while leaving out other complex, often-unused database operations. The service allows you to quickly add data and easily retrieve or edit that data through a simple set of API calls. Accessing these capabilities through a web service also eliminates the complexity of maintaining and scaling these operations.

* Flexible
With Amazon SimpleDB, it is not necessary to pre-define all of the data formats you will need to store; simply add new attributes to your Amazon SimpleDB data set when needed, and the system will automatically index your data accordingly. The ability to store structured data without first defining a schema provides developers with greater flexibility when building applications.

* Scalable
Amazon SimpleDB allows you to easily scale your application. You can quickly create new domains as your data grows or your request throughput increases. For the Beta release, a single domain is limited in size to 10 GB and you are limited to a maximum of 100 domains; however, over time these limits may be raised.

* Fast
Amazon SimpleDB provides quick, efficient storage and retrieval of your data to support high performance web applications.

* Reliable
The service runs within Amazon’s high-availability data centers to provide strong and consistent performance. To prevent data from being lost or becoming unavailable, your fully indexed data is stored redundantly across multiple servers and data centers.

* Designed for use with other Amazon Web Services
Amazon SimpleDB is designed to integrate easily with other web-scale services such as Amazon EC2 and Amazon S3. For example, developers can run their applications in Amazon EC2 and store their data objects in Amazon S3. Amazon SimpleDB can then be used to query the object metadata from within the application in Amazon EC2 and return pointers to the objects stored in Amazon S3.

* Inexpensive
Amazon SimpleDB passes on to you the financial benefits of Amazon’s scale. You pay only for resources you actually consume. Compare this with the significant up-front expenditures traditionally required to obtain software licenses and purchase and maintain hardware, either in-house or hosted. This frees you from many of the complexities of capacity planning, transforms large capital expenditures into much smaller operating costs, and eliminates the need to over-buy “safety net” capacity to handle periodic traffic spikes.

都是技术人员,这篇说了等于没说的新闻稿就先撂这儿吧,捞干的,下面这些才是真家伙:


Introducing… CouchDB!


pi1ot 同学提了一个问题:

javaeye上看到的“用Erlang开发的文档数据库系统CouchDB”是个什么东西,啥叫文档数据库啊

这是一个好问题,因为我也老见到这个名字,但总不知其所以然,因此,特地作了一下 research ,将我了解到的,与诸君共享。


About “Ror vs ErlyWeb perfomance”


Yariv发布了ErlyWeb vs. Ruby on Rails EC2 Performance Showdown,作为一个相当简单的测试 ErlyWeb 毫无悬念的超过 Ror 在几乎所有的性能指标上以明显的优势胜出。

这个测试尚有一些争议。首先 Ror 并没有运行在“广为流行的优化部署模式下”,也就是并没有以多 Mongrel 实例的优化方式来部署 Ror ,并不能让 R 粉折服。其次,如此简单的测试用例,所能测到的也仅仅是 web 框架的“工具集”部分,其价值也就大打折扣。

姑且不论测试数据如何评价,仅就数字而言,老实说,比我的预期是要低的。要知道,在 web 框架这一领域,开发效率无疑是最为重要的指标,其次就是人员因素。也就是说,即便你的性能比我快上 10 倍,如果我的开发效率比你高,程序员也好找,那也不能撼动我的选择。

在这些“决策敏感问题上”,和 Ror 相比,Erlyweb 的优势显然并不明显。首先 Erlang 的“晦涩语法”会吓到小朋友,其次还有“跟着 Ror 学”的背景(既然要学,为啥不学原版?)。换作我是项目开发的决策人,就为这区区 6 x 不到的性能,也决不会轻易就甘冒风险的跳到 Erlyweb 小船上来。那么, Erlyweb 还有机会么?


[blah]New Trends–Use Your GPUs


erlang 的 maillist 最近很热闹。有“R12 发布”,“Erlang vs Clojure”这些重磅,还有一些有意思的小信息,比如,这则小的 Erlang for GPUs 讨论。

Are there any Erlang Compilers that generate code for
upcoming GPUs from Nvidia and ATI?

GPU?why not?现代 GPU 的能力已经可以用恐怖来形容(有人记得一度被认为是神奇的 voodoo 显卡么,忘记它吧,放到现在,它连个零头都算不上了)。渲染极复杂的游戏场景,在每秒几百万个多边形的负载之下,仍能保持高达几百 fps 的刷新率,这就是目前业界主流显卡的运算能力,重点是还很便宜,几百块搞定,因而装机率极高。但这样强大的计算能力每天中的大部分时间,都在我们的机器上沉睡。这毫无疑问是一种浪费。

因为我最近换到了 ubuntu 上工作,狂装软件中,恰好,也留意到了其他领域中几个有意思的软件,如:Pictomio / Pixelmator / Gliv / KIPI plugin / Lowfat Viewer 这是一组图形图像相关的软件/包,他们的共同点是——他们都利用了显卡的硬件加速能力,因而获得了令人印象深刻的效果,占用资源少,而且快如闪电。无独有偶,mozilla 也宣布了它将在 firefox 3/4 版本中采用的 Cairo 引擎——使用 GPU 来渲染网页。还有 ubuntu 的 composite 3d 桌面——使用 GPU 来显示界面。

那么,使用 GPU 来加速运算呢?很吸引的想法啊,不是么?列表提及了一个在 2000 年 EUC 上做的 presentation ,看来早已经有人做过这件有趣的事情了,只是没有 open 出来,有兴趣的可以看看。


Erlang R12B-0 released


Major relese    : otp_src_R12B-0
Build date      : 2007-12-04

R12B-0 is a major new release of Erlang/OTP.
You can download the full source distribution from
 
  http://www.erlang.org/download/otp_src_R12B-0.tar.gz
  http://www.erlang.org/download/otp_src_R12B-0.readme (this file)

Note: To unpack the TAR archive you need a GNU TAR compatible program.

For installation instructions please read the README that is part of
the distribution.

The Windows binary distribution can be downloaded from

  http://www.erlang.org/download/otp_win32_R12B-0.exe
On-line documentation can be found at http://www.erlang.org/doc/.
You can also download the complete HTML documentation or the Unix manual files

  http://www.erlang.org/download/otp_doc_html_R12B-0.tar.gz
  http://www.erlang.org/download/otp_doc_man_R12B-0.tar.gz

We also want to thank those that sent us patches, suggestions and bug
reports,