24

Is there a lint for Common Lisp or Chicken Scheme? Possibly something akin to C's splint, Haskell's HLint, Perl's B::Lint, etc.?

Dason
  • 60,663
  • 9
  • 131
  • 148
mcandre
  • 22,868
  • 20
  • 88
  • 147
  • 1
    When I do some searches, I see something called SCL or SCL Lint, which I'm not sure if that's still extant, and the following: http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/tools/lint/lint.cl – Jared Farrish Aug 01 '11 at 00:30
  • That's really cool, but how do we use it? Is it like B::Lint, i.e. just load it before loading the code to check? – mcandre Aug 01 '11 at 00:39
  • *blush* I don't know, I just did some web searches... :D That's a different question. – Jared Farrish Aug 01 '11 at 00:40
  • 1
    I'm porting this to modern CL, Quicklisp, etc. How can I access si:definition-type-name in the different CL implementations? Ditto for compiler:style-checker? – mcandre Aug 01 '11 at 01:18
  • I don't have a clue as far as C-Lisp, seriously. I couldn't do a `hello world`. If you have a specific question that you need an answer to, I suggest raising a question that answers that question, and/or trying it yourself and asking questions when you meet a dead-end. I'm sorry if my response made you think I could answer the question, but that's not a reality in this case. Please, create a new question for your inquiries; I was focusing on C-Lisp Lint parsers. Also note, in some circumstances you're better off deleting a question than editing it. – Jared Farrish Aug 01 '11 at 01:23
  • From a very quick glance at the code, it looks like it is meant to be integrated into the Symbolics programming environment, and pretty specific to it. What the `(defun (compiler:style-checker ...) ...)` stuff probably does is define some kind of hook into the built-in style-checking framework provided by the Symbolics Common Lisp compiler. It is not at all clear whether and how it could be adapted to some other CL implementation. That said, the checking rules themselves could probably be lifted somehow if you were to write your own lint-like tool. – Matthias Benkard Aug 01 '11 at 04:56

5 Answers5

11

There's Lisp Critic:

http://www.mail-archive.com/gardeners@lispniks.com/msg00372.html

Rob Myers
  • 546
  • 4
  • 11
5

There is a static debugger for PLT Scheme, called "MrSpidey", and "bugloo" if you are using the "Bigloo" Scheme compiler, but that is all I could find. see this Stack Overflow question about static analyzers for scheme.

Community
  • 1
  • 1
djhaskin987
  • 9,741
  • 4
  • 50
  • 86
4

Specifically for CHICKEN Scheme, in the 4 series a "scrutinizer" has been added, which will perform (limited) flow analysis of your data types. Especially if you put your code inside a module (making the code a "closed world" so to speak), it can be extremely helpful in detecting type mistakes.

In 4.9.0 and later the scrutinizer is enabled by default. In older versions, you can enable it through the -scrutinize command line option.

sjamaan
  • 2,282
  • 10
  • 19
3

No, there is nothing like that for Common Lisp.

Xach
  • 11,774
  • 37
  • 38
  • 14
    Well, there's the SBCL compiler that's pretty good at giving all sorts of warnings I would expect from a linter for (say) C. – Vatine Aug 01 '11 at 15:15
  • There's XREF (http://www.cs.cmu.edu/Groups/AI/lang/lisp/code/tools/xref/0.html), but the link to the actual code gives a permission error. – mcandre Aug 01 '11 at 19:02
2

sblint ? A linter for Common Lisp, based on SBCL.

Ehvince
  • 17,274
  • 7
  • 58
  • 79