开发者

Static analyzer for functional programming languages, e.g.Scheme

I seldom see static analyzer for functional programming languages, like Racket/Scheme, I even doubt 开发者_Python百科that whether there are any. I would like to write a static analyzer for functional languages, say Scheme/Racket. How should I go about it?


Yes, there is some work on static analysis of dynamic languages like Scheme. For instance, see the work of Olin Shivers (http://www.ccs.neu.edu/home/shivers/citations.html) and Manuel Serrano (http://www-sop.inria.fr/members/Manuel.Serrano/index-1.html).


There's already, e.g., typed racket: http://docs.racket-lang.org/ts-guide/index.html Since valid racket code is valid typed racket, you just have to change the language you're working in. Then, for libraries with typed versions, load those instead of the untyped versions, and certain type errors can get caught statically already. Further type annotations can be added to your own code to get guarantees of type correctness beyond that...


First read this paper by Shivers, explaining why there is no static control flow graph available in Scheme.

Might implemented k-CFA in Scheme. Matt Might's site and blog is a good starting point for exploring static analysis of higher-order languages.

I did some static analysis implementations for Scheme in Java as well:

  • k-CFA implementation
  • Interprocedural Dependence Analysis implementation based on a paper by Might and Prabhu
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜