Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. There's no point at which turning your brain off will work(danluu.com ↗)
    63comments
  2. Cloudflare Quick Tunnels(cloudflare.com ↗)
    128comments
  3. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    7comments
  4. North Korean nuclear test sets off years of earthquakes(science.org ↗)
    77comments
  5. An Empirical Study of Harness Design for Coding Agents(arxiv.org ↗)
    40comments
  6. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    20comments
  7. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    104comments
  8. OpenJev(openjev.com ↗)
    210comments
  9. Mathematicians Build Long-Awaited Graph Sandwich(quantamagazine.org ↗)
    6comments
  10. I vibed a proof of Conway's conjecture(overreacted.io ↗)
    112comments
  11. A heap overflow and SSO misconfiguration to compromise OpenAI internal repos(hacktron.ai ↗)
    181comments
  12. I don't like passkeys(hawksley.dev ↗)
    544comments
  13. US Treasuries Have Become Unappetizing for Foreign Central Banks and Governments(wolfstreet.com ↗)
    64comments
  14. GrassLobster: AI Agentic Generation of Parametric Geometry Workflows(miro.vision ↗)
    3comments
  15. Jemalloc 5.4.0(github.com/jemalloc ↗)
    76comments
  16. NATS publishes preliminary report on technical incident of 8 September(nats.aero ↗)
    23comments
  17. Cekura (YC F24) Is Hiring(ycombinator.com ↗)
    discuss
  18. The Shadows Lurking in the Equations – Underwater Islands(gods.art ↗)
    9comments
  19. The scourge of x86 emulation(fex-emu.com ↗)
    68comments
  20. Show HN: Scry, programmable internet search w/ congestion pricing(scry.io ↗)
    3comments
  21. Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint(prismml.com ↗)
    176comments
  22. BeanShell3 in Development(beanshell.github.io ↗)
    13comments
  23. Warren Buffett Steps Down as Berkshire Chairman, Names Son to Replace Him(nytimes.com ↗)
    156comments
  24. Build Faster Feedback Loops Using Qualitative User Research(nseldeib.com ↗)
    1comments
  25. Qwen 3.8 Omni Flash(qwen.ai ↗)
    118comments
  26. Second Circuit Allows Government to Search Electronic Devices at the Border(knightcolumbia.org ↗)
    45comments
  27. How to Write with an LLM(sockpuppet.org ↗)
    195comments
  28. Pre-Greek: The lost language hidden within Ancient Greek(linguisticdiscovery.com ↗)
    62comments
  29. Microsoft exec called AI scraping 'the largest theft of labor in human history'(techcrunch.com ↗)
    648comments
  30. When the fractional part of a float fixes your shader(crocidb.com ↗)
    16comments

Show HN: Experimental chat written in Common Lisp

114 pointsby 9y agogithub.com
42 comments
9y agoHN ↗

I'm learning Lisp right now so I'll definitely try this out when I get home. It's nice to go and read other's Lisp projects.

I love the brevity of this code! Awesome work.

Are you on Lainchan?

9y agoHN ↗

Thanks for look it! I did that as exercise to topics of multi-threading, streams and sockets using SBCL. I added later a Python version (using ncurses as bonus) to non-lispers can test.

On client written Lisp I have a problem with asynchronous STDIN and STDOUT yet. When the user is typing a message input, a message from server may comes and print in middle of the input, so the console will be mixed with stdin and stdou... a messy. .

After looking for a solution almost everybody points to use curses... but I was hesitant for it because I wish keep server and client as more simple possible. As was proposed, the Python client using curses doesn't has this problem and works fine.

Curious question about Lainchan. In another days I posted some programming related stuff on there and a personal music album. Why are you asking?

9y agoHN ↗

Take a look at the first picture in your readme :)

9y agoHN ↗

Oooh... this is really obvius >.< Thanks. It's because I'm really a big Lain fan. Lain for all.

9y agoHN ↗

Lainchan has a bunch of Lisp programmers and it looks like you have a "lain" reference in your screenshot.

9y agoHN ↗

besides, that shows me how well readable lisp code is. even better than python.

9y agoHN ↗

And it AOT compiles to native code when needed.

9y agoHN ↗

Yes. I was wondering about that after I wrote the two client versions! Lisp is really easy to read. I not write yet the docstrings, but still is easy to understand. As much as I enjoy reading code in Python, Lisp is also in my heart.

9y agoHN ↗

Agreed. Except format strings and stream formatting and printing options get confusing quickly.

9y agoHN ↗

If you are more proficient in Lisp than Python, your Lisp will be more readable than your Python.

9y agoHN ↗

LISP has no syntactic sugar. It only shows you the important parts, and it does so purely: it shows them just as they are.

9y agoHN ↗

What ? maybe I'm stupid, but to me the python version seems a a lot more readable. It's only me ? (maybe because I don't know lisp, but neither python, so should be the same)

9y agoHN ↗

What programming languages do you know? If you know one or some algol-like one their syntax is very similar to each other and very different from lisp-like langs.

9y agoHN ↗

When I found both client.py and client.lisp, I thought it would be nice to see direct lisp/python comparison. However, turns out Python version does much more that Lisp one (it maintains edit field even if other people send the messages), so no direct comparison is possible.

Author, can you add a simplified python client with exactly the same functionality as the lisp one?

9y agoHN ↗

Yes, I can do it. The Python client version was a test about handling async STDOUT and STDIN nicely, as I related in other comment in this thread. Actually removing the ChatUI and other ncurses stuff, the rest both clients has the same functionality.

9y agoHN ↗

As you requested: https://ghostbin.com/paste/zba9f

This is the simplified version making the same output of the lisp version.

I was wondering about race conditions when I try close the read stream on finally keyword. Seems crash sometimes. However I never got this on the Lisp version. Funny.

I hope you like it. Maybe I should push this version to the repository?

9y agoHN ↗

My pleasure. If you do decide to integrate it let me know.

9y agoHN ↗

I think maybe lerax had a dyslexic moment and thought it was REPTL, which would be a little funny (reptile).

9y agoHN ↗

Cool.

I'm not sure that using quicklisp that way is kosher. Quicklisp doesn't allow you to pin a particular version of a dependency. The upshot is that your code that works today may not work tomorrow.

I've been looking for a best practice and all I can seem to come up with is make a bundle and include it in your repo.

https://www.quicklisp.org/beta/bundles.html

9y agoHN ↗

Quicklisp does let you pin to a particular release, or make your own distribution, both of which will handle this. There is also qlot for more fine-grained dependencies.

9y agoHN ↗

What I do not understand: Why not write a simple IRC (or even XMPP) client – but an “IRC-like” client? The documentation is out there. Do people feel special when their software is incompatible with older software without having features that make incompatibility a necessity?

Internet Relay Chat: Client Protocol https://tools.ietf.org/html/rfc2812

Internet Relay Chat: Server Protocol https://tools.ietf.org/html/rfc2813

9y agoHN ↗

I think many people overestimate how complicated the IRC protocol is. A minimal IRC client is much less work than one would expect.

9y agoHN ↗

Last time I was thinking about it the number of non-standard extensions combined with there being multiple RFCs involved if you want to support more than minimal features led me not to consider it for my hobby/learning project.

9y agoHN ↗

Thanks for share the IRC's specifications. I wrote this little project just as a exercise of my studies from Common Lisp, basic concepts of multi-threading and TCP/IP sockets.

Sorry if this annoys you. You are correct, would be better implement a well-known protocol for chat like IRC, is unnecessary as you say. But I think is still useful for learning purposes.

Thanks for looking it, anyway.

9y agoHN ↗

Why did you choose SBCL among the several other common choices available? Thanks.

9y agoHN ↗

Not the OP, but my guess would be because SBCL is the fastest known free implementation of Common Lisp.

9y agoHN ↗

HAHAHAHAHA. Thanks.

Was my first front-end on HN.