ECT: an object-oriented extension to Erlang

G. Fehér, A. G. Békés
{"title":"ECT: an object-oriented extension to Erlang","authors":"G. Fehér, A. G. Békés","doi":"10.1145/1596600.1596608","DOIUrl":null,"url":null,"abstract":"To structure the code of an Erlang program, one can split it into modules. There are also available some basic data structures: lists, records and tuples. However, there are no fully functional classes that encapsulate data and functionality, and can be extended with inheritance. We think these features could promote code reuse in certain cases, therefore we decided to extend the language with object-oriented capabilities. A strong evidence of the usability of this is the fact that part of the program itself was rewritten using our newly created language elements, and the new version was simpler and cleaner than the original Erlang one. Our main goals were to preserve the single-assignment nature of Erlang and to keep method-call and value-access times constant. It was also a priority to make the extension easily installable, to reach as much developers as possible. For this, we avoided changes in the Erlang compiler itself. Instead, we created the extension as a parse transformation1 . In our implementation a class is a module that contain the methods, and a record type whose instances are the object instances. Both methods and fields can be inherited. We also examined the currently available other object-oriented extensions for Erlang, and compared them with ours. Our implementation has strong advantages, but it also lacks some features. Compatibility with records and speed are the main advantages. In this paper - among describing and comparing our extension - we also show the possible ways of adding the missing features.","PeriodicalId":140676,"journal":{"name":"Erlang Workshop","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Erlang Workshop","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1596600.1596608","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

To structure the code of an Erlang program, one can split it into modules. There are also available some basic data structures: lists, records and tuples. However, there are no fully functional classes that encapsulate data and functionality, and can be extended with inheritance. We think these features could promote code reuse in certain cases, therefore we decided to extend the language with object-oriented capabilities. A strong evidence of the usability of this is the fact that part of the program itself was rewritten using our newly created language elements, and the new version was simpler and cleaner than the original Erlang one. Our main goals were to preserve the single-assignment nature of Erlang and to keep method-call and value-access times constant. It was also a priority to make the extension easily installable, to reach as much developers as possible. For this, we avoided changes in the Erlang compiler itself. Instead, we created the extension as a parse transformation1 . In our implementation a class is a module that contain the methods, and a record type whose instances are the object instances. Both methods and fields can be inherited. We also examined the currently available other object-oriented extensions for Erlang, and compared them with ours. Our implementation has strong advantages, but it also lacks some features. Compatibility with records and speed are the main advantages. In this paper - among describing and comparing our extension - we also show the possible ways of adding the missing features.
ECT: Erlang的面向对象扩展
要构造Erlang程序的代码,可以将其分成几个模块。还有一些基本的数据结构:列表、记录和元组。但是,不存在封装数据和功能并可以通过继承进行扩展的功能完备的类。我们认为这些特性在某些情况下可以促进代码重用,因此我们决定用面向对象的功能扩展该语言。一个强有力的可用性证据是,程序本身的一部分是用我们新创建的语言元素重写的,而且新版本比原来的Erlang版本更简单、更干净。我们的主要目标是保持Erlang的单赋值特性,并保持方法调用和值访问时间不变。使扩展易于安装也是一个优先事项,以便尽可能多地接触到开发人员。为此,我们避免对Erlang编译器本身进行更改。相反,我们将扩展创建为解析转换1。在我们的实现中,类是一个包含方法和记录类型的模块,记录类型的实例是对象实例。方法和字段都可以被继承。我们还研究了Erlang目前可用的其他面向对象扩展,并将它们与我们的扩展进行了比较。我们的实现具有很强的优势,但也缺少一些特性。与记录的兼容性和速度是主要优点。在本文中,除了描述和比较我们的扩展之外,我们还展示了添加缺失特性的可能方法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信