Minimal Erlang SMTP, POP3 server code

Tony Garnock-Jones wrote “Some seven months ago, I built simple Erlang modules for generic SMTP and POP3 services. The idea is that the programmer should instantiate a service, providing callbacks for user authentication and for service-specific operations like handling deliveries, and scanning and locking mailboxes. Originally, I was planning on providing SMTP-to-AMQP and AMQP-to-POP3 gateways as part of…”

Erlang on Neo1973 cellphone

Tony Garnock-Jones wrote “This evening, after fighting bitbake (in the form of the capricious “insane.bbclass” class definition) for a good few hours, I managed to get Erlang version R11B-5 running on my new cellphone. Running the interactive erlang shell on a cellphone is pretty cool. Erlang’s built-in clustering support works fine: I’ve successfully connected an erlang node on…”

How should JSON strings be represented in Erlang?

Tony Garnock-Jones wrote “Erlang represents strings as lists of (ASCII, or possibly iso8859-1) codepoints. In this regard, it’s weakly typed – there’s no hard distinction between a string, “ABC”, and a list of small integers, [65,66,67]. For example: Eshell V5.5.4 (abort with ^G) 1> "ABC". "ABC" 2> [65,66,67]. "ABC" 3> Erlang also has a binary type, a simple…”

Invitation to AMQP and RabbitMQ Birds of a Feather session

chris wrote “I am guest blogging here on behalf of CohesiveFT. We work with the excellent LShift team on our joint venture, RabbitMQ. I’m here to invite you to a Birds of a Feather session this coming Thursday, August 30th, at 8pm, in central London. It is FREE and will last for 45 minutes starting at 8pm,…”

Updated AJAX Erlang Jukebox

Tony Garnock-Jones wrote “Our jukebox (mentioned previously) received an update yesterday. it now uses Erlang’s inets httpd instead of yaws, which reduces external dependencies while also giving the code better structure; it now uses a (mostly) RFC 4627-compliant JSON implementation, with a mod_jsonrpc plugin for the inets httpd (also mentioned previously) to expose services via AJAX JSON-RPC; the…”

JSON and JSON-RPC for Erlang

Tony Garnock-Jones wrote “About a month ago, I wrote an implementation of RFC 4627, the JSON RFC, for Erlang. I also implemented JSON-RPC over HTTP, in the form of mod_jsonrpc, a plugin for Erlang's built-in inets httpd. This makes accessing Erlang services from in-browser Javascript very comfortable and easy indeed. ”

RFC 1982 limits itself to powers of two unnecessarily

Tony Garnock-Jones wrote “RFC 1982 defines a “Serial Number Arithmetic”, for use when you have a fixed number of bits available for some monotonically increasing sequence identifier, such as the DNS SOA record serial number, or message IDs in some messaging protocol. It defines all its operations with respect to some power of two, (2^SERIAL_BITS). It struck me…”

Rabbits, rabbits, rabbits

Tony Garnock-Jones wrote “We’re proud to announce that the project we’ve been working on for the past few months, RabbitMQ, has been released. RabbitMQ is an AMQP server written using Erlang/OTP. Check it out at http://www.rabbitmq.com/ – or you can go straight to the downloads page for sources and binaries.”

An AJAX Erlang Jukebox

Tony Garnock-Jones wrote “Sometime around the beginning of July I rewrote our internal jukebox in Erlang. It’s taken me four months to get a round tuit, but new stock has just arrived: here’s the code for our AJAX jukebox web-application, as a tarball. (There’s also a mercurial repository: hg clone http://hg.opensource.lshift.net/erlang-jukebox/.) Click on the image for a screenshot.…”

Erlang processes vs. Java threads

Tony Garnock-Jones wrote “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. 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…”

How fast can Erlang send messages?

Tony Garnock-Jones wrote “My previous post examined Erlang’s speed of process setup and teardown. Here I’m looking at how quickly messages can be sent and received within a single Erlang node. Roughly speaking, I’m seeing 3.4 million deliveries per second one-way, and 1.4 million roundtrips per second (2.8 million deliveries per second) in a ping-pong setup in the…”

How fast can Erlang create processes?

Tony Garnock-Jones wrote “Very fast indeed. 1> spawntest:serial_spawn(1). 3.58599e+5 That’s telling me that Erlang can create and tear down processes at a rate of roughly 350,000 Hz. The numbers change slightly – things slow down – if I’m running the test in parallel: 2> spawntest:serial_spawn(10). 3.48489e+5 3> spawntest:serial_spawn(10). 3.40288e+5 4> spawntest:serial_spawn(100). 3.35983e+5 5> spawntest:serial_spawn(100). 3.36743e+5 [Update: I forgot…”