Skip to main content

Programming with Multiple Paradigms in Lua

  • Conference paper
Functional and Constraint Logic Programming (WFLP 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5979))

Included in the following conference series:

Abstract

Lua is a scripting language used in many industrial applications, with an emphasis on embedded systems and games. Two key points in the design of the language that led to its widely adoption are flexibility and small size. To achieve these two conflicting goals, the design emphasizes the use of few but powerful mechanisms, such as first-class functions, associative arrays, coroutines, and reflexive capabilities. As a consequence of this design, although Lua is primarily a procedural language, it is frequently used in several different programming paradigms, such as functional, object-oriented, goal-oriented, and concurrent programming, and also for data description.

In this paper we discuss what mechanisms Lua features to achieve its flexibility and how programmers use them for different paradigms.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Millington, I.: Artificial Intelligence for Games. Morgan Kaufmann, San Francisco (2006)

    Google Scholar 

  2. Associação Brasileira de Normas Técnicas: Televisão digital terrestre – Codificação de dados e especificações de transmissão para radiodifusão digital, ABNT NBR 15606-2 (2007)

    Google Scholar 

  3. Hempel, R.: Porting Lua to a microcontroller. In: de Figueiredo, L.H., Celes, W., Ierusalimschy, R. (eds.) Lua Programming Gems. Lua.org (2008)

    Google Scholar 

  4. Ierusalimschy, R.: Programming in Lua. second edn. Lua.org, Rio de Janeiro, Brazil (2006)

    Google Scholar 

  5. Ierusalimschy, R., de Figueiredo, L.H., Celes, W.: Lua 5.1 Reference Manual. Lua.org, Rio de Janeiro, Brazil (2006)

    Google Scholar 

  6. de Moura, A.L., Ierusalimschy, R.: Revisiting coroutines. ACM Transactions on Programming Languages and Systems 31(2), 6.1–6.31 (2009)

    Google Scholar 

  7. Ousterhout, J.K.: Scripting: Higher level programming for the 21st century. IEEE Computer 31(3) (March 1998)

    Google Scholar 

  8. Ierusalimschy, R., de Figueiredo, L.H., Celes, W.: The evolution of Lua. In: Third ACM SIGPLAN Conference on History of Programming Languages, San Diego, CA, June 2007, pp. 2.1–2.26 (2007)

    Google Scholar 

  9. Lamport, L.: LaTeX: A Document Preparation System. Addison-Wesley, Reading (1986)

    Google Scholar 

  10. Koyama, T., et al.: Simulation tools for damping in high frequency resonators. In: 4th IEEE Conference on Sensors, pp. 349–352. IEEE, Los Alamitos (2005)

    Google Scholar 

  11. Ueno, Y., Arita, M., Kumagai, T., Asai, K.: Processing sequence annotation data using the Lua programming language. Genome Informatics 14, 154–163 (2003)

    Google Scholar 

  12. Kelsey, R., Clinger, W., Rees, J.: Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computation 11(1), 7–105 (1998)

    Article  Google Scholar 

  13. Nehab, D.: Filters, sources, sinks and pumps, or functional programming for the rest of us. In: de Figueiredo, L.H., Celes, W., Ierusalimschy, R. (eds.) Lua Programming Gems, pp. 97–107. Lua.org (2008)

    Google Scholar 

  14. Steele Jr., G.L.: Rabbit: A compiler for Scheme. Technical Report AITR-474, MIT, Cambridge, MA (1978)

    Google Scholar 

  15. Adams, N., Kranz, D., Kelsey, R., Rees, J., Hudak, P., Philbin, J.: ORBIT: an optimizing compiler for Scheme. SIGPLAN Notices 21(7) (July 1986); (SIGPLAN 1986)

    Google Scholar 

  16. Ierusalimschy, R., de Figueiredo, L.H., Celes, W.: The implementation of Lua 5.0. Journal of Universal Computer Science 11(7), 1159–1176 (2005); (SBLP 2005)

    Google Scholar 

  17. Ungar, D., Smith, R.B.: Self: The power of simplicity. SIGPLAN Notices 22(12), 227–242 (1987); (OOPLSA 1987)

    Article  Google Scholar 

  18. Lieberman, H.: Using prototypical objects to implement shared behavior in object-oriented systems. SIGPLAN Notices 21(11), 214–223 (1986); (OOPLSA 1986)

    Article  MathSciNet  Google Scholar 

  19. Griswold, R., Griswold, M.: The Icon Programming Language. Prentice-Hall, New Jersey (1983)

    Google Scholar 

  20. Clocksin, W., Mellish, C.: Programming in Prolog. Springer, Heidelberg (1981)

    MATH  Google Scholar 

  21. Hutton, G.: Higher-order functions for parsing. Journal of Functional Programming 2(3), 323–343 (1992)

    Article  MATH  MathSciNet  Google Scholar 

  22. de Moura, A.L., Rodriguez, N., Ierusalimschy, R.: Coroutines in Lua. Journal of Universal Computer Science 10(7), 910–925 (2004); (SBLP 2004)

    Google Scholar 

  23. Haynes, C.T.: Logic continuations. J. Logic Programming 4, 157–176 (1987)

    Article  MATH  Google Scholar 

  24. Wand, M., Vaillancourt, D.: Relating models of backtracking. In: Proceedings of the Ninth ACM SIGPLAN International Conference on Functional Programming, Snowbird, UT, pp. 54–65. ACM, New York (2004)

    Chapter  Google Scholar 

  25. Ierusalimschy, R., de Moura, A.L.: Some proofs about coroutines. Monografias em Ciência da Computação 04/08, PUC-Rio, Rio de Janeiro, Brazil (2008)

    Google Scholar 

  26. Ousterhout, J.K.: Why threads are a bad idea (for most purposes). In: USENIX Technical Conference (January 1996)

    Google Scholar 

  27. Birtwistle, G., Dahl, O., Myhrhaug, B., Nygaard, K.: Simula Begin. Petrocelli Charter (1975)

    Google Scholar 

  28. Kauppi, A.: Lua Lanes — multithreading in Lua (2009), http://kotisivu.dnainternet.net/askok/bin/lanes/

  29. Skyrme, A., Rodriguez, N., Ierusalimschy, R.: Exploring Lua for concurrent programming. In: XII Brazilian Symposium on Programming Languages, Fortaleza, CE, August 2008, pp. 117–128 (2008)

    Google Scholar 

  30. Fernandes, F., Batista, T.: Dynamic aspect-oriented programming: An interpreted approach. In: Proceedings of the 2004 Dynamic Aspects Workshop (DAW 2004), March 2004, pp. 44–50 (2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Ierusalimschy, R. (2010). Programming with Multiple Paradigms in Lua. In: Escobar, S. (eds) Functional and Constraint Logic Programming. WFLP 2009. Lecture Notes in Computer Science, vol 5979. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-11999-6_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-11999-6_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-11998-9

  • Online ISBN: 978-3-642-11999-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics