A New Runtime for the EC Erlang Compiler

Dr Lawrie Brown
School of IT&EE, UNSW@ADFA, Canberra, Australia
Email: Lawrie.Brown@adfa.edu.au

Last updated: 11 Feb 2004

Abstract

This presentation will discuss the new runtime being developed for the EC Erlang Compiler. EC is intended to be both the core compiler technology for the Magnus massively scaleable computing platform, and to implement some previously identified safety extensions to Erlang for use in mobile code applications.

I start with a very brief overview of the Erlang language, a functional language designed to support robust, reliable, distributed, near real-time applications, with the emphasis on the features the runtime must support. I then briefly list other efforts at developing an Erlang compiler. Next I discuss my work on developing the new runtime to support the EC compiler, and some of the problems and issues that arose in doing this. These include the representation and handling of Erlang terms and its consequences for garbage collection; the use of detached system pthreads to implement Erlang processes (and why we could not use the standard cancellation mechanisms); the use of the dlopen library to implement dynamic module loading; and some issues with external interaction. I conclude with some open issues to be resolved and areas for further research.

Setting the Scene

  1. A New Runtime for the EC Erlang Compiler
  2. Introduction
  3. Erlang Is ....
  4. Safe Erlang
  5. Erlang Language Requirements
  6. Some Erlang Code Fragments
  7. Open Source Erlang
  8. Other Erlang Compilers
  9. Magnus
  10. EC Erlang Compiler

New EC Runtime

  1. System Targets
  2. ECRT - A New Runtime for EC
  3. Erlang Data Type Support
  4. Capabilities for PidPortRef Types
  5. Function Types
  6. Binary Types
  7. Garbage Collection
  8. Concurrency
  9. Key System Data Structures
  10. Message Passing
  11. Fun and Games with Locking
  12. Cancellation is a Nightmare
  13. Function Calling Conventions
  14. Dynamic Code Loading and Execution
  15. Dynamic Code Replacement
  16. External Interaction
  17. Distributed Erlang Nodes - Representation
  18. Distributed Erlang Nodes - External Interaction
  19. Other Issues and Further Work

Conclusion

  1. Conclusion
  2. Questions
  3. References
    Talk Outline:
    http://lpb.canb.auug.org.au/adfa/seminars/auug03/
    Associated AUUG paper:
    http://lpb.canb.auug.org.au/adfa/papers/auug03.html
    AVWW96
    J. Armstrong, R. Virding, C. Wikstrom, M. Williams, "Concurrent Programming in Erlang", 2nd edn, Prentice Hall, 1996. http://www.erlang.org/download/erlang_book_toc.html.
    Arms97
    Joe Armstrong, "The Development of Erlang", in Proceedings of the ACM SIGPLAN International Conference on Functional Programming, ACM, pp 196-203, 1997.
    BDWGC
    "A garbage collector for C and C++", H. Boehm, HP, http://www.hpl.hp.com/personal/Hans_Boehm/gc/.
    BaVi99
    "Erlang 4.7.3 Reference Manual: Draft 0.7", Jonas Barklund and Robert Virding, Bluetail, 1999. http://www.bluetail.com/~rv/Erlang-spec/Drafts/es_4.7_0.7.ps.gz.
    Boeh93
    H. Boehm, "Space Efficient Conservative Garbage Collection", SIGPLAN Notices, Vol 28, ACM, No 6, pp 197-206, June 1993. http://www.hpl.hp.com/personal/Hans_Boehm/gc/papers/pldi93.ps.Z.
    BrSa99
    Lawrie Brown, Dan Sahlin, "Extending Erlang for Safe Mobile Code Execution", V. Varadharajan, Y. Mu (ed), in Information and Communication Security, Lecture Notes in Computer Science, Vol 1726, Springer-Verlag, pp 39-53, Nov 1999. http://lpb.canb.auug.org.au/adfa/research/sserl/icics99.html.
    Bro97d
    Lawrie Brown, "SSErl - Prototype of a Safer Erlang", School of Computer Science, Australian Defence Force Academy, Canberra, Australia, Technical Report, No CS04/97, Nov 1997. http://lpb.canb.auug.org.au/adfa/papers/tr9704.html.
    Cast01
    Maurice Castro, "EC: an Erlang Compiler", Software Engineering Research Centre, RMIT, Melbourne, Australia, Technical Report, No SERC-0128, Jul 2001. http://www.serc.rmit.edu.au/~ec/docs/SERC-0128.pdf.
    Cast01b
    Maurice Castro, "EC: an Erlang Compiler", in Seventh International Erlang/OTP User Conference, Erlang Systems, Stockholm, Sweden, Sep 2001. http://www.erlang.se/euc/01/castro2001.ps.
    EC
    Maurice Castro, Lawrie Brown, "EC: an Erlang Compiler", SECR RMIT and CS ADFA, 2003. http://www.cs.adfa.edu.au/~ec/.
    Erlang
    Erlang Systems, "Open Source Erlang Distribution", Ericsson Software Technology AB, Erlang Systems, 1999. http://www.erlang.org/.
    LeBe97
    Bil Lewis, Daniel J. Berg, "Multithreaded Programming With PThreads", Sun Microsystems Press, 1997. 0136807291.

Additional Material

Erlang

Some additional slides on Erlang and my proposed Safe-Erlang extensions.

  1. Erlang - Functional
  2. Erlang - Concurrent
  3. Erlang - Distributed
  4. Erlang Language Features
  5. Why Erlang?
  6. Limitations in Erlang now
  7. Safer Execution in Erlang
  8. Safe Erlang - Capabilities
  9. Safe Erlang - Nodes
  10. Safe Erlang - Remote Code Execution

EC and Magnus

  1. EC - A Compiler for Erlang
  2. Open Source Erlang
  3. Other Erlang Implementations
  4. EC Structure
  5. EC Status
  6. Magnus
  7. Magnus Architecture
  8. Magnus WDM Switch

Lawrie.Brown@adfa.edu.au / 11 Feb 2004