3 ms·
> There's just a big library and documentation problem. You can find a library for anything these days, but quite often it's only half-done, and you need to wri
by dkarl 8y ago
> There's just a big library and documentation problem. You can find a library for anything these days, but quite often it's only half-done, and you need to write the other half yourself.
I'm sad to see this is still the case. When I got into Lisp (Common Lisp) ten years ago, one of the first thing I did was ask what logging library I should use by default. Almost all the answers I got were variations of, "In Lisp, it's so easy to write your own, you shouldn't bother looking for one by someone else." One kind person gave me an FTP url to a tar file on a server at MIT and warned me that it might not work because he thought the person it belonged to might be retired or dead. And then he told me, "You'll see when you look at the code, it's so easy, you might as well write your own." Very frustrating. Every time I see an article like this, I hope things have changed, but at this point I wonder if Lisp is in a sense too good to ever be done right, like the kid who is so bright in school that he never learns how to do anything difficult. But now I'm getting flashbacks to all the speculation and armchair psychoanalysis we used to do about why the Common Lisp community was the way it, and that never did any good.
- TeMPOraL 8y agoThings are changing, but some problems remain the same. Right now, you have a pretty solid logging library in CL that is pretty much the go-to for anything but simplest of needs: log4cl[0]. It's feature-rich, performant, and even integrates with Emacs/SLIME. The README covers a lot of those things... briefly. Good luck figuring out how to e.g. use the (log:config) facility for anything more complicated than changing log levels. As you can see[1], it has a huge docstring describing a lot of things, but the description is shallow. It's like 20% of what is needed to figure out common things like just saving output to a fresh file (without automatic log rotation). This is IMO a good example of the problem I see in those libraries that are actually solid and done. They miss detailed user-oriented documentation, forcing you to wade through code, which can get pretty complex[2]. -- [0] - https://github.com/sharplispers/log4cl https://github.com/sharplispers/log4cl [1] - https://github.com/sharplispers/log4cl/blob/8c42ca6bd07726fcbb96b86455ebb6a2751bf76c/src/configurator.lisp#L22 https://github.com/sharplispers/log4cl/blob/8c42ca6bd07726fc... [2] - Try to macroexpand a simple call to logger, like (log:warn "Foo" some-object). Performance and power can be nicely wrapped under a clean set of macros, but if you deviate from the intended use case, you'd better have a spare couple of hours for figuring out how things work.