Advertisement

Modules as Objects in Newspeak

  • Gilad Bracha
  • Peter von der Ahé
  • Vassili Bykov
  • Yaron Kashai
  • William Maddox
  • Eliot Miranda
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6183)

Abstract

We describe support for modularity in Newspeak, a programming language descended from Smalltalk [33] and Self [69]. Like Self, all computation — even an object’s own access to its internal structure — is performed by invoking methods on objects. However, like Smalltalk, Newspeak is class-based. Classes can be nested arbitrarily, as in Beta [44]. Since all names denote method invocations, all classes are virtual; in particular, superclasses are virtual, so all classes act as mixins. Unlike its predecessors, there is no static state in Newspeak, nor is there a global namespace. Modularity in Newspeak is based exclusively on class nesting. There are no separate modularity constructs such as packages. Top level classes act as module definitions, which are independent, immutable, self-contained parametric namespaces. They can be instantiated into modules which may be stateful and mutually recursive.

Keywords

Method Invocation Instance Initializer Virtual Classis Class Declaration Recursive Module 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Java module system, Java Community Process JSR 277, now defunct, described, http://jcp.org/en/jsr/detail?id=277
  2. 2.
    Java on Guice: Guice user’s guide, http://code.google.com/p/google-guice/
  3. 3.
  4. 4.
    OSGi service platform specification, release 4.2, http://www.osgi.org
  5. 5.
    Securable modules proposal for Javascript, https://wiki.mozilla.org/ServerJS/Modules/SecurableModules
  6. 6.
    Allen, E., Chase, D., Luchangco, V., Maessen, J.W., Ryu, S., Steele, G., Tobin-Hochstadt, S.: The Fortress language specification (2005), http://research.sun.com/projects/plrg/
  7. 7.
    Ancona, D., Fagorzi, S., Moggi, E., Zucca, E.: Mixin modules and computational effects. In: Goos, G., Hartmanis, J., van Leeuwen, J. (eds.) ICALP 2003. LNCS, vol. 2719, pp. 224–238. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  8. 8.
    Ancona, D., Zucca, E.: A calculus of module systems. Journ. of Functional Programming 12(2), 91–132 (2002), http://www.disi.unige.it/person/AnconaD/Software/Java/CMS.html
  9. 9.
    Aracic, I., Gasiunas, V., Mezini, M., Ostermann, K.: Overview of CaesarJ. In: Rashid, A., Aksit, M. (eds.) Transactions on Aspect-Oriented Software Development I. LNCS, vol. 3880, pp. 135–173. Springer, Heidelberg (2006), http://www.daimi.au.dk/~ko/papers/overview-of-caesarj-2005.pdf Google Scholar
  10. 10.
    Awad, I.: Module identification and loading for Javascript, http://docs.google.com/Doc?id=dfgxb7gk61d47876fr
  11. 11.
    Baldwin, C.Y., Clark, K.B.: Design Rules: The Power of Modularity. MIT Press, Cambridge (2000)Google Scholar
  12. 12.
    Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Classboxes: controlling visibility of class extensions. Computer Languages, Systems & Structures 31 (October 2005)Google Scholar
  13. 13.
    Bracha, G.: Objects as software services. In: Invited talk at OOPSLA (2005), Dynamic Languages Symposium (2005), http://video.google.com/videoplay?docid=-162051834912297779, http://bracha.org/objectsAsSoftwareServices.pdf Unpublished manuscript
  14. 14.
    Bracha, G.: The Programming Language Jigsaw: Mixins, Modularity and Multiple Inheritance. Ph.D. thesis, University of Utah (1992)Google Scholar
  15. 15.
    Bracha, G.: Pluggable type systems. In: OOPSLA Workshop on Revival of Dynamic Languages (October 2004), http://pico.vub.ac.be/%7Ewdmeuter/RDL04/papers/Bracha.pdf
  16. 16.
    Bracha, G.: The Newspeak programming language specification, version 0.05 (2009), http://bracha.org/newspeak-spec.pdf
  17. 17.
    Bracha, G., Cook, W.: Mixin-based inheritance. In: Proc. of the Joint ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications and the European Conference on Object-Oriented Programming (October 1990)Google Scholar
  18. 18.
    Bracha, G., Ungar, D.: Mirrors: Design principles for meta-level facilities of object-oriented programming languages. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (October 2004)Google Scholar
  19. 19.
    Bykov, V.: Hopscotch: Towards user interface composition. In: ECOOP 2008 International Workshop on Advanced Software Development Tools and Techniques (WASDeTT) (July 2008)Google Scholar
  20. 20.
    Clarke, D., Drossopoulou, S., Noble, J., Wrigstad, T.: Tribe: a simple virtual class calculus. In: AOSD 2007: Proceedings of the 6th international conference on Aspect-oriented software development, pp. 121–134. ACM Press, New York (2007)CrossRefGoogle Scholar
  21. 21.
    Corwin, J., Bacon, D.F., Grove, D., Murthy, C.: MJ: a rational module system for java and its applications. In: OOPSLA 2003: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, pp. 241–254. ACM, New York (2003)CrossRefGoogle Scholar
  22. 22.
    van Cutsem, T.: Ambient References: Object Designation in Mobile Ad Hoc Networks. Ph.D. thesis, Vrije Universiteit Brussel (2008)Google Scholar
  23. 23.
    Dreyer, D., Crary, K., Harper, R.: A type system for higher-order modules. In: POPL 2003: Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 236–249. ACM, New York (2003)CrossRefGoogle Scholar
  24. 24.
    Dreyer, D., Rossberg, A.: Mixin’ up the ML module system. In: Proc. of the ACM SIGPLAN International Conference on Functional Programming (2008)Google Scholar
  25. 25.
    Duggan, D., Techaubol, C.C.: Modular mixin-based inheritance for application frameworks. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (2001)Google Scholar
  26. 26.
    Ernst, E.: gbeta – a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. Ph.D. thesis, Department of Computer Science, University of Aarhus, Århus, Denmark (1999)Google Scholar
  27. 27.
    Ernst, E.: Propagating class and method combination. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 67–91. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  28. 28.
    Ernst, E.: Higher-order hierarchies. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 303–329. Springer, Heidelberg (2003)Google Scholar
  29. 29.
    Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: Proc. of the ACM Symp. on Principles of Programming Languages (2006)Google Scholar
  30. 30.
    Findler, R.B., Flatt, M.: Modular object-oriented programming with units and mixins. In: Proc. of the ACM SIGPLAN International Conference on Functional Programming, pp. 94–104 (1998)Google Scholar
  31. 31.
    Flatt, M., Felleisen, M.: Units: Cool modules for HOT languages. In: Proc. of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 236–248 (1998)Google Scholar
  32. 32.
    Gasiunas, V., Mezini, M., Ostermann, K.: Dependent classes. In: ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2007). ACM Press, New York (2007), http://www.daimi.au.dk/~ko/papers/depcls-oopsla07.pdf
  33. 33.
    Goldberg, A., Robson, D.: Smalltalk-80: the Language and Its Implementation. Addison-Wesley, Reading (1983)MATHGoogle Scholar
  34. 34.
    Gong, L., Ellison, G., Dageforde, M.: Inside Java(TM) 2 Platform Security: Architecture, API Design, and Implementation, 2nd edn. Addison-Wesley, Reading (2003)Google Scholar
  35. 35.
    Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. Addison-Wesley, Reading (2005)Google Scholar
  36. 36.
    Knudsen, J.L., Lofgren, M., Madsen, O.L., Magnusson, B.: Object-oriented environments: The Mjolner approach. Prentice-Hall, Englewood Cliffs (1994)Google Scholar
  37. 37.
    Leroy, X.: A proposal for recursive modules in Objective Caml, http://caml.inria.fr/pub/papers/xleroy-recursive_modules-03.pdf
  38. 38.
    Liang, S., Bracha, G.: Dynamic class loading in the Java virtual machine. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (1998)Google Scholar
  39. 39.
    Liu, Y.D., Smith, S.: Interaction-based programming with classages. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (2005)Google Scholar
  40. 40.
    Liu, Y.D., Smith, S.: A formal framework for component deployment. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (2006)Google Scholar
  41. 41.
    MacQueen, D.: Modules for Standard ML. In: Proc. of the ACM Conf. on Lisp and Functional Programming, pp. 198–207 (August 1984)Google Scholar
  42. 42.
    Madsen, O.L.: Semantic analysis of virtual classes and nested classes. In: OOPSLA 1999: Proceedings of the 14th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pp. 114–131. ACM, New York (1999)CrossRefGoogle Scholar
  43. 43.
    Madsen, O.L., Møller-Pedersen, B.: Virtual classes: A powerful mechanism in object-oriented programming. In: Proceedings OOPSLA 1989, ACM SIGPLAN Notices, pp. 397–406 (October 1989); published as Proceedings OOPSLA 1989, ACM SIGPLAN Notices, vol. 24(10) (1989)Google Scholar
  44. 44.
    Madsen, O.L., Møller-Pedersen, B., Nygaard, K.: Object-Oriented Programming in the Beta Programming Language. Addison-Wesley, Reading (1993)Google Scholar
  45. 45.
    McDirmid, S., Flatt, M., Hsieh, W.: Jiazzi: New age components for old fashioned java. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (2001)Google Scholar
  46. 46.
    Mettler, A., Wagner, D.: The Joe-E language specification, version 1.0. Tech. Rep. UCB/EECS-2008-91, University of California at Berkeley (2008), http://www.eecs.berkeley.edu/Pubs/TechRpts/2008/EECS-2008-91.pdf
  47. 47.
    Miller, M.S.: Robust Composition: Towards a Unified Approach to Access Control and Concurrency Control. Ph.D. thesis, Johns Hopkins University, Baltimore, Maryland, USA (May 2006)Google Scholar
  48. 48.
    Miranda, E.: Newspeak FFI internal documentation, http://wiki.squeak.org/squeak/uploads/6100/Alien%20FFI.pdf
  49. 49.
    Mostinckx, S., Van Cutsem, T., Timbermont, S., Tanter, E.: Mirages: behavioral intercession in a mirror-based architecture. In: DLS 2007: Proceedings of the 2007 symposium on Dynamic languages, pp. 89–100. ACM, New York (2007)CrossRefGoogle Scholar
  50. 50.
    Nakata, K., Garrigue, J.: Recursive modules for programming. In: ICFP 2006: Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming, pp. 74–86. ACM, New York (2006)CrossRefGoogle Scholar
  51. 51.
    Nystrom, N., Qi, X., Myers, A.C.: J&: Software composition with nested intersection. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (2006)Google Scholar
  52. 52.
    Nystrom, N.J.: Programming Languages for Scalable Software Extension and Composition. Ph.D. thesis, Dept. of Computer Science, Cornell University (2007)Google Scholar
  53. 53.
    Odersky, M., Spoon, L., Venners, B.: Programming in Scala. Artima Press, Mountain View (2008)Google Scholar
  54. 54.
    Odersky, M., Zenger, M.: Scalable component abstractions. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications, pp. 41–57 (2005)Google Scholar
  55. 55.
    Ossher, H., Harrison, W.: Combination of inheritance hierarchies. In: Proceedings OOPSLA 1992, ACM SIGPLAN Notices, pp. 25–40 (October 1992); published as Proceedings OOPSLA 1992, ACM SIGPLAN Notices, vol. 27(10) (1992)Google Scholar
  56. 56.
    Ramsey, N., Fisher, K., Govereau, P.: An expressive language of signatures. In: ICFP 2005: Proceedings of the tenth ACM SIGPLAN international conference on Functional programming, pp. 27–40. ACM, New York (2005)CrossRefGoogle Scholar
  57. 57.
    Rinat, R., Smith, S.: Modular internet programming with cells. In: European Conference on Object-Oriented Programming (2002)Google Scholar
  58. 58.
    Russo, C.V.: Recursive structures for standard ML. In: ICFP 2001: Proceedings of the sixth ACM SIGPLAN international conference on Functional programming, pp. 50–61. ACM, New York (2001)CrossRefGoogle Scholar
  59. 59.
    Schmidt, R.W.: Metabeta: Model and implementation. Tech. rep., Department of Computer Science, Aarhus University (April 1996)Google Scholar
  60. 60.
    Smaragdakis, Y., Batory, D.: Mixin layers: A object-oriented implementation technique for refinements and collaboration-based designs. ACM Transactions on Software Engineering and Methodlogies (2002)Google Scholar
  61. 61.
    Smith, M., Drossopoulou, S.: Inner Classes visit Aliasing. In: ECOOP Workshop on Formal Techniques for Java Programs (FTfJP 2003) (2003), http://www.cs.kun.nl/~erikpoll/ftfjp/2003.html
  62. 62.
    Smith, W.R.: NewtonScript: Prototypes on the Palm, pp. 109–139. Springer, Heidelberg (1999); In: Taivalsaari and Moore, editors, Prototype-Based Programming: Concepts, Languages and Applications, NobleGoogle Scholar
  63. 63.
  64. 64.
    Szyperski, C.A.: Import is not inheritance – why we need both: Modules and classes. In: Madsen, O.L. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 19–32. Springer, Heidelberg (1992)CrossRefGoogle Scholar
  65. 65.
    Szyperski, C.A.: Component Software: Beyond Object-Oriented Programming, 2nd edn. Addison-Wesley, Reading (2002)Google Scholar
  66. 66.
    Thorup, K.K.: Genericity in Java with virtual types. In: European Conference on Object-Oriented Programming, pp. 444–471 (1997)Google Scholar
  67. 67.
    Thorup, K.K., Torgersen, M.: Unifying genericity: Combining the benefits of virtual types and parameterized classes. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628, pp. 186–204. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  68. 68.
    Ungar, D.: Annotating objects for transport to other worlds. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (October 1995)Google Scholar
  69. 69.
    Ungar, D., Smith, R.: SELF: The power of simplicity. In: Proc. of the ACM Conf. on Object-Oriented Programming, Systems, Languages and Applications (October 1987)Google Scholar
  70. 70.
    Zenger, M.: Type-safe prototype-based component evolution. In: European Conference on Object-Oriented Programming (2002)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Gilad Bracha
    • 1
  • Peter von der Ahé
  • Vassili Bykov
  • Yaron Kashai
    • 2
  • William Maddox
    • 2
  • Eliot Miranda
    • 2
  1. 1.Ministry of Truth 
  2. 2.Cadence Design Systems 

Personalised recommendations