ABSTRACT
Erlang's bit syntax caters for flexible pattern matching on bit streams (objects known as binaries). Binaries are nowadays heavily used in typical Erlang applications such as protocol programming, which in turn has created a need for efficient support of the basic operations on binaries.To this effect, we describe a scheme for efficient native code compilation of Erlang's bit syntax. The scheme relies on partial translation for avoiding code explosion, and improves the performance of programs manipulating binaries by translating frequently occurring instances of BEAM instructions into native code via an intermediate translation to instructions of a register transfer language. Our performance evaluation shows that in a HiPE-enabled Erlang/OTP system, the obtained speedups are often significant.
- E. Johansson, M. Pettersson, and K. Sagonas. HiPE: A High Performance Erlang system. In Proceedings of the ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, pages 32-43. ACM Press, Sept. 2000. Google ScholarDigital Library
- P. Nyblom. The bit syntax --- the released version. In Proceedings of the Sixth International Erlang/OTP User Conference, Oct. 2000. Available at http://www.erlang.se/euc/00/.Google Scholar
- M. Pettersson, K. Sagonas, and E. Johansson. The HiPE/x86 Erlang compiler: System description and performance evaluation. In Proceedings of the Sixth International Symposium on Functional and Logic Programming, LNCS. Springer, Sept. 2002. Google ScholarDigital Library
- C. Wikström and T. Rogvall. Protocol programming in Erlang using binaries. In Proceedings of the Fifth International Erlang/OTP User Conference, Oct. 1999. Available at http://www.erlang.se/euc/99/.Google Scholar
- Native code compilation of Erlang's bit syntax
Recommendations
Incremental concrete syntax for embedded languages with support for separate compilation
Embedded domain-specific languages (EDSLs) are known to improve the productivity of developers. However, for many domains no DSL implementation is available and two important reasons for this are: First, the effort to implement EDSLs that provide the ...
Programmable syntax macros
PLDI '93: Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementationLisp has shown that a programmable syntax macro system acts as an adjunct to the compiler that gives the programmer important and powerful abstraction facilities not provided by the language. Unlike simple token substitution macros, such as are provided ...
Comments