ErlyWeb/Printable version

From Wikibooks, open books for an open world
Jump to navigation Jump to search


ErlyWeb

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/ErlyWeb

Permission is granted to copy, distribute, and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 3.0 License.

Why Erlang?

Before ErlyWeb there were already a lot of web application frameworks. Why do we need another one? Almost every other modern framework is written in a scripting language or compiled language that has drastically different characteristics from Erlang.

The benefits that come from being implemented in Erlang are what help set ErlyWeb apart from other web application frameworks.

Characteristics of Erlang[edit | edit source]

  • a functional language with little shared state
  • highly reliable
  • distributed
  • extremely lightweight processes
  • message passing primitives

Erlang was designed to work this way because the problem domain that it was originally designed to work with, phone switches, requires them. The remarkable thing is, 20 years later, we are finding that building scalable websites would be made easier if we used a language with these characteristics.

Facebook - uses mochiweb, a lightweight webserver written in Erlang to allow over 70 million users chat with each other in real-time.


Yaws

Yaws is a HTTP high performance 1.1 webserver particularly well suited for dynamic-content web applications. Two separate modes of operations are supported.

  • Standalone mode where Yaws runs as a regular web server daemon. This is the default mode.
  • Embedded mode where Yaws runs as an embedded web server in another Erlang application.

Yaws is entirely written in Erlang furthermore it is a multithreaded webserver where one Erlang light weight process is used to handle each client.

The main advantages of yaws compared to other Web technologies are performance and elegance. The performance comes from the underlying Erlang system and its ability to handle concurrent processes in an efficient way. Its elegance comes from Erlang as well. Web applications do not have to be written in ugly adhoc languages.

Download Yaws for Windows and Unix.