Reia. Joearmstrong. Otp. Erlang's Videos. Erlang Configuration. Erlang Concurrency, What’s The Fuss? New Kids on the Erlang Block. I went to Erlang Factory again this year thanks to my employer , and it was even more exciting than last year's event. There were some great speakers (Joe Armstrong - entertaining as ever, Simon Peyton Jones), I got to meet some interesting people (e.g. Rusty Klophaus, creator of the Nitrogen web framework) and I got to see some awesome projects. Although Erlang is experiencing a surge of interest, it is by no means "new". it has been used for years in robust and highly scalable applications. That is why I refer to the "new" - as opposed to the solid Erlang VM, tools, libraries and frameworks that have been around for at least a decade.
So, wo are these the New Kids on the Block? Nice hair! Heroku is a platform for deploying Ruby or Rails web apps. HyperNumbers is a startup that is "doing for numbers what hypertext did for text". CouchDB is a non-relational document database written in Erlang, and it is going from strength to strength. This is my favourite web framework. P.S. Erlang: An Introduction to Records. Internally Erlang has only two internal compound data types: lists and tuples.
Neither of these data types support named access, so creating associative arrays a la PHP, Ruby, or Python is an impossibility without additional libraries. That is, in Ruby, I could do: server_opts = {:port => 8080, :ip => '127.0.0.1', :max_connections => 10} while in Erlang there's no such support at the language (syntax) level. To get around this limitation the Erlang VM provides a pseudo data type called records.
Defining Records Records are more similar to structs in C than associative arrays in that that require you to define their contents up front and they can only hold data. -module(my_server). Records are defined using the -record directive. In our case we've defined a server_opts record that has three fields: a port, a binding IP, and the number of maximum connections allowed. Creating Records Records are created by using the hash (#) symbol. Opts1 = #server_opts{port=80}. Accessing Records Using Records. The A-Z of Programming Languages: Erlang. Computerworld is undertaking a series of investigations into the most widely-used programming languages. Previously we have spoken to Larry Wall, creator of the Perl programming language, Don Syme, senior researcher at Microsoft Research Cambridge, who developed F#, Simon Peyton-Jones on the development of Haskell, Alfred v.
Aho of AWK fame, S. Tucker Taft on the Ada 1995 and 2005 revisions, Microsoft about its server-side script engine ASP, Chet Ramey about his experiences maintaining Bash, Bjarne Stroustrup of C++ fame, and Charles H. Moore about the design and development of Forth. We’ve also had a chat with the irreverent Don Woods about the development and uses of INTERCAL, as well as Stephen C. Johnson on YACC, Steve Bourne on Bourne shell, Falcon creator Giancarlo Niccolai, Luca Cardelli on Modula-3, Walter Bright on D, Brendan Eich on JavaScript, Anders Hejlsberg on C#, Guido van Rossum on Python and Prof. Roberto Ierusalimschy on Lua. What's behind the name Erlang? Erlang Programming for Multicore.
Posted by Ulf Wiger under Erlang[5] Comments I was invited to give a tutorial at the Declarative Aspects of Multicore Programming (DAMP) workshop, in conjunction with POPL 2009. This was my first POPL, and I want to get back to my impressions in another post, but for now, here is the presentation. The presentation was developed as part of the ProTest project. Sorry for being so short, but my laptop power adapter broke, and I’m writing this on a hideously expensive computer in the hotel business center. An elaborate machine is indispensable: Video Slideshow, Introduc. Joe Armstrong - On Erlang, OO, Concurrency, Shared State and the. Often, after the camera is turned off, the conversation continues and, on occasion is truly interesting. Of course, as you could image, Joe, Erik and I continued to chat about concurrent programming, functional languages, the future of hardware-software interaction, etc, when I turned the camera off after part 1 of this interview with the creator of Erlang, Joe Armstrong.
Rather than let the conversation evaporate into the ether of time and space, I decided to turn the camera back on and record a second part. I am sure glad I did! This time around, Erik Meijer sits down in the other hot seat and we embark on a fascinating conversation about the future of programming in an increasingly, from a modern hardware + software perspective, concurrent world. Joe is outspoken on the topic of objects and mutable shared state, as you know from part 1 of this interview (and if you understand Erlang, obviously). He's also got some really interesting ideas on programmable hardware... Tune in. Building RESTful Web Services with Erlang and YAWS. Erlang Factory - SF Bay Area 2009 - Talks. Erlang: Understanding gen_server. Erlang Style Actors Are All About Locking. I managed to offend a few Erlangers by talking about actors as being shared stateful objects a couple of articles back. Now I'm going to continue the tradition by talking about the actor locking model.
And I'm not just talking about Erlang, but any of the libraries that have sprung up for other languages to support actor style concurrency. Let me emphasize again that I like both Erlang and actors. But I dislike the number of times I read from enthusiasts that you "can't have deadlocks in Erlang because it doesn't have any locks. " Of course you can because it does. This article will explain. Locks There are all manner of locks in the world: mutexes, monitors, synchronization barriers, read/write locks etc., etc., yada yada yada. "But, but, 'receive' receives messages - it's not a lock. " Deadlocks A deadlock is when there's a cycle in the locking dependencies of 2 or more threads. Based on this, a deadlock in Erlang is easy to create. This was a toy example, of course. Perverting Erlang. Erlang Doesn’t Fit The JVM. Frequently Asked Questions about Erlang. Erlang Inside Interviews Joe Armstrong – Erlang Inside.
Writing Ruby code for a living, building a company in a foreign country, learning a human foreign language (Spanish) and a computer foreign language (Erlang) on the side hasn’t left a lot of time for blogging about Erlang. But in the past month we were able to spend a few minutes w/Joe Armstrong, creator of Erlang and certainly the language’s most famous ambassador. In the past year Erlang has started to become much more popular – how has this affected you? JA: I get invited to a lot of conferences – I used to say yes to every invitation I got, but this got silly. So I now only accept a few per year. Do you get asked for autographs in the street yet? JA: No Seriously, does it seem like Erlang is headed the same way Ruby was 5 years ago? JA: No idea – but scratch the surface there seems to be lot’s of interesting stuff going on. Related to Erlang’s increasing popularity, any thoughts on the proliferation of web platforms for Erlang?
How about Reia – any thoughts about this language? The Erlang Rationale - The problem with ‘if’ Sigh. If was added as an almost “on the spur of the moment” hack. We knew how to compile guards and thought it might be useful in the case where you don’t have a value to match against. As Erlang has pattern matching we found that a “pure” if is used less than in many other languages, we never used it much ourselves and therefore didn’t really worry much about it. This is not really that strange as in many languages if is used in way which resembles very trivial pattern matching.
For example in C: if ((x = get_some_value()) ! Also I don’t really have a problem using case when I want to do a conditional, but then again I am so used to it I don't think about it. There have been repeated suggestions and discussions of either extending if to allow user defined boolean functions or adding a new construct. The power of Erlang bit syntax. Just finishing off the chapter on bit syntax and pattern matching over bit strings for our Erlang book . We wanted to put in a realistic example, and chose a TCP segment as described here .
It's amazing how expressive the notation can be, and we get a definition which pretty much mirrors the diagram and explanation in the link above: nothing like doing it for yourself to convince you that it works. decode(Segment) -> case Segment of << SourcePort:16, DestinationPort:16, SequenceNumber:32, AckNumber:32, DataOffset:4, _Reserved:4, Flags:8, WindowSize:16, Checksum:16, UrgentPointer:16, Payload/binary>> when DataOffset>4 -> OptSize = (DataOffset - 5)*32, << Options:OptSize, Message/binary >> = Payload, < What is so gratifying about this definition is that the pattern in the case statement is a readable (yet formal) definition of what a segment looks like. So far we have matched on byte boundaries, but next we match DataOffset:4, _Reserved:4, Flags:8, WindowSize:16. Erlang and OO. Erlang is a functional language, something that worries a long time OO programmer, especially when said programmer is starting a new project in it.
My background is predominantly in OO languages that Alan Kay did not have in mind when he coined the phrase OO. I have used Smalltalk in an academic environment, never commercially. OO is amongst the more subtle concepts used in programming. Besides silly interview questions involving OO modelling of living rooms and bathrooms, attempting to apply OO concepts in real life commercial programming is harder. However, once indoctrinated in the OO ways as currently practiced in the industry, a language like Erlang can look pretty weird, there are no classes, no objects in the Java sense. Look up OO in a textbook and you will find words like encapsulation, polymorphism and inheritance thrown about. Message passing implies encapsulation, the entities passing messages to each other do not have any knowledge of the each other’s innards. Tags: Understanding actor concurrency, Part 1: Actors in Erlang.
The hardware we rely on is changing rapidly as ever-faster chips are replaced by ever-increasing numbers of cores. As a result, concurrency and parallelism, niche features today, will soon be a basic requirement for most software. Application developers seeking concurrency solutions have discovered that shared-state concurrency (employed by Java and other imperative languages) comes up short when compared to functional models that promise better reliability and scalability.
In this two-part article Alex Miller introduces the actor concurrency model, which has been popularized by Erlang and more recently adopted by Scala. In Part 1 you'll be introduced to the actor model and its benefits; in Part 2 you'll learn how to use it on the JVM. Level: Intermediate As programmers we know that our software lives on top of hardware, which for decades has relied on chips getting faster at an unrelenting pace. Shared-state concurrency Listing 1. Actor concurrency So what's the alternative? Erlang. The cutting edge of VM design. The Java Virtual Machine generally stands out as the state-of-the-art, loaded with all sorts of crazy optimization tricks it would make your head spin. For this reason manylanguages (including brandnewlanguages) are targeting it as their runtime, as opposed to writing their own virtual machine which I guess some people still like to do. However, I think the route the JVM has taken is one which will gradually wane in popularity as programmers begin to face a future with dozens if not hundreds of CPU cores at their disposal.
Designers of virtual machines will begin to undergo a realization which is already upon the designers of computer processors: focus less on doing one thing quickly and focus more on being good at doing many things at once. This is why I do not believe the state of the art in virtual machine lies in things like the JVM. Rather, I see the Erlang virtual machine as being the state of the art. Java simply was not designed for this future: Strange story of Erlang's success. Back in May, I wrote a post on "Let It Crash" programming in Erlang, based on Joe Armstrong’s paper on the history of the language, and intended to return to other interesting discussions from the paper in a future post. Well, better late than never. Today I’d like to discuss the "success" of Erlang, how it got there, and what it means. Is Erlang successful at all? It’s not particularly widely used, there are few books on the subject, and its influence on other languages is debatable.
It doesn’t do very well in search-engine-based "metrics," either. So the question I’m going to address here is how did Erlang went from a research project to a "successful" tool (in certain domains) with essentially no backing whatsoever, least of all from Ericsson. Joe Armstrong credits two primary factors for Erlang’s success, neither of which have anything whatsoever to do with Erlang as a language: . How could an Ericsson division banning Erlang lead to its success? Work with Erlang. Basic support of Erlang in Emacs is provided by erlang-mode package, that comes with Erlang distribution. This package implements base operations for work with Erlang's source code — syntax highlighting, indentation, etc. Besides this, there are also other packages — they provide implementation of useful operations, not existing in erlang-mode — debugging, profiling, etc. The Distel package is an add-on to the erlang-mode, while erlware-mode package is a fork of the erlang-mode, with implementation of additional commands. erlang-mode The erlang-mode package comes with Erlang distribution, and available for use right after Erlang's installation.
Documentation for this package is available either from Erlang's site, or from Erlang's manual pages, accessible with erl -man erlang_mode command. Almost all commands, implemented by package are available to user via Erlang menu, and most often used also have key bindings (described below) for quick access to them. (add-to-list 'load-path "..... ") Interview with Rusty Klophaus on the Nitrogen Erlang Web Framewo. Joe Armstrong About Erlang. 1. We are here at Qcon 2008, in London. I'm sitting here with Joe Armstrong, designer of Erlang. Let's talk a little bit about Erlang, which I think is your main topic. What's your current involvement with Erlang? Today I go round and give talks about Erlang, promoting Erlang - that's one side of what I do. 4. Yes, in Sweden there are 3 companies which are using Erlang at the moment and it's a company called Kreditor, which is in financials; there is a company called TLF, which does network management systems and there is a company Synapse, which does provisioning of mobile phones. 5.
I believe it to be true. 6. I've talked to Ralph Johnson and he said "You are not plugging the fact that Erlang is good at concurrency" I said "Yes, I am. 7. It's not based on the pi-Calculus, it grew out of some extensions to Prolog, just adding processes and message passing to Prolog. 8. I think we'll see very few changes in the language itself. 10. Yes. 11. I mean static types, Like Haskell's got. 13. Exploring Erlang's gen_server. Erlang for Concurrent Programming: Designed for concurrency from. Adam @ Heroku. Erlang. Erlang - software for a concurrent world. Lisp-flavored Erlang. Erlang Community. Why Erlang ? Compendium of Beginner Erlang Resources. Artificial Intelligence with Erlang: the Domain of Relatives. Why Make Erlang a Functional Language?
What is Erlang-Style Concurrency? Er.js: Erlang-in-JavaScript. Notes on A History of Erlang. In Defense of Steve Vinoski and Erlang. Thinking in Language, But Not Clearly. Let some other process fix the error (Long) Articles.