Abstract
Program specialization is an effective tool for transforming interpreters to compilers. We present the first steps in the construction of a specialization tool chain for JavaScript programs. We report on an application of this tool chain in a case study that transforms a realistic interpreter implemented in JavaScript to a compiler.
The difference to previous work on compiling with program specialization is threefold. First, the interpreter has not been written with specialization in mind. Second, instead of specializing the interpreter, we transform it into a generating extension, which replaces parts of the interpreter’s code by a corresponding code generator. Third, the implementation language of the interpreter is not a restricted toy language, but full JavaScript.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
References
Andersen, L.O.: Program analysis and specialization for the c programming language. Ph.D. thesis, DIKU, University of Copenhagen (DIKU report 94/19) May 1994
Birkedal, L., Welinder, M.: Partial evaluation of Standard ML. Rapport 93/22, DIKU, University of Copenhagen (1993)
Bolz, C.F., et al.: Allocation removal by partial evaluation in a tracing JIT. In: PEPM 2011, Austin, TX, USA, pp. 43–52. ACM, January 2011
Bondorf, A.: Automatic autoprojection of higher order recursive equations. Sci. Comput. Program. 17, 3–34 (1991)
Consel, C.: A tour of schism. In: Proceedings of the 1993 ACM Workshop Partial Evaluation and Semantics-Based Program Manipulation, Copenhagen, Denmark, pp. 134–154. ACM Press, June 1993
Consel, C., Lawall, J., Le Meur, A.-F.: A tour of tempo: a program specializer for the C language. Sci. Comput. Program. 52(1–3), 341–370 (2004)
Danvy, O., Thiemann, P., Glück, R. (eds.): Dagstuhl Seminar 1996. LNCS, vol. 1110. Springer, Heidelberg (1996)
Danvy, O., Malmkjær, K., Palsberg, J.: Eta-expansion does the trick. ACM TOPLAS 18(6), 730–751 (1996)
Futamura, Y.: Partial evaluation of computation process – an approach to a compiler-compiler. Syst. Comput. Controls 2(5), 45–50 (1971)
Hatcliff, J., Thiemann, P. (eds.): DIKU 1998. LNCS, vol. 1706. Springer, Heidelberg (1999)
Hedin, D., et al.: JSFlow: tracking information flow in JavaScript and its APIs. In: ACM Symposium on Applied Computing (SAC 2014), Gyeongju, Korea, March 2014
Hedin, D., Sabelfeld, A.: Information-flow security for a core of JavaScript. In: Chong, A.S. (ed.) CSF 2012, pp. 3–18. IEEE (2012)
Helsen, S., Thiemann, P.: Polymorphic specialization for ML. ACM TOPLAS 26(4), 1–50 (2004)
Jones, N., Gomard, C., Sestoft, P.: Partial Evaluation and Automatic Program Generation. Prentice-Hall, New Jersey (1993)
Jones, N. D.: What not to do when writing an interpreter for specialisation. In: Danvy et al. [7], pp. 216–237
Jones, N.D., Sestoft, P., Søndergaard, H.: An experiment in partial evaluation: the generation of a compiler generator. In: Jouannaud, J.-P. (ed.) RTA 1985. LNCS, vol. 202, pp. 124–140. Springer, Heidelberg (1985)
Jørgensen, J.: Compiler generation by partial evaluation. Master’s thesis, DIKU, University of Copenhagen (1991)
Mogensen, T.Æ.: Partially static structures in a self-applicable partial evaluator. In: Partial Evaluation and Mixed Computation, pp. 325–347. North-Holland, Amsterdam (1988)
Sperber, M.: Self-applicable online partial evaluation. In: Danvy et al. [7], pp. 465–480
Sumii, E., Kobayashi, N.: A hybrid approach to online and offline partial evaluation. Higher-Order Symbol. Comput. 14(2/3), 101–142 (2001)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Thiemann, P. (2015). Towards Specializing JavaScript Programs. In: Voronkov, A., Virbitskaite, I. (eds) Perspectives of System Informatics. PSI 2014. Lecture Notes in Computer Science(), vol 8974. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-46823-4_26
Download citation
DOI: https://doi.org/10.1007/978-3-662-46823-4_26
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-662-46822-7
Online ISBN: 978-3-662-46823-4
eBook Packages: Computer ScienceComputer Science (R0)