Source-to-Source Translation and Software Engineering

Abstract

Source-to-source translation of programs from one high level language to another has been shown to be an effective aid to programming in many cases. By the use of this approach, it is sometimes possible to produce software more cheaply and reliably. However, the full potential of this technique has not yet been realized. It is proposed to make source-to-source translation more effective by the use of abstract languages, which are imperative languages with a simple syntax and semantics that facilitate their translation into many different languages. By the use of such abstract languages and by translating only often-used fragments of programs rather than whole programs, the need to avoid writing the same program or algorithm over and over again in different languages can be reduced. It is further proposed that programmers be encouraged to write often-used algorithms and program fragments in such abstract languages. Libraries of such abstract programs and program fragments can then be constructed, and programmers can be encouraged to make use of such libraries by translating their abstract programs into application languages and adding code to join things together when coding in various application languages. This approach can also improve program reliability, because it is only necessary to verify the abstract programs once instead of verifying them separately in each application language. Also, this approach makes it possible to generate code faster than programming from scratch each time. This approach is compared to the use of libraries and to other methods in current use for communication between programming languages and translation between languages.

Share and Cite:

D. Plaisted, "Source-to-Source Translation and Software Engineering," Journal of Software Engineering and Applications, Vol. 6 No. 4A, 2013, pp. 30-40. doi: 10.4236/jsea.2013.64A005.

Conflicts of Interest

The authors declare no conflicts of interest.

References

[1] M. Hinchey, M. Jackson, P. Cousot, B. Cook, J. P. Bowen and T. Margaria, “Software Engineering and Formal Methods,” Communications of the ACM, Vol. 51 No. 9, 2008, p. 55. doi:10.1145/1378727.1378742
[2] P. J. Denning and R. D. Riehle, “Is Software Engineering Engineering?” Communications of the ACM, Vol. 52, No. 3, 2009, p. 25. doi:10.1145/1467247.1467257
[3] E. Tenner, “Buggy Software: Achilles Heel of Big-DataPowered Science?” The Atlantic, 2012. http://www.theatlantic.com/technology/archive/2012/12/buggy-software-achilles-heel-of-big-data-powered-science/265690/
[4] R. M. Bates, “Logic of Lemmings in Compiler Innovation,” Communications of the ACM, Vol. 52, No. 5, 2009, p. 7. doi:10.1145/1506409.1506412
[5] E. Putrycz and A. W. Kark, “Connecting Legacy Code, Business Rules and Documentation,” Proceedings of the International Symposium on Rule Representation, Interchange and Reasoning on the Web (RuleML ’08), Vol. 5321, 2008, pp. 17-30.
[6] T. Ziadi, M. A. A. da Silva, L. M. Hillah and M. Ziane, “A Fully Dynamic Approach to the Reverse Engineering of UML Sequence Diagrams,” Proceedings of the 2011 16th IEEE International Conference on Engineering of Complex Computer Systems (ICECCS ’11), Las Vegas, 27-29 April 2011, pp. 107-116.
[7] J. F. Cui and H. S. Chae, “Applying Agglomerative Hierarchical Clustering Algorithms to component Identification for Legacy Systems,” Information and Software Technology, Vol. 53, No. 6, 2011, pp. 601-614. doi:10.1016/j.infsof.2011.01.006
[8] W. Gropp, E. Lusk and A. Skjellum, “Using MPI: Portable Parallel Programming with the Message-Passing Interface,” MIT Press, Cambridge, 1994.
[9] P. J. L. Wallis, “Automatic Language Conversion and Its Place in the Transition to Ada,” Proceedings of the 1985 annual ACM SIGAda international conference on Ada (SIGAda ’85), Vol. 5, No. 2, 1985, pp. 275-284.
[10] P. F. Albrecht, P. E. Garrison, S. L. Graham, R. H. Hyerle, P. Ip and B. Krieg-Brückner, “Source-to-Source Translation: Ada to Pascal and Pascal to Ada,” Proceedings of the ACM-SIGPLAN symposium on Ada Programming language (SIGPLAN ’80), Vol. 15, No. 11, 1980, pp. 183-193.
[11] R. D. Huijsman, J. van Katwijk, C. Pronk and W. J. Toetenel, “Translating Algol 60 Programs into Ada,” Ada Letters, Vol. VII, No. 5, 1987, pp. 42-50. doi:10.1145/36077.36080
[12] D. Plaisted, “An Abstract Programming System,” In: S. Shannon, Ed., Leading Edge Computer Science Research, Nova Science Publishers, New York, 2005, pp. 85-129.
[13] Gupta, et al., “Semantics-Based Filtering: Logic Programming’s Killer App?” Lecture Notes in Computer Science, Vol. 2257, 2002, pp. 82-100. doi:10.1007/3-540-45587-6_7
[14] J. Brant and D. Roberts, “The Smacc Transformation Engine: How to Convert Your Entire Code Base into a Different Programming Language,” Proceedings of the 24th ACM SIGPLAN Conference Companion on Object Oriented Programming Systems Languages and Applications (OOPSLA ’09), Orlando, 25-29 October 2009, pp. 809-810.
[15] K. Andrews, P. Del Vigna and M. Molloy, “Macro and File Structure Preservation in Source-to-Source Translation,” Software-Practice and Experience, Vol. 26, No. 3, 1996, pp. 281-292. doi:10.1002/(SICI)1097-024X(199603)26:3%3C281:: AID-SPE14%3E3.0.CO;2-0
[16] W. Tansey and E. Tilevich, “Annotation Refactoring: Inferring Upgrade Transformations for Legacy Applications,” Proceedings of the 23rd ACM SIGPLAN Conference on Object-Oriented Programming Systems Languages and Applications (OOPSLA ’08), Vol. 43, No. 10, 2008, pp. 295-312.
[17] M. Trudel, C. A. Furia, M. Nordio, B. Meyer and M. Oriol, “C to O-O Translation: Beyond the Easy Stuff,” Proceedings of the 2012 19th Working Conference on Reverse Engineering (WCRE ’12), Kingston, 15-18 October 2012, pp. 19-28. doi:10.1109/WCRE.2012.12
[18] S. Verdoolaege, J. C. Juega, A. Cohen, J. I. Gómez, C. Tenllado and F. Catthoor, “Polyhedral Parallel Code Generation for CUDA,” ACM Transactions on Architecture and Code Optimization, Vol. 9, No. 4, 2013, 23 Pages. doi:10.1145/2400682.2400713
[19] M. Song and E. Tilevich, “Reusing Non-Functional Concerns across Languages,” Proceedings of the 11th Annual International Conference on Aspect-Oriented Software Development (AOSD ’12), Postdam, 25-30 March 2012, pp. 227-238. doi:10.1145/2162049.2162076
[20] [LLVM] http://llvm.org/
[21] [CIL] http://www.scriptol.com/programming/cil.php
[22] [ROSE] http://www.rosecompiler.org/
[23] T. A. Standish, D. F. Kibler and J. M. Neighbors, “Improving and Refining Programs by Program Manipulation,” Proceedings of the 1976 Annual Conference (ACM ’76), Houston, 20-22 October 1976, pp. 509-516.
[24] J. J. Arsac, “Syntactic Source to Source Transforms and Program Manipulation,” Communications of the ACM, Vol. 22, No. 1, 1979, pp. 43-54. doi:10.1145/359046.359057
[25] R. D. Cameron and M. R. Ito, “Grammar-Based Definition of Metaprogramming Systems,” ACM Transactions on Programming Languages and Systems, Vol. 6, No. 1, 1984, pp. 20-54. doi:10.1145/357233.357235
[26] D. J. Kuck, R. H. Kuhn, D. A. Padua, B. Leasure and M. Wolfe, “Dependence Graphs and Compiler Optimizations,” Proceedings of the 8th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages (POPL ’81), Williamsburg, 26-28 January 1981, pp. 207-218.
[27] S. Lee, S.-J. Min and R. Eigenmann, “OpenMP to GPGPU: A Compiler Framework for Automatic Translation and Optimization,” Proceedings of the 14th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PpoPP ’09), Vol. 44, No. 4, 2009, pp. 101-110.
[28] A. Basumallik and R. Eigenmann, “Towards Automatic Translation of OpenMP to MPI,” Proceedings of the 19th Annual International Conference on Supercomputing (ICS ’05), 2005, pp. 189-198.
[29] J. Prosise, “Programming Microsoft .NET,” Microsoft Press, Redmond, 2002.
[30] M. Molloy, K. Andrews, J. Herren, D. Cutler and P. Del Vigna, “Automatic Interoperability Test Generation for Source-to-Source Translators,” Proceedings of the 1998 ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA ’98), Vol. 23, No. 2, 1998, pp. 93-101.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.