background preloader

Erlang

Facebook Twitter

Integrating Java and Erlang. Building scalable, distributed and reliable systems is trivial in Erlang.

Integrating Java and Erlang

This can be a hard pill to swallow for many enterprise developers. Erlang is a dynamically typed functional language and Java is a statically typed object-oriented language. Erlang is an agitator to traditional enterprise development because it excels so well at concurrency, uptimes of five nines or more, and "hot deployment" of code. But there are valid reasons for why someone may not want to dive in head first. How many CIOs want to lose their investments in Java? This article is for a lot of people: language enthusiasts, software fashion victims, or anyone who wants to create serious business value bridging Erlang with Java.

Concurrent Programming with a Simple Client Server Module Erlang is a freak of nature; it has concurrency in its DNA. In an effort to stay focused on the core concepts we will avoid the deep end for now and keep it simple ... by calculating the sum of two numbers. -module(mathserver). Erlang Programming Language, Official Website.

Erlang processes vs. Java threads. Earlier today I ran a simple test of Erlang’s process creation and teardown code, resulting in a rough figure of 350,000 process creations and teardowns per second.

Erlang processes vs. Java threads

Attempting a similar workload in Java gives a figure of around 11,000 thread creations and teardowns per second – to my mind, a clear demonstration of one of the main advantages of Erlang’s extremely lightweight processes. Here’s the Java code I used – see the earlier post for the Erlang code, to compare: // Java 5 – uses a BlockingQueue. import java.util.concurrent.*; public static class Body extends Thread { BlockingQueue queue; int count; public Body(BlockingQueue queue, int count) { this.queue = queue; this.count = count; } public void run() { if (count == 0) { try { queue.put(this); } catch (InterruptedException ie) {} } else { new Body(queue, count – 1).start(); } } } }

Erlang for C, C++, and Java Programmers - tamale.net. This tutorial was written by Sean Hinde (a.k.a.

Erlang for C, C++, and Java Programmers - tamale.net

Earlyriser) and originally appeared at I retrieved it from The Internet Archive on 2005-12-21 and updated it. Thanks to Anthony D'Agostino for giving me the author's information. Thanks to Shannon -jj Behrens for pointing out a typo. Home This brief tutorial aims to cover the main concepts and syntax of Erlang in a way which programmers of C type languages can relate to. All comments are welcome – with feedback from readers this might even end up being useful! 1. Erlang was designed from the beginning to be small and easy to learn – Ericsson had to train many C/C++ programmers in Erlang so it was part of the core brief to make it as easy as possible. There are only a small number of concepts to master and most will already be familiar to C programmers. 2. The biggest difference between programming in C and Erlang is in how programs are structured and in the fact that data is immutable – that is once created, you can't change it.