Abstract
For a compiler writer, generating good machine code for a variety of platforms is hard work. One might try to reuse a retargetable code generator, but code generators are complex and difficult to use, and they limit one’s choice of implementation language. One might try to use C as a portable assembly language, but C limits the compiler writer’s flexibility and the performance of the resulting code. The wide use of C, despite these drawbacks, argues for a portable assembly language. C-— is a new language designed expressly for this purpose. The use of a portable assembly language introduces new problems in the support of such high-level run-time services as garbage collection, exception handling, concurrency, profiling, and debugging. We address these problems by combining the C-— language with a C-— run-time interface. The combination is designed to allow the compiler writer a choice of source-language semantics and implementation techniques, while still providing good performance.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Appel, A.W.: Simple generational garbage collection and fast allocation. Software—Practice & Experience 19(2), 171–183 (1989)
Russ, A., Demers, A., Hauser, C., Jacobi, C., Kessler, P., Weiser, M.: Experiences creating a portable Cedar. In: Proceedings of the 1989 SIGPLAN Conference on Programming Language Design and Implementation, SIGPLAN Notices, vol. 24(7), pp. 322–329 (1989)
Bartlett, J.F.: Compacting garbage collection with ambiguous roots. Technical Report 88/2, DEC WRL, 100 Hamilton Avenue, Palo Alto, California 94301 (February 1988)
Bartlett, J.F.: Mostly-copying garbage collection picks up generations and C++. Technical Report TN-12, DEC WRL, 100 Hamilton Avenue, Palo Alto, California 94301 (October 1989a)
Bartlett, J.F.: SCHEME to C: A portable Scheme-to-C compiler. Technical Report RR 89/1, DEC WRL (1989b)
Benitez, M.E., Davidson, J.W.: A portable global optimizer and linker. In: ACM Conference on Programming Languages Design and Implementation (PLDI 1988), pp. 329–338. ACM, New York (1988)
Nick, B., Kennedy, A., Russell, G.: Compiling Standard ML to Java bytecodes. In: ACM Sigplan International Conference on Functional Programming (ICFP 1998), Balitmore, pp. 129–140 (1998)
Bernstein, R.L.: Producing good code for the case statement. Software Practice and Experience 15(10), 1021–1024 (1985)
Boehm, H.-J., Weiser, M.: Garbage collection in an uncooperative environment. Software Practice and Experience 18(9), 807–820 (1988)
Chase, D.: Implementation of exception handling, Part I. The Journal of C Language Translation 5(4), 229–240 (1994a)
Chase, D.: Implementation of exception handling, Part II: Calling conventions, asynchrony, optimizers, and debuggers. The Journal of C Language Translation 6(1), 20–32 (1994b)
Clausen, L.R., Danvy, O.: Compiling proper tail recursion and first-class continuations: Scheme on the Java virtual machine. Technical report, Department of Computer Science, University of Aarhus, BRICS (April 1998)
Conway, M.E.: Proposal for an UNCOL. Communications of the ACM 1(10), 5–8 (1958)
Diwan, A., Tarditi, D., Moss, E.: Memory subsystem performance of programs using copying garbage collection. In: 21st ACM Symposium on Principles of Programming Languages (POPL 1994), pp. 1–14. ACM, Charleston (1993)
Franz, M.: Beyond Java: An infrastructure for highperformance mobile code on theWorld WideWeb. In: Lobodzinski, S., Tomek, I. (eds.) Proceedings of WebNet 1997, World Conference of the WWW, Internet, and Intranet, pp. 33–38 (1997); Association for the Advancement of Computing in Education
George, L.: MLRISC: Customizable and reusable code generators (1996), Unpublished report, available from http://www.cs.bell-labs.com/george/
Harbison, S.P., Steele Jr. G.L.: C: A Reference Manual, 4th edn. Prentice Hall, Englewood Cliffs (1995)
Fergus, H., Conway, T., Somogyi, Z.: Compiling logic programs to C using GNU C as a portable assembler. In: ILPS 1995 Postconference Workshop on Sequential Implementation Technologies for Logic Programming, Portland, pp. 1–15 (1995)
Liskov, B.H., Snyder, A.: Exception handling in CLU. IEEE Transactions on Software Engineering SE-5(6), 546–558 (1979)
Macrakis, S.: The Structure of ANDF: Principles and Examples. Open Systems Foundation (January 1993)
Steven, N., Hummel, J., Nicolau, A.: A Simple Mechanism for Improving the Accuracy and Efficiency of Instruction-level Disambiguation. LNCS, vol. ch. 19. Springer, Heidelberg (1995)
Pettersson, M.: Simulating tail calls in C. Technical report, Department of Computer Science, Linkoping University (1995)
Jones, P., Simon, L., Gordon, A.J., Finne, S.O.: Concurrent Haskell. In: Symposium on Principles of Programming Languages (POPL 1996), pp. 295–308. St Petersburg Beach, Florida (January 1996)
Peyton Jones, S.L., Oliva, D., Nordin, T.: C–: A portable assembly language. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 1–19. Springer, Heidelberg (1998)
Jones, P., Simon, L.: Implementing lazy functional languages on stock hardware: The spineless tagless G-machine. Journal of Functional Programming 2(2), 127–202 (1992)
Ramsey, N., Peyton Jones, S.L.: Exceptions need not be exceptional (1999); Draft available from http://www.cs.virginia.edu/nr
Ramsey, Norman.: A Retargetable Debugger. PhD thesis, Princeton University, Department of Computer Science. Also Technical Report CS-TR- 403-92 (December 1992)
Reig, F., Peyton Jones, S.L.: The C– manual. Technical report, Department of Computing Science, University of Glasgow (1998)
Reppy, J.H.: CML: a higher-order concurrent language. In: ACM Conference on Programming Languages Design and Implementation (PLDI 1991), June 1991, ACM, New York (1991)
Serrano M., Weis, P.: In: Mycroft, A. (ed.) SAS 1995. LNCS, vol. 983, pp. 366–381. Springer, Heidelberg (1995)
Shivers, O., Clark, J.W., McGrath, R.: Atomic heap transactions and fine-grain interrupts. In: ACM Sigplan International Conference on Functional Programming (ICFP 1999), Paris (September 1999)
SPARC International. The SPARC Architecture Manual, Version 8. Prentice Hall, Englewood Cliffs (1992)
Stallman, R,M.: Using and Porting GNU CC (Version 2.0). Free Software Foundation (February 1992 )
Steele, Jr., G.L.: . Rabbit : A compiler for Scheme. Technical Report AI-TR-474, Artificial Intelligence Laboratory, MIT, Cambridge, MA (May 1978 )
Stichnoth, J.M., Lueh, G.-Y., Cierniak, M.: Suppport for garbage collection at every instruction in a Java compiler. In: ACM Conference on Programming Languages Design and Implementation (PLDI 1999), Atlanta, pp. 118–127 (1999)
Taft, T.: Programming the Internet in Ada 95. In: Strohmeier, A. (ed.) Ada-Europe 1996. LNCS, vol. 1088, pp. 1–16. Springer, Heidelberg (1996)
Tarditi, D.: No assembly required: compiling Standard ML to C. ACM Letters on Programming Languages and Systems 1(2), 161–177 (1992)
Tarditi, D., Morrisett, G., Cheng, P., Stone, C., Harper, R., Lee, P.: TIL: A type-directed optimizing compiler for ML. In: ACM Conference on Programming Languages Design and Implementation (PLDI 1996), pp. 181–192. ACM, Philadelphia (1996)
Wakeling, D.: Mobile Haskell: compiling lazy functional languages for the Java virtual machine. In: Proceedings of the 10th International Symposium on Programming Languages, Implementations, Logics and Programs, PLILP 1998 Pisa (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jones, S.P., Ramsey, N., Reig, F. (1999). C-—: A Portable Assembly Language that Supports Garbage Collection. In: Nadathur, G. (eds) Principles and Practice of Declarative Programming. PPDP 1999. Lecture Notes in Computer Science, vol 1702. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10704567_1
Download citation
DOI: https://doi.org/10.1007/10704567_1
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66540-3
Online ISBN: 978-3-540-48164-5
eBook Packages: Springer Book Archive