skip to main content
10.1145/3624309.3624320acmotherconferencesArticle/Chapter ViewAbstractPublication PagessblpConference Proceedingsconference-collections
research-article

Source-to-Source Code Transformation on Rust for High-Level Stream Parallelism

Published:02 November 2023Publication History

ABSTRACT

Utilizing parallel systems to their full potential can be challenging for general-purpose developers. A solution to this problem is to create high-level abstractions using Domain-Specific Languages (DSL). We create a stream-processing DSL for Rust, a growing programming language focusing on performance and safety. To that end, we explore Rust’s macros as a high-level abstraction tool to support an existing DSL language named SPar and perform source-to-source code transformations in the abstract syntax tree. We aim to assess the Rust source-to-source code transformations toolset and its implications. We highlight that Rust macros are powerful tools for performing source-to-source code transformations for abstracting structured stream processing. In addition, execution time and programmability results are comparable to other solutions.

References

  1. Gabriella Andrade, Dalvan Griebler, Rodrigo Santos, Marco Danelutto, and Luiz Gustavo Fernandes. 2021. Assessing Coding Metrics for Parallel Programming of Stream Processing Programs on Multi-cores. In 47th Euromicro Conference on Software Engineering and Advanced Applications (SEAA)(SEAA’21). IEEE, Pavia, Italy, na.Google ScholarGoogle Scholar
  2. Gabriella Andrade, Dalvan Griebler, Rodrigo Santos, and Luiz Gustavo Fernandes. 2023. A parallel programming assessment for stream processing applications on multi-core systems. Computer Standards & Interfaces 84 (March 2023), 103691. https://doi.org/10.1016/j.csi.2022.103691Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Henrique C. M. Andrade, Buğra Gedik, and Deepak S. Turaga. 2014. Fundamentals of Stream Processing: Application Design, Systems, and Analytics. Cambridge University Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Barry Boehm, C Abts, A Brown, S Chulani, Brad Clark, Ellis Horowitz, Raymond Madachy, D.J. Reifer, and Bert Steece. 2000. Software Cost Estimation with Cocomo II.Google ScholarGoogle Scholar
  5. Gabriell Alves de Araujo, Dalvan Griebler, Marco Danelutto, and Luiz Gustavo Fernandes. 2020. Efficient NAS Parallel Benchmark Kernels with CUDA. In 28th Euromicro International Conference on Parallel, Distributed and Network-Based Processing (PDP)(PDP’20). IEEE, Västerås, Sweden, Sweden, 9–16. https://doi.org/10.1109/PDP50117.2020.00009Google ScholarGoogle ScholarCross RefCross Ref
  6. José Duarte and António Ravara. 2022. Taming stateful computations in Rust with typestates. Journal of Computer Languages 72 (2022), 101154. https://doi.org/10.1016/j.cola.2022.101154Google ScholarGoogle ScholarCross RefCross Ref
  7. Alessio Fino, Alessandro Margara, Gianpaolo Cugola, Marco Donadoni, and Edoardo Morassutto. 2021. RStream: Simple and Efficient Batch and Stream Processing at Scale. In 2021 IEEE International Conference on Big Data (Big Data). 2764–2774. https://doi.org/10.1109/BigData52589.2021.9671932Google ScholarGoogle ScholarCross RefCross Ref
  8. Martin Fowler. 2010. Domain-Specific Languages (Addison-Wesley Signature Series (Fowler)) (1 ed.). Addison-Wesley Professional. https://martinfowler.com/books/dsl.htmlGoogle ScholarGoogle Scholar
  9. Dalvan Griebler. 2016. Domain-Specific Language & Support Tool for High-Level Stream Parallelism. Ph. D. Dissertation. Faculdade de Informática - PPGCC - PUCRS, Porto Alegre, Brazil. http://tede2.pucrs.br/tede2/handle/tede/6776Google ScholarGoogle Scholar
  10. Dalvan Griebler, Marco Danelutto, Massimo Torquati, and Luiz Gustavo Fernandes. 2017. SPar: A DSL for High-Level and Productive Stream Parallelism. Parallel Processing Letters 27, 01 (March 2017), 1740005. https://doi.org/10.1142/S0129626417400059Google ScholarGoogle ScholarCross RefCross Ref
  11. Kyle Headley. 2018. A DSL embedded in Rust. IFL 2018: Proceedings of the 30th Symposium on Implementation and Application of Functional Languages, 119–126. https://doi.org/10.1145/3310232.3310241Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Renato B. Hoffmann, Dalvan Griebler, Marco Danelutto, and Luiz G. Fernandes. 2020. Stream Parallelism Annotations for Multi-Core Frameworks. In XXIV Brazilian Symposium on Programming Languages (SBLP)(SBLP’20). ACM, Natal, Brazil, 48–55. https://doi.org/10.1145/3427081.3427088Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Renato B. Hoffmann, Júnior Löff, Dalvan Griebler, and Luiz G. Fernandes. 2022. OpenMP as Runtime for Providing High-Level Stream Parallelism on Multi-Cores. Journal of Supercomputing 78, 6 (apr 2022), 7655–7676. https://doi.org/10.1007/s11227-021-04182-9Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. ISO/IEC-14882:2011. 2011. Information Technology - Programming Languages - C++. Technical Report. International Standard, Geneva, Switzerland.Google ScholarGoogle Scholar
  15. S. Klabnik and C. Nichols. 2023. The Rust Programming Language, 2nd Edition. No Starch Press. https://books.google.com.br/books?id=SE2GEAAAQBAJGoogle ScholarGoogle Scholar
  16. Júnior Löff, Renato Barreto Hoffmann, Dalvan Griebler, and Luiz G. Fernandes. 2021. High-Level Stream and Data Parallelism in C++ for Multi-Cores. In XXV Brazilian Symposium on Programming Languages (SBLP)(SBLP’21). ACM, Joinville, Brazil.Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Timothy Mattson, Beverly Sanders, and Berna Massingill. 2004. Patterns for Parallel Programming (first ed.). Addison-Wesley Professional.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Marjan Mernik, Jan Heering, and Anthony M. Sloane. 2005. When and How to Develop Domain-Specific Languages. ACM Comput. Surv. 37, 4 (dec 2005), 316–344. https://doi.org/10.1145/1118890.1118892Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Ricardo Pieper, Dalvan Griebler, and Luiz G. Fernandes. 2019. Structured Stream Parallelism for Rust. In XXIII Brazilian Symposium on Programming Languages (SBLP)(SBLP’19). ACM, Salvador, Brazil, 54–61. https://doi.org/10.1145/3355378.3355384Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Ricardo Pieper, Júnior Löff, Renato Berreto Hoffmann, Dalvan Griebler, and Luiz Gustavo Fernandes. 2021. High-level and Efficient Structured Stream Parallelism for Rust on Multi-cores. Journal of Computer Languages na, na (July 2021), na.Google ScholarGoogle ScholarCross RefCross Ref
  21. Ricardo Luis Pieper. 2020. High-level Programming Abstractions for Distributed Stream Processing. Master’s Thesis. School of Technology - PPGCC - PUCRS, Porto Alegre, Brazil.Google ScholarGoogle Scholar
  22. Rayon. 2019. Rayon. https://github.com/rayon-rs/rayon Accessed on 27.03.2021.Google ScholarGoogle Scholar
  23. Dinei André Rockenbach. 2020. High-Level Programming Abstractions for Stream Parallelism on GPUs. Master’s Thesis. School of Technology - PPGCC - PUCRS, Porto Alegre, Brazil.Google ScholarGoogle Scholar
  24. Arash Sahebolamri, Thomas Gilray, and Kristopher Micinski. 2022. Seamless Deductive Inference via Macros. In Proceedings of the 31st ACM SIGPLAN International Conference on Compiler Construction (Seoul, South Korea) (CC 2022). Association for Computing Machinery, New York, NY, USA, 77–88. https://doi.org/10.1145/3497776.3517779Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Stefan Sydow, Mohannad Nabelsee, Sabine Glesner, and Paula Herber. 2020. Towards Profile-Guided Optimization for Safe and Efficient Parallel Stream Processing in Rust. In 2020 IEEE 32nd International Symposium on Computer Architecture and High Performance Computing (SBAC-PAD). 289–296. https://doi.org/10.1109/SBAC-PAD49847.2020.00047Google ScholarGoogle ScholarCross RefCross Ref
  26. William Thies, Michal Karczmarek, and Sama Amarasinghe. 2017. StreamIt: A Language for Streaming Applications. In International Conference on Compiler Construction. 179–196.Google ScholarGoogle Scholar
  27. Tokio. 2019. Tokio - The asynchronous runtime for the Rust programming language. https://tokio.rs Accessed on 27.03.2021.Google ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Other conferences
    SBLP '23: Proceedings of the XXVII Brazilian Symposium on Programming Languages
    September 2023
    110 pages
    ISBN:9798400716287
    DOI:10.1145/3624309

    Copyright © 2023 ACM

    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 2 November 2023

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article
    • Research
    • Refereed limited

    Acceptance Rates

    Overall Acceptance Rate22of50submissions,44%
  • Article Metrics

    • Downloads (Last 12 months)24
    • Downloads (Last 6 weeks)5

    Other Metrics

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format .

View HTML Format