Skip to main content

The Essence of Ruby

  • Conference paper
Book cover Programming Languages and Systems (APLAS 2014)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8858))

Included in the following conference series:

  • 933 Accesses

Abstract

Ruby is a dynamic, object-oriented language with advanced features such as yield operator and dynamic class manipulation. They make Ruby a popular, highly productive scripting language, but they also make the semantics of Ruby complicated and difficult to understand. Even the JIS/ISO standard of Ruby seems to contain some ambiguities. For Ruby to be established as a reliable scripting language, it should have a rigorous semantics. To meet this challenge, we present a formal operational semantics that can serve as a high-level specification for both the users and implementers. The key insight underlying the semantics is that various elaborate features of Ruby can be cleanly represented as a composition of two orthogonal calculi: one for objects and classes and the other for representing control. The presented semantics leads straightforwardly to a reference implementation. Initial evaluation of our implementation confirms that the presented semantics conforms to commonly accepted Ruby behavior.

The first author has been partially supported by JSPS KAKENHI Grant Number 24700021. The first and fourth author has been partially supported by JSPS KAKENHI Grant Number 25280019.

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. Abadi, M., Cardelli, L.: A Theory of Objects. Springer, Heidelberg (1996)

    Book  MATH  Google Scholar 

  2. An, J.-H., Chaudhuri, A., Foster, J.S.: Static typing for Ruby on Rails. In: IEEE/ACM International Conference on Automated Software Engineering, pp. 590–594 (2009)

    Google Scholar 

  3. An, J.-H., Chaudhuri, A., Foster, J.S., Hicks, M.: Dynamic inference of static types for Ruby. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 459–472 (2011)

    Google Scholar 

  4. Furr, M., An, J.-H., Foster, J.S.: Profile-guided static typing for dynamic scripting languages. In: ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications, pp. 283–300 (2009)

    Google Scholar 

  5. Furr, M., An, J.-H., Foster, J.S., Hicks, M.: The Ruby intermediate language. In: Symposium on Dynamic Languages, pp. 89–98 (2009)

    Google Scholar 

  6. Furr, M., An, J.-H., Foster, J.S., Hicks, M.: Static type inference for Ruby. In: ACM Symposium on Applied Computing, pp. 1859–1866 (2009)

    Google Scholar 

  7. Guha, A., Saftoiu, C., Krishnamurthi, S.: The essence of JavaScript. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 126–150. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  8. ISO/IEC 30170:2012, Information technology – Programming languages – Ruby (2012)

    Google Scholar 

  9. James, R.P., Sabry, A.: Yield: Mainstream delimited continuations. In: Workshop on the Theory and Practice of Delimited Continuations, pp. 20–32 (2011)

    Google Scholar 

  10. JIS X 3017:2011, Programming languages – Ruby (2011)

    Google Scholar 

  11. Kahn, G.: Natural semantics. In: Brandenburg, F.J., Vidal-Naquet, G., Wirsing, M. (eds.) STACS 1987. LNCS, vol. 247, pp. 22–39. Springer, Heidelberg (1987)

    Chapter  Google Scholar 

  12. Maffeis, S., Mitchell, J.C., Taly, A.: An operational semantics for JavaScript. In: Ramalingam, G. (ed.) APLAS 2008. LNCS, vol. 5356, pp. 307–325. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  13. Milner, R., Tofte, M., MacQueen, D.: The Definition of Standard ML. MIT Press (1997)

    Google Scholar 

  14. Politz, J.G., Martinez, A., Milano, M., Warren, S., Patterson, D., Li, J., Chitipothu, A., Krishnamurthi, S.: Python: the full monty. In: ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages and Applications, pp. 217–232 (2013)

    Google Scholar 

  15. Ruby programming language, http://www.ruby-lang.org/en/

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Ueno, K., Fukasawa, Y., Morihata, A., Ohori, A. (2014). The Essence of Ruby. In: Garrigue, J. (eds) Programming Languages and Systems. APLAS 2014. Lecture Notes in Computer Science, vol 8858. Springer, Cham. https://doi.org/10.1007/978-3-319-12736-1_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-12736-1_5

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-12735-4

  • Online ISBN: 978-3-319-12736-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics