Abstract
We propose multi-language synchronization, a novel approach to the problem of migrating code from a legacy language (such as C) to a new language. We maintain two parallel versions of every source file, one in the legacy language, and one in the new language. Both of these files are fully editable, and the two files are kept automatically in sync so that they have the same semantic meaning and, where possible, have the same comments and layout.
We propose non-deterministic language translation as a means to implement multi-language synchronization. If a file is modified in language A, we produce a new version in language B by translating the file into a non-deterministic description of many ways that it could be encoded in language B and then choosing the version that is closest to the old file in language B.
To demonstrate the feasibility of this approach, we have implemented a translator that can synchronize files written in a straw-man language, Jekyll, with files written in C. Jekyll is a high level functional programming language that has many of the features found in modern programming languages.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Brabrand, C.: Dual syntax for XML languages. In: Bierman, G., Koch, C. (eds.) DBPL 2005. LNCS, vol. 3774, pp. 27–41. Springer, Heidelberg (2005)
Brewer, E., et al.: Thirty years is long enough: Getting beyond C. In: Proceedings of the USENIX workshop on Hot topics in Operating Systems (2005)
Buneman, P., Khanna, S., Tan, W.C.: On propagation of deletions and annotations through views. In: PODS’02 (2002)
FOR_C: Converts FORTRAN into readable, maintainable C code, http://www.cobalt-blue.com
C# Language Specification. ECMA (June 2005)
Dayal, U., Bernstein, P.A.: On the correct translation of update operations on relational views. ACM Transactions on Database Systems 8 (1982)
DeLine, R., Fahndrich, M.: Enforcing high-level protocols in low-level software. In: Proceedings of the ACM conference on Programming Language Design and Implementation, ACM Press, New York (2001)
Ennals, R.: Dr. Jekyll and Mr. C. Tech. Rep. IR-TR-2005-104, Intel Research (2005)
Foster, J.N., et al.: Exploiting schemas in data synchronization. In: Database Programming Languages (DBLP) (2005)
Foster, J.N., et al.: Combinators for bi-directional tree transformations: A linguistic approach to the view update problem. In: Proceedings of the ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL’05), ACM Press, New York (2005)
Fowler, M.: Language workbenches: The killer-app for domain specific languages (June 2005), http://www.martinfowler.com/articles/languageWorkbench.html
Gillespie, D.: p2c, http://www.synaptics.com/people/daveg/
Goldberg, A., Robson, D.: Smalltalk-80: The Language. Addison-Wesley, Reading (1989)
Gottlob, G., Paolini, P., Zicari, R.: Properties and update semantics of consistent views. ACM Transactions on Database Systems 13 (1988)
Jim, T., et al.: Cyclone: A safe dialect of C. In: Proceedings of the USENIX annual technical conference (2002)
Liu, D., et al.: A Java library for bidirectional XML transformation. In: JSSST annual conference (2005)
Mashey, J.R.: Languages, levels, libraries, and longevity. ACM Queue 2(9) (2004)
McCloskey, B., Brewer, E.: ASTEC: A new approach to refactoring c. In: Proceedings of the 10th European Software Engineering Conference (2005)
McNamara, B., Smaragdakis, Y.: Functional programming in C++. In: Proceedings of the ACM SIGPLAN International Conference on Functional Programming (ICFP’00), ACM Press, New York (2000)
Meertens, L.: Designing constraint maintainers for user interaction (1998), http://www.kestrel.edu/home/people/meertens/
Milner, R., et al.: The Definition of Standard ML (Revised). MIT Press, Cambridge (1997)
Mycroft, A.: Type-based decompilation. In: Swierstra, S.D. (ed.) ESOP 1999 and ETAPS 1999. LNCS, vol. 1576, Springer, Heidelberg (1999)
Necula, G.C., et al.: CCured: type-safe retrofitting of legacy software. ACM Transactions on Programming Languages and Systems (2004)
The Objective C Programming Language. Apple (Oct. 2005)
Peyton Jones, S.: Haskell 98 Language and Libraries. Cambridge University Press, Cambridge (2003)
Stallman, R.M.: Using and Porting GNU CC (Version 2.0). Free Software Foundation (Feb. 1992)
Stroustrup, B.: The C++ Programming Language. Addison-Wesley, Reading (1997)
Wadler, P.: Why no-one uses functional languages. SIGPLAN Notices 33 (1998)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer Berlin Heidelberg
About this paper
Cite this paper
Ennals, R., Gay, D. (2007). Multi-language Synchronization. In: De Nicola, R. (eds) Programming Languages and Systems. ESOP 2007. Lecture Notes in Computer Science, vol 4421. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-71316-6_32
Download citation
DOI: https://doi.org/10.1007/978-3-540-71316-6_32
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-71314-2
Online ISBN: 978-3-540-71316-6
eBook Packages: Computer ScienceComputer Science (R0)