11

I'm busy learning Common Lisp, & I'm looking for a static code analysis tool that will help me develop better style & avoid falling into common traps.

I've found Lisp Critic and I think it looks good, but I was hoping that someone may be able to recommend some other tools, and / or share their experiences with them.

Duncan Bayne
  • 3,870
  • 4
  • 39
  • 64

3 Answers3

12

Given the dynamic nature of Lisp, static analysis is everything from tough to impossible, depending on the type of source code.

For some purposes I would recommend using the SBCL compiler. Check out its manual for what features it provides. One feature is some form of type inference. It provides also a lot of standard warnings for things like undeclared variables, type problems, calling functions with the wrong number of args, using undefined functions, violating the ANSI CL standard in various ways and more.

Rainer Joswig
  • 136,269
  • 10
  • 221
  • 346
  • 5
    Reading through the output from SBCL's compiler is quite frequently a good way of finding possible sources of future bugs. It is also, sometimes, good for finding stylistic or performance issues. – Vatine May 13 '11 at 10:11
3

The best way to learn about good style is to read a lot of code and ask for others to review your code. This isn't something that's specific to Common Lisp.

Xach
  • 11,774
  • 37
  • 38
  • 3
    Agreed; I've already posted some Common Lisp code to http://codereview.stackexchange.com/ and received some excellent feedback. – Duncan Bayne May 16 '11 at 05:01
  • @DuncanBayne Any platform that has become enough big and complex in the last 11 years has too much entropy to be handle only by human eyes. The world urges for automated code quality tools like Black Duck, SonarQube and Snyk to mitigate security risks. I am searching for Clojure and Lisp tools that I may integrate into SonarQube or Code Climate. – JP Ventura Mar 09 '22 at 10:30
1

I think that one gray tool is use lisp-critic, you can get some information here:

http://quickdocs.org/lisp-critic/

and a remake that was done by @Xach

http://xach.com/lisp/

anquegi
  • 11,125
  • 4
  • 51
  • 67