函数式编程语言的静态分析器,egScheme
我很少看到像Racket/Scheme这样的函数式编程语言的静态分析器,我什至怀疑是否有。我想为函数式语言编写一个静态分析器,比如Scheme/Racket。我该怎么办?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,有一些关于像Scheme这样的动态语言的静态分析的工作。例如,请参阅 Olin Shivers 的作品 (http://www.ccs.neu .edu/home/shivers/itations.html)和曼努埃尔·塞拉诺(http://www-sop.inria.fr/members/Manuel.Serrano/index-1.html)。
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).
已经有,例如,键入的球拍: http://docs.racket-lang.org/ts-guide/索引.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...
首先阅读本文 作者:Shivers,解释了为什么Scheme 中没有可用的静态控制流图。
可能会在方案中实施k-CFA。 Matt Might 的网站和博客是探索高阶语言静态分析的一个很好的起点。
我也在Java中为Scheme做了一些静态分析实现:
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: