Rule-based program specialization to optimize gradually typed code
Both static and dynamic typing provide different benefits to the programmer. Statically typed languages support earlier type error detection and more opportunities for compiler optimizations. Dynamically typed languages facilitate the development of runtime adaptable applications and rapid prototypi...
| Autores: | , , |
|---|---|
| Formato: | artículo |
| Fecha de publicación: | 2019 |
| País: | España |
| Recursos: | Universidad de Oviedo (UNIOVI) |
| Repositorio: | RUO. Repositorio Institucional de la Universidad de Oviedo |
| Idioma: | inglés |
| OAI Identifier: | oai:digibuo.uniovi.es:10651/53505 |
| Acesso em linha: | http://hdl.handle.net/10651/53505 https://dx.doi.org/10.1016/j.knosys.2019.05.013 |
| Access Level: | acceso abierto |
| Palavra-chave: | Gradual typing program specialization rule-based systems type safety runtime performance |
| id |
ES_97f2744f92e2e36e1fe541c58e6d52bf |
|---|---|
| oai_identifier_str |
oai:digibuo.uniovi.es:10651/53505 |
| network_acronym_str |
ES |
| network_name_str |
España |
| repository_id_str |
|
| spelling |
Rule-based program specialization to optimize gradually typed codeOrtín Soler, Francisco|||0000-0003-1199-8649García Rodríguez, Miguel|||0000-0002-3150-2826McSweeney, SeanGradual typingprogram specializationrule-based systemstype safetyruntime performanceBoth static and dynamic typing provide different benefits to the programmer. Statically typed languages support earlier type error detection and more opportunities for compiler optimizations. Dynamically typed languages facilitate the development of runtime adaptable applications and rapid prototyping. Since both approaches provide benefits, gradually typed languages support both typing approaches in the very same programming language. Gradual typing has been an active research field in the last years, turning out to be a strong influence on commercial languages. However, one important drawback of gradual typing is the runtime performance cost of the additional type checks performed at runtime. In this article, we propose a rule-based program specialization mechanism to provide significant performance optimizations of gradually typed code. Our system gathers dynamic type information of the application by simulating its execution. That type information is used to optimize the generated code, reducing the number of type checks performed at runtime. Moreover, program specialization allows the early detection of compile-time type errors, providing static type safety. To ensure the correctness of the proposed approach, we prove its soundness and efficiency properties. The specialization system has been implemented as part of a full-fledged programming language, measuring the runtime performance gain. The generated code performs significantly better than the state-of-the-art techniques to optimize dynamically typed code. Unlike the existing approaches, our system does not consume additional memory resources at runtime, because program specialization is performed statically. Program specialization involves an average compilation time increase from 2% to 11.75%.This work has been partially funded by the Spanish Department of Science, Innovation and Universities: project RTI2018-099235-B-I00. The authors have also received funds from the Banco Santander through its support to the Campus of International Excellence.20192019-09-01journal articlehttp://purl.org/coar/resource_type/c_6501AMhttp://purl.org/coar/version/c_ab4af688f83e57aainfo:eu-repo/semantics/articlehttp://hdl.handle.net/10651/53505https://dx.doi.org/10.1016/j.knosys.2019.05.013reponame:RUO. Repositorio Institucional de la Universidad de Oviedoinstname:Universidad de Oviedo (UNIOVI)Inglésengopen accesshttp://purl.org/coar/access_right/c_abf2Attribution-NonCommercial-NoDerivatives 4.0 Internationalhttp://creativecommons.org/licenses/by-nc-nd/4.0/info:eu-repo/semantics/openAccessoai:digibuo.uniovi.es:10651/535052026-06-07T06:38:51Z |
| dc.title.none.fl_str_mv |
Rule-based program specialization to optimize gradually typed code |
| title |
Rule-based program specialization to optimize gradually typed code |
| spellingShingle |
Rule-based program specialization to optimize gradually typed code Ortín Soler, Francisco|||0000-0003-1199-8649 Gradual typing program specialization rule-based systems type safety runtime performance |
| title_short |
Rule-based program specialization to optimize gradually typed code |
| title_full |
Rule-based program specialization to optimize gradually typed code |
| title_fullStr |
Rule-based program specialization to optimize gradually typed code |
| title_full_unstemmed |
Rule-based program specialization to optimize gradually typed code |
| title_sort |
Rule-based program specialization to optimize gradually typed code |
| dc.creator.none.fl_str_mv |
Ortín Soler, Francisco|||0000-0003-1199-8649 García Rodríguez, Miguel|||0000-0002-3150-2826 McSweeney, Sean |
| author |
Ortín Soler, Francisco|||0000-0003-1199-8649 |
| author_facet |
Ortín Soler, Francisco|||0000-0003-1199-8649 García Rodríguez, Miguel|||0000-0002-3150-2826 McSweeney, Sean |
| author_role |
author |
| author2 |
García Rodríguez, Miguel|||0000-0002-3150-2826 McSweeney, Sean |
| author2_role |
author author |
| dc.subject.none.fl_str_mv |
Gradual typing program specialization rule-based systems type safety runtime performance |
| topic |
Gradual typing program specialization rule-based systems type safety runtime performance |
| description |
Both static and dynamic typing provide different benefits to the programmer. Statically typed languages support earlier type error detection and more opportunities for compiler optimizations. Dynamically typed languages facilitate the development of runtime adaptable applications and rapid prototyping. Since both approaches provide benefits, gradually typed languages support both typing approaches in the very same programming language. Gradual typing has been an active research field in the last years, turning out to be a strong influence on commercial languages. However, one important drawback of gradual typing is the runtime performance cost of the additional type checks performed at runtime. In this article, we propose a rule-based program specialization mechanism to provide significant performance optimizations of gradually typed code. Our system gathers dynamic type information of the application by simulating its execution. That type information is used to optimize the generated code, reducing the number of type checks performed at runtime. Moreover, program specialization allows the early detection of compile-time type errors, providing static type safety. To ensure the correctness of the proposed approach, we prove its soundness and efficiency properties. The specialization system has been implemented as part of a full-fledged programming language, measuring the runtime performance gain. The generated code performs significantly better than the state-of-the-art techniques to optimize dynamically typed code. Unlike the existing approaches, our system does not consume additional memory resources at runtime, because program specialization is performed statically. Program specialization involves an average compilation time increase from 2% to 11.75%. |
| publishDate |
2019 |
| dc.date.none.fl_str_mv |
2019 2019-09-01 |
| dc.type.none.fl_str_mv |
journal article http://purl.org/coar/resource_type/c_6501 AM http://purl.org/coar/version/c_ab4af688f83e57aa |
| dc.type.openaire.fl_str_mv |
info:eu-repo/semantics/article |
| format |
article |
| dc.identifier.none.fl_str_mv |
http://hdl.handle.net/10651/53505 https://dx.doi.org/10.1016/j.knosys.2019.05.013 |
| url |
http://hdl.handle.net/10651/53505 https://dx.doi.org/10.1016/j.knosys.2019.05.013 |
| dc.language.none.fl_str_mv |
Inglés eng |
| language_invalid_str_mv |
Inglés |
| language |
eng |
| dc.rights.none.fl_str_mv |
open access http://purl.org/coar/access_right/c_abf2 Attribution-NonCommercial-NoDerivatives 4.0 International http://creativecommons.org/licenses/by-nc-nd/4.0/ |
| dc.rights.openaire.fl_str_mv |
info:eu-repo/semantics/openAccess |
| rights_invalid_str_mv |
open access http://purl.org/coar/access_right/c_abf2 Attribution-NonCommercial-NoDerivatives 4.0 International http://creativecommons.org/licenses/by-nc-nd/4.0/ |
| eu_rights_str_mv |
openAccess |
| dc.source.none.fl_str_mv |
reponame:RUO. Repositorio Institucional de la Universidad de Oviedo instname:Universidad de Oviedo (UNIOVI) |
| instname_str |
Universidad de Oviedo (UNIOVI) |
| reponame_str |
RUO. Repositorio Institucional de la Universidad de Oviedo |
| collection |
RUO. Repositorio Institucional de la Universidad de Oviedo |
| repository.name.fl_str_mv |
|
| repository.mail.fl_str_mv |
|
| _version_ |
1869414137433423873 |
| score |
15,301603 |