Archive for the 'Erlang' Category

The Erlang Exchange

2008-06-26

I’m currently attending the Erlang Exchange conference in London.

So far I’ve attended two presentations in the main track before lunch and two presentations in the Tools & Gadgets track. I’m going to give a brief summary below. All the talks are being streamed on Yaika.

Main Track

Joe Armstrong on Software: Erlang & SMP

This is the talk of Joe Armstrong which kind of aligns with his book. It is quite basic and more aimed at Erlang beginners that experts. It contains a few interesting bits however, mostly the stuff about Symmetric Multi-Processing (SMP) and multi core processors. Not specifically Erlang related but at least message passing oriented, or as Joe calls it, Concurrency Oriented Programming (COP). All in all, “old stuff” (in a good sense) with some really interesting insights.

Introducing Erlang to Motorola: The Journey to Success

This talk was given by Nicholas Gunder and Torben Hoffman (which I enjoyed the OTP course together with) from Motorola (which interesting enough is now using Erlang, the language developed by their main competitor Ericsson). It was more of a manager talk than a technical talk, although they sometimes go all the way down to the hardware level, for example when talking about the Gumstix computers they are using.

This was a really nice talk, Nicholas and Torben are really funny guys. It gave a good insight into how they pushed Erlang from being a basically non-existant technology inside Motorola to a technology about which the managers ask “is there’s any other projects we could apply this to?” Their main conclusion was, I think, “have something finished to show.” That means, whenever pushing Erlang to management, show them something working. This is among other things a terrific illustrator on how productive Erlang is, which also compared to C is one of the selling points.

Tools & Gadgets Track

Erlang D-Trace

Given by Garry Bulmer, the talk was about intergrating Erlang with the OS X/Unix tracing facility DTrace. DTrace basically lets you trace on “anything” in the operating system and user space programs. You can trace on functions, accumulate data etc using your own DTrace scripts. Erlang already has an extremely powerful tracing and debugging facility. This integration aims to give a bigger picture on how your Erlang application and the rest of the OS and other applications interact and perform. Unfortunately due to GPL issues, DTrace is not available on Linux, only on OS X and other Unix variants.

What Bulmer and his team did, was to extend the Erlang VM with DTrace hooks so that tracing can be done on process creating and other Erlang primitives. The goal is to become a good complement to the internal Erlang tracing and debuggnig facilities.

Building Web Applications in Erlang

A talk about Erlang and web development given by Michal Slask and Xingdong Bian from Erlang Training & Consulting (disclaimer: I work for ETC). It was about the new web development platform that ETC is releasing. It takes its template philosophy from JSP, so that with tags such as list and choose you can call backend Erlang modules expanding to dynamic HTML code. All in a Model View Controller (MVC) fashion.

More about this soon so keep an eye on the Erlang Training & Consulting website and the Erlang mailing list!

Erlang & Ajax Web

Roberto Saccon gived a talk on integrating Ajax technologies with Erlang. The talk focused heavily on Coment and Roberts implementation in Erlang, ErlyComet. The talk is focusing on the implemantion and the results, both mistakes and successes. It is like a overview of both Ajax (for the Erlang community) and a collection of do’s and don’ts when using Ajax/Comet with Erlang. All in all, a web 2.0 presentation with an Erlang flavour.

The Rest of the Conference

This is it so far, maybe more posts will come later. Today it is just the Faxien & Sinan presentation I’m planning to attend.

Customizing Emacs for Erlang

2008-02-20

There are some easy ways to improve the Erlang mode for Emacs. They are actually included in the Erlang mode already, just not turned on by default.

Tags

To be able to search a little more efficiently than the standard Ctrl+S command, you can utilize the Emacs concept of tags. From the Erlang manual:

Tags is a standard Emacs package used to record information about source files in large development projects. In addition to listing the files of a project, a tags file normally contains information about all functions and variables that are defined. By far, the most useful command of the tags system is its ability to find the definition of functions in any file in the project.

To create tags for your project just enter a directory and use the etags command (included with Emacs) on the Erlang files you want to create tags for:

$ etags *.erl *.hrl
$

This creates a file named TAGS in the current directory. Whenever you load a file in Emacs in that directory the TAGS file is used to search for tags for all the files you included when creating it.

To search for a tag (which is mostly equivalent to function names) just press M+. (thats the Meta key, usually located on the Alt key). Then type in your search term (you can auto complete with Tab) and Emacs will jump to the tag in the file it is located. If the file is not opened by Emacs, it is automatically opened.

Functions Menu

Another cool feature of the Erlang mode is the “functions” menu. If you type the command M+x imenu-add-to-menubar, and then enter a name for the menu, you will get a menu which contains all the functions in the current file. If you click them, Emacs will jump to the function definition.

Sadly, this is not done when the Erlang mode loads, but there is a simple way to make it so. In your .emacs file (for Xemacs it is the .xemacs/init.el file) enter the following rows:

(add-hook 'erlang-mode-hook 'my-erlang-hook-function)
(defun my-erlang-hook-function ()
    (imenu-add-to-menubar "Functions"))

This will automatically create a menu called “Functions” (you can rename it to your liking) whenever the Erlang mode is activated. In this hook you can also add other things that will be specific to the Erlang mode, and the Erlang mode only, in your Emacs.


I have tested these on XEmacs 21.5.25 and they should work on Emacs too, but I don’t guarantee it. If they don’t I’m happy to update with instructions on how to enable this on Emacs too.