2015 · 10 citations · 6 references
ComputingComputer ScienceCompilersFormal MethodsProgramming LanguagesControl-flow AnalysisData-flow AnalysisType CheckingHigher-order FunctionsIntraprocedural AnalysisIntraprocedural Data-flow AnalysisJavascriptPure FunctionsPurity Characterization
We present an approach to detect function purity in JavaScript. A function is pure if none of its applications cause observable side-effects. The approach is based on a pushdown flow analysis that besides traditional control and value flow also keeps track of write effects. To increase the precision of our purity analysis, we combine it with an intraprocedural analysis to determine freshness of variables and object references. We formalize the core aspects of our analysis, and discuss our implementation used to analyze several common JavaScript benchmarks. Experiments show that our technique is capable of detecting function purity, even in the presence of higher-order functions, dynamic property expressions, and prototypal inheritance.
6
Wei Huang, Ana Milanova, Werner Dietl et al. · 2012 · 55 citations
Verifiable functional purity in java
Matthew Finifter, Adrian Mettler, Naveen Sastry et al. · 2008 · 42 citations
A flow-insensitive, modular effect system for purity
Lukas Rytz, Nada Amin, Martin Odersky · 2013 · 16 citations · Full text