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

我只是一个虾纸丫 提交于 2019-12-10 15:43:12

问题


I seldom see static analyzer for functional programming languages, like Racket/Scheme, I even doubt 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?


回答1:


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



回答2:


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).




回答3:


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...



来源:https://stackoverflow.com/questions/5250486/static-analyzer-for-functional-programming-languages-e-g-scheme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!