Higher-Order and Symbolic Computation

, Volume 18, Issue 3–4, pp 271–298 | Cite as

BIT: A Very Compact Scheme System for Microcontrollers

Article

Abstract

We present a compact implementation of Scheme for microcontrollers that includes a real-time garbage collector. The compiler runs on a normal workstation and produces byte-code from the source program. A smart linker links the byte-code with the runtime module. We demonstrate that with this system it is clearly possible to run realistic Scheme programs on a microcontroller with as little as 3 to 4 KB of RAM. Programs that access the whole Scheme library require only 13 KB of ROM. As a byproduct of this research, we designed a novel space-efficient real-time GC algorithm.

Keywords

Scheme language microcontroller embedded system byte-code real-time garbage collection 

Abbreviation

GC

garbage collector

RAM

random-access memory

ROM

read-only memory

FLASH

non-volatile random-access memory

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Abelson, H., Adams, N.I., Bartley, D.H., Brooks, G., Dybvig, R.K., Friedman, D.P., Halstead, R., Hanson, C., Haynes, C.T., Kohlbecker, E., Oxley, D., Pitman, K.M., Rozas, G.J., Steele, G.L., Sussman, G.J., and Wand, M. Revised4 report on the Algorithmic Language Scheme, 1991.Google Scholar
  2. 2.
    Bacon, D.F., Cheng, P., and Rajan, V. A Real-time garbage collector with low overhead and consistent utilization. In Proceedings of the Symposium on Principles of Programming Language, 2003, pp. 285–298.Google Scholar
  3. 3.
    Baker, H.G. List processing in real-time on a serial computer. Communications of the ACM, 21(4) (1978) 280–294.CrossRefMATHGoogle Scholar
  4. 4.
    Bayer, F. LispMe implementation. http://www.lispme.de/lispme/index.html.
  5. 5.
    Brooks, R.A. Trading data space for reduced time and code space in real-time collection on stock hardware. In Proceedings of the 1984 ACM Symposium on Lisp and Functional Programming, 1984 pp. 108–113.Google Scholar
  6. 6.
  7. 7.
    Chen, Z. Java Card Technology for Smart Cards: Architecture and Programmer's Guide. Addison-Wesley, 2000.Google Scholar
  8. 8.
    Crettol, D. QScheme implementation. http://www.sof.ch/dan/qscheme/index-e.html.
  9. 9.
    Dubé, D., Feeley, M., and Serrano, M. Un GC temps réel semi-compactant. In Actes des Journées Francophones des Langages Applicatifs 1996, 1996.Google Scholar
  10. 10.
    Feeley, M. Gambit implementation. http://www.iro.umontreal.ca/~gambit/.
  11. 11.
    Feeley, M. and Lapalme, G. Closure generation based on viewing Lambda as Epsilon plus compile. Journal of Computer Languages, 17(4) (1992) 251–267.Google Scholar
  12. 12.
    Goetter, B. Pocket Scheme implementation. http://www.mazama.net/scheme/pscheme.htm.
  13. 13.
    Goldberg, A. and Robson, D. Smalltalk-80: The Language and Its Implementation. Addison-Wesley Longman Publishing Co., Inc., 1983.Google Scholar
  14. 14.
    Gudeman, D. Representing type information in dynamically typed languages. Technical Report TR 93-27, Department of Computer Science, The University of Arizona, 1993.Google Scholar
  15. 15.
    Jaffer, A. SCM implementation. http://swissnet.ai.mit.edu/~jaffer/SCM.html.
  16. 16.
    Larose, M. and Feeley, M. A compacting incremental collector and its performance in a production quality compiler. ACM SIG-PLAN Notices, 34(3) (1999) 1–9.Google Scholar
  17. 17.
    Latendresse, M. Automatic generation of compact programs and virtual machines for Scheme. In Proceedings of the Workshop on Scheme and Functional Programming. M. Felleisen (Ed.). 2000, pp. 45–52.Google Scholar
  18. 18.
    Latendresse, M. Génération de machines virtuelles pour l'exécution de programmes compressés'. Ph.D. thesis, Université de Montréal, DIRO 2000b.Google Scholar
  19. 19.
    Latendresse, M. and Feeley, M. Generation of fast interpreters for Huffman compressed bytecode. In Proceedings of the ACM SIGPLAN Workshop on Interpreters, Virtual Machines and Emulators 2003.Google Scholar
  20. 20.
    Lee, J. fools implementation. ftp://ftp.cs.indiana.edu/pub/scheme-repository/imp/fools.1.3.2.tar.gz.Google Scholar
  21. 21.
    Moriwaki, A. Mini-Scheme implementation. ftp://ftp.cs.indiana.edu/pub/scheme-repository/imp/minischeme.tar.gz.Google Scholar
  22. 22.
    Shao, Z. and Appel, A.W. Efficient and safe-for-space closure conversion. ACM Transactions on Programming Languages and Systems, 22(1) (2000) 129–161.CrossRefGoogle Scholar
  23. 23.
    Shivers, O. The semantics of scheme control-flow analysis. In Proceedings of the Symposium on Partial Evaluation and Semantics-based Program Manipulation, 1991 pp. 190–198.Google Scholar
  24. 24.
    Siebert, F. Hard Real-time garbage collection in the Jamaica Virtual Machine. In Proceedings of the Sixth International Conference on Real-Time Computing Systems and Application. Hong Kong, China, 1999 pp. 96–102.Google Scholar
  25. 25.
    Smith, C. Vx-Scheme implementation. http://colin-smith.net/vx-scheme/.
  26. 26.
    Souflis, D. TinyScheme implementation. http://tinyscheme.sourceforge.net/.
  27. 27.
    Wick, A.C., Wagner, M., and Klipsch, K. LEGO/Scheme implementation. http://www.cs.indiana.edu/~mtwagner/legoscheme/.
  28. 28.
    Wilson, P.R. Uniprocessor garbage collection techniques. Lecture Notes in Computer Science, 637 (1992) 1–42.Google Scholar
  29. 29.
    Wilson, P.R. and Johnstone, M.S. Real-time non-copying garbage collection. In ACM OOPSLA Workshop on Memory Management and Garbage Collection. Washington D.C, 1993.Google Scholar
  30. 30.
    Wilson, P.R. and Johnstone, M.S. Truly Real-time non-copying garbage collection. In OOPSLA/ECOOP Workshop on Garbage Collection in Object-Oriented Systems. E. Moss, P.R. Wilson, and B. Zorn (Eds.). 1993.Google Scholar
  31. 31.
    Yuasa, T. XS: Lisp on Lego MindStorms. In International Lisp Conference 2003, 2003.Google Scholar

Copyright information

© Springer Science + Business Media, Inc. 2005

Authors and Affiliations

  1. 1.Département d'informatique et de génie logicielUniversité LavalSainte-FoyCanada
  2. 2.Département d'informatique et de recherche opérationnelleUniversité de MontréalMontréalCanada

Personalised recommendations