CLERIC

Common Lisp Erlang Interface

News

2010-07-22 Version 0.0.6 released! Fixed bugs and cleaned up some code. CLERIC compiles cleanly on (at least) Clozure CL, SBCL, Allegro CL, and CLISP.

2010-07-18 Version 0.0.5 released! CLERIC now implements BERT. Check out the BERT package.

2010-07-13 Version 0.0.4 released! Fixed an error that caused CLERIC to not compile on SBCL (thanks Zach Beane!)

2010-07-10 Version 0.0.3 released! CLERIC now supports cached atoms.

2010-05-29 CLERIC is on GitHub.

Introduction

CLERIC is an implementation of the Erlang distribution protocol, comparable with erl_interface and jinterface.

Limitations

Mailing Lists

Project members

Markus Flambard.

How to install CLERIC

CLERIC is ASDF-Installable -- just do (asdf-install:install :cleric) and you're done!

If you are not using ASDF-Install, download the latest tarball and extract it where ASDF can find it.

For tarballs of all releases, please see the releases/ directory.

Dependencies

CLERIC needs usocket (needs SPLIT-SEQUENCE), MD5, and IEEE-Floats.

Links

How to use CLERIC

Suppose there's an Erlang node jaheira@amn running.

Use EPMD-LOOKUP-NODE to query the Erlang Port Mapper Daemon (EPMD) for information about a node. A REMOTE-NODE object is returned.

   CL-USER> (cleric:epmd-lookup-node "jaheira" "amn")
   #<REMOTE-NODE (ERLANG) jaheira@amn [49246]>

   CL-USER> (defvar teh-node *)
   TEH-NODE
 

Before we connect to the node, let's create a Pid so that we can send and receive messages.

   CL-USER> (cleric:make-pid)
   #<ERLANG-PID lispnode@localhost <1.0>>

   CL-USER> (defvar teh-pid *)
   TEH-PID
 

To connect to the node, use REMOTE-NODE-CONNECT.

   CL-USER> (cleric:remote-node-connect teh-node "The very secret cookie!")
   FULL-NODE-NAME: jaheira@amn, VERSION: 5, FLAGS: 111111111111100
   T
 

If the connection was successful some node stuff is printed and T is returned.

To send a message to a registered process, use REG-SEND.

   CL-USER> (cleric:tuple teh-pid '|says| "Hello, Erlang world!")
   #<ERLANG-TUPLE {#<ERLANG-PID lispnode@localhost <1.0>> |says| "Hello, Erlang world!"}>

   CL-USER> (cleric:reg-send teh-pid "blabber" "jaheira" *)
   NIL
 

The registered process blabber on jaheira@amn receives this message: {<6197.1.0>,says,"Hello, Erlang world!"}

To receive messages, use RECEIVE-NODE-MESSAGES. Note that a list of messages is returned.

   CL-USER> (cleric:receive-node-messages)
   NIL

   CL-USER> (cleric:receive-node-messages) ; A while later
   (#<COMMON-LISP-ERLANG-INTERFACE:SEND #x89B4796>)

   CL-USER> (defvar received-send (first *))
   RECEIVED-SEND

   CL-USER> (cleric:to-pid received-send)
   #<ERLANG-PID lispnode@localhost <1.0>>

   CL-USER> (cleric:message received-send)
   |howdy|
 

We received a SEND message with our Pid as recipient, the message contents is the single atom howdy.

Erlang nodes send a heartbeat every couple of seconds to check that the other node is still alive. It is therefore necessary to call RECEIVE-NODE-MESSAGES repeatedly to keep the connection alive. The heartbeats are automatically replied to by RECEIVE-NODE-MESSAGES.

For further information, fire up the SLIME REPL, load CLERIC and type

   cleric: <TAB>
 

:-)

Valid XHTML 1.0 Strict