Description
I did this as an exercise after reading the entire Land of Lisp book. On the other hand, I did it because I was too bored — I don’t know if this matters. But, anyway, it’s just another minimal, simple chat over TCP sockets without any smart, solid protocol (like IRC). It’s just raw data from client-to-server, and the server broadcasts the message to all connected clients.
The whole idea is very simple. The software is separated into client.lisp
and server.lisp
. While server.lisp
is running, it listens for connections from a specified port (example: 5558) for the clients. On the other hand, client.lisp
, well… connects to the server and lets the user send messages to it. All messages sent to server.lisp
, when received, are broadcast by the server to all connected clients. It’s just like an IRC with a single room.
It seems very stupid, I know, but actually, because the implementation is so simple, we can assign a certain value to this. BTW, this post was my first front-page on Hacker News with 114 points. I really didn’t expect something like that when I wrote it. So, well, this seems to have some beauty. Maybe the reason is: software written in Lisp? (HAHAHA)
The system, both client and server, is implemented using SBCL (Common Lisp Compiler) and USOCKET (TCP/UDP sockets). Just that. Cool, huh?
Showcase
Yes. Only me. Actually, on the HN trending day, some people cloned the project, set it up, and ran it. I just saw the log later. HAHAH Some guys were typing things like (quit)
or ls
. Very funny. Actually, the server supports three undocumented commands: /users
, /help
, and /log
. But don’t tell it to anyone.
P.S.: Yes, after 22:29:16
, I typed /log
, and old messages came back.
Source
You can look to the source here on github The minimal instructions to build and setup the project is written on README.md. At least for now, the day I wrote this post a server instance is running at server.lerax.me:5558
. As alternative I provide too, for non-lispers, a simple Python client too. Both clients and the servers are configured to running at server.lerax.me:5558
.