Hacker News new | ask | show | jobs
by tazjin 2334 days ago
Neat! I wonder if the character decoding & regex usage has noticeable performance impact. My Common Lisp version was sped up somewhat by switching from a character stream to a byte stream: https://git.tazj.in/tree/fun/wcl/wc.lisp

You can try this one via Nix with:

  nix-build -E '(import (builtins.fetchGit "https://git.tazj.in") {}).fun.wcl'
2 comments

It's been a while since I last wrote CL but I think your program can produce any counts between zero and the correct one – you need to use eql instead of eq if you want this to work in standard common lisp.
Ah, you're right of course - fixed. Though that still won't make this portable, as I'm using an SBCL-specific way of accessing argv.
`unix-opts` is in available in quicklisp -- it's small, and has a portable `argv` wrapper function.
That's a very impressive Nix configuration. Nicely done!