首页 > 最新文献

arXiv - CS - Programming Languages最新文献

英文 中文
Repr Types: One Abstraction to Rule Them All Repr 类型:一个抽象概念统领一切
Pub Date : 2024-09-12 DOI: arxiv-2409.07950
Viktor Palmkvist, Anders Ågren Thuné, Elias Castegren, David Broman
The choice of how to represent an abstract type can have a major impact onthe performance of a program, yet mainstream compilers cannot performoptimizations at such a high level. When dealing with optimizations of datatype representations, an important feature is having extensiblerepresentation-flexible data types; the ability for a programmer to add newabstract types and operations, as well as concrete implementations of these,without modifying the compiler or a previously defined library. Many researchprojects support high-level optimizations through static analysis,instrumentation, or benchmarking, but they are all restricted in at least oneaspect of extensibility. This paper presents a new approach to representation-flexible data typeswithout such restrictions and which still finds efficient optimizations. Ourapproach centers around a single built-in type $texttt{repr}$ and functionoverloading with cost annotations for operation implementations. We evaluateour approach (i) by defining a universal collection type as a library, a singletype for all conventional collections, and (ii) by designing and implementing arepresentation-flexible graph library. Programs using $texttt{repr}$ types aretypically faster than programs with idiomatic representation choices --sometimes dramatically so -- as long as the compiler finds good implementationsfor all operations. Our compiler performs the analysis efficiently by findingoptimized solutions quickly and by reusing previous results to avoidrecomputations.
选择如何表示抽象类型会对程序的性能产生重大影响,但主流编译器无法在如此高的层次上进行优化。在处理数据类型表示法的优化问题时,一个重要的特点是具有可扩展的表示法--灵活的数据类型;程序员能够在不修改编译器或以前定义的库的情况下,添加新的抽象类型和操作,以及这些类型和操作的具体实现。许多研究项目通过静态分析、工具或基准测试支持高级优化,但它们至少在可扩展性的一个方面受到限制。本文提出了一种新的方法来处理表示灵活的数据类型,这种方法没有这些限制,但仍能找到高效的优化方法。我们的方法围绕单一内置类型 $texttt{repr}$,以及对操作实现进行代价注解的函数重载。我们评估了我们的方法:(i) 将通用集合类型定义为库,即所有常规集合的单一类型;(ii) 设计并实现了灵活的图库。只要编译器能为所有操作找到良好的实现,那么使用 $texttt{repr}$ 类型的程序通常比使用惯用表示选择的程序更快,有时甚至快得惊人。我们的编译器通过快速找到优化方案和重复使用以前的结果来避免重新计算,从而高效地执行分析。
{"title":"Repr Types: One Abstraction to Rule Them All","authors":"Viktor Palmkvist, Anders Ågren Thuné, Elias Castegren, David Broman","doi":"arxiv-2409.07950","DOIUrl":"https://doi.org/arxiv-2409.07950","url":null,"abstract":"The choice of how to represent an abstract type can have a major impact on\u0000the performance of a program, yet mainstream compilers cannot perform\u0000optimizations at such a high level. When dealing with optimizations of data\u0000type representations, an important feature is having extensible\u0000representation-flexible data types; the ability for a programmer to add new\u0000abstract types and operations, as well as concrete implementations of these,\u0000without modifying the compiler or a previously defined library. Many research\u0000projects support high-level optimizations through static analysis,\u0000instrumentation, or benchmarking, but they are all restricted in at least one\u0000aspect of extensibility. This paper presents a new approach to representation-flexible data types\u0000without such restrictions and which still finds efficient optimizations. Our\u0000approach centers around a single built-in type $texttt{repr}$ and function\u0000overloading with cost annotations for operation implementations. We evaluate\u0000our approach (i) by defining a universal collection type as a library, a single\u0000type for all conventional collections, and (ii) by designing and implementing a\u0000representation-flexible graph library. Programs using $texttt{repr}$ types are\u0000typically faster than programs with idiomatic representation choices --\u0000sometimes dramatically so -- as long as the compiler finds good implementations\u0000for all operations. Our compiler performs the analysis efficiently by finding\u0000optimized solutions quickly and by reusing previous results to avoid\u0000recomputations.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179503","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
$μλεδ$-Calculus: A Self Optimizing Language that Seems to Exhibit Paradoxical Transfinite Cognitive Capabilities μλεδ$-微积分:一种似乎具有自相矛盾的无限认知能力的自我优化语言
Pub Date : 2024-09-09 DOI: arxiv-2409.05351
Ronie Salgado
Formal mathematics and computer science proofs are formalized usingHilbert-Russell-style logical systems which are designed to not admit paradoxesand self-refencing reasoning. These logical systems are natural way to describeand reason syntactic about tree-like data structures. We found thatWittgenstein-style logic is an alternate system whose propositional elementsare directed graphs (points and arrows) capable of performing paraconsistentself-referencing reasoning without exploding. Imperative programming languageare typically compiled and optimized with SSA-based graphs whose most generalrepresentation is the Sea of Node. By restricting the Sea of Nodes to only thedata dependencies nodes, we attempted to stablish syntactic-semanticcorrespondences with the Lambda-calculus optimization. Surprisingly, when wetested our optimizer of the lambda calculus we performed a natural extensiononto the $mulambda$ which is always terminating. This always terminatingalgorithm is an actual paradox whose resulting graphs are geometrical fractals,which seem to be isomorphic to original source program. These fractalstructures looks like a perfect compressor of a program, which seem to resemblean actual physical black-hole with a naked singularity. In addition to thesesurprising results, we propose two additional extensions to the calculus tomodel the cognitive process of self-aware beings: 1) $epsilon$-expressions tomodel syntactic to semantic expansion as a general model of macros; 2)$delta$-functional expressions as a minimal model of input and output. Weprovide detailed step-by-step construction of our language interpreter,compiler and optimizer.
形式数学和计算机科学的证明是通过希尔伯特-鲁塞尔式逻辑系统形式化的,这些逻辑系统的设计不允许悖论和自反推理。这些逻辑系统是描述树状数据结构并进行语法推理的自然方法。我们发现维特根斯坦式逻辑是另一种系统,它的命题元素是有向图(点和箭头),能够执行准一致自引用推理而不会爆炸。命令式编程语言通常使用基于 SSA 的图进行编译和优化,而 SSA 的最一般表示形式是节点海。通过将 "节点之海 "限制为只有数据依赖关系节点,我们试图建立与 Lambda 计算优化的语法语义对应关系。令人惊讶的是,当我们对λ演算法的优化器进行测试时,我们对总是终止的$mulambda$进行了自然扩展。这个总是终止的算法是一个实际的悖论,它产生的图是几何分形,似乎与原始源程序同构。这些分形结构看起来就像一个程序的完美压缩器,似乎类似于一个具有赤裸裸奇点的真实物理黑洞。除了这些令人惊讶的结果之外,我们还提出了两个对微积分的额外扩展,以模拟具有自我意识的生物的认知过程:1)$epsilon$表达式,作为宏的一般模型来模拟句法到语义的扩展;2)$elta$函数表达式,作为输入和输出的最小模型。我们将逐步详细地构建我们的语言解释器、编译器和优化器。
{"title":"$μλεδ$-Calculus: A Self Optimizing Language that Seems to Exhibit Paradoxical Transfinite Cognitive Capabilities","authors":"Ronie Salgado","doi":"arxiv-2409.05351","DOIUrl":"https://doi.org/arxiv-2409.05351","url":null,"abstract":"Formal mathematics and computer science proofs are formalized using\u0000Hilbert-Russell-style logical systems which are designed to not admit paradoxes\u0000and self-refencing reasoning. These logical systems are natural way to describe\u0000and reason syntactic about tree-like data structures. We found that\u0000Wittgenstein-style logic is an alternate system whose propositional elements\u0000are directed graphs (points and arrows) capable of performing paraconsistent\u0000self-referencing reasoning without exploding. Imperative programming language\u0000are typically compiled and optimized with SSA-based graphs whose most general\u0000representation is the Sea of Node. By restricting the Sea of Nodes to only the\u0000data dependencies nodes, we attempted to stablish syntactic-semantic\u0000correspondences with the Lambda-calculus optimization. Surprisingly, when we\u0000tested our optimizer of the lambda calculus we performed a natural extension\u0000onto the $mulambda$ which is always terminating. This always terminating\u0000algorithm is an actual paradox whose resulting graphs are geometrical fractals,\u0000which seem to be isomorphic to original source program. These fractal\u0000structures looks like a perfect compressor of a program, which seem to resemble\u0000an actual physical black-hole with a naked singularity. In addition to these\u0000surprising results, we propose two additional extensions to the calculus to\u0000model the cognitive process of self-aware beings: 1) $epsilon$-expressions to\u0000model syntactic to semantic expansion as a general model of macros; 2)\u0000$delta$-functional expressions as a minimal model of input and output. We\u0000provide detailed step-by-step construction of our language interpreter,\u0000compiler and optimizer.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179504","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Conversational Concurrency 会话并发
Pub Date : 2024-09-06 DOI: arxiv-2409.04055
Tony Garnock-Jones
Concurrent computations resemble conversations. In a conversation,participants direct utterances at others and, as the conversation evolves,exploit the known common context to advance the conversation. Similarly,collaborating software components share knowledge with each other in order tomake progress as a group towards a common goal. This dissertation studies concurrency from the perspective of cooperativeknowledge-sharing, taking the conversational exchange of knowledge as a centralconcern in the design of concurrent programming languages. In doing so, itmakes five contributions: 1. It develops the idea of a common dataspace as amedium for knowledge exchange among concurrent components, enabling a newapproach to concurrent programming. While dataspaces loosely resemble both"fact spaces" from the world of Linda-style languages and Erlang'scollaborative model, they significantly differ in many details. 2. It offersthe first crisp formulation of cooperative, conversational knowledge-exchangeas a mathematical model. 3. It describes two faithful implementations of themodel for two quite different languages. 4. It proposes a completely novelsuite of linguistic constructs for organizing the internal structure ofindividual actors in a conversational setting. The combination of dataspaceswith these constructs is dubbed Syndicate. 5. It presents and analyzes evidencesuggesting that the proposed techniques and constructs combine to simplifyconcurrent programming. The dataspace concept stands alone in its focus on representation andmanipulation of conversational frames and conversational state and in itsintegral use of explicit epistemic knowledge. The design is particularly suitedto integration of general-purpose I/O with otherwise-functional languages, butalso applies to actor-like settings more generally.
并发计算类似于对话。在会话中,参与者会直接向他人发表言论,并随着会话的发展,利用已知的共同语境来推进会话。同样,协作软件组件之间也会共享知识,以便作为一个群体朝着共同的目标前进。本论文从合作知识共享的角度研究并发性,将知识的对话交流作为并发编程语言设计的核心问题。为此,本论文做出了五项贡献:1.它提出了将公共数据空间作为并发组件之间进行知识交流的媒介的观点,为并发编程提供了一种新方法。虽然数据空间与 Linda 风格语言世界中的 "事实空间 "和 Erlang 的协作模型大致相似,但它们在许多细节上存在显著差异。2.它首次以数学模型的形式清晰地表述了合作式会话知识交换。3.3. 它描述了两种完全不同的语言对该模型的两种忠实实现。4.4. 它提出了一套全新的语言构造,用于组织会话环境中个体行动者的内部结构。数据空间与这些结构的组合被称为 Syndicate。5.它提出并分析了一些证据,这些证据表明,所提出的技术与结构相结合,可以简化当前的程序设计。数据空间概念的独特之处在于,它侧重于会话框架和会话状态的表示和操作,以及对显式认识论知识的整合使用。这种设计特别适用于将通用输入/输出与其他功能语言整合在一起,但也适用于更广泛的演员式设置。
{"title":"Conversational Concurrency","authors":"Tony Garnock-Jones","doi":"arxiv-2409.04055","DOIUrl":"https://doi.org/arxiv-2409.04055","url":null,"abstract":"Concurrent computations resemble conversations. In a conversation,\u0000participants direct utterances at others and, as the conversation evolves,\u0000exploit the known common context to advance the conversation. Similarly,\u0000collaborating software components share knowledge with each other in order to\u0000make progress as a group towards a common goal. This dissertation studies concurrency from the perspective of cooperative\u0000knowledge-sharing, taking the conversational exchange of knowledge as a central\u0000concern in the design of concurrent programming languages. In doing so, it\u0000makes five contributions: 1. It develops the idea of a common dataspace as a\u0000medium for knowledge exchange among concurrent components, enabling a new\u0000approach to concurrent programming. While dataspaces loosely resemble both\u0000\"fact spaces\" from the world of Linda-style languages and Erlang's\u0000collaborative model, they significantly differ in many details. 2. It offers\u0000the first crisp formulation of cooperative, conversational knowledge-exchange\u0000as a mathematical model. 3. It describes two faithful implementations of the\u0000model for two quite different languages. 4. It proposes a completely novel\u0000suite of linguistic constructs for organizing the internal structure of\u0000individual actors in a conversational setting. The combination of dataspaces\u0000with these constructs is dubbed Syndicate. 5. It presents and analyzes evidence\u0000suggesting that the proposed techniques and constructs combine to simplify\u0000concurrent programming. The dataspace concept stands alone in its focus on representation and\u0000manipulation of conversational frames and conversational state and in its\u0000integral use of explicit epistemic knowledge. The design is particularly suited\u0000to integration of general-purpose I/O with otherwise-functional languages, but\u0000also applies to actor-like settings more generally.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179507","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Expressing and Analyzing Quantum Algorithms with Qualtran 用 Qualtran 表达和分析量子算法
Pub Date : 2024-09-06 DOI: arxiv-2409.04643
Matthew P. Harrigan, Tanuj Khattar, Charles Yuan, Anurudh Peduri, Noureldin Yosri, Fionn D. Malone, Ryan Babbush, Nicholas C. Rubin
Quantum computing's transition from theory to reality has spurred the needfor novel software tools to manage the increasing complexity, sophistication,toil, and fallibility of quantum algorithm development. We present Qualtran, anopen-source library for representing and analyzing quantum algorithms. Usingappropriate abstractions and data structures, we can simulate and testalgorithms, automatically generate information-rich diagrams, and tabulateresource requirements. Qualtran offers a standard library of algorithmicbuilding blocks that are essential for modern cost-minimizing compilations. Itscapabilities are showcased through the re-analysis of key algorithms inHamiltonian simulation, chemistry, and cryptography. Architecture-independentresource counts output by Qualtran can be forwarded to our implementation ofcost models to estimate physical costs like wall-clock time and number ofphysical qubits assuming a surface-code architecture. Qualtran provides afoundation for explicit constructions and reproducible analysis, fosteringgreater collaboration within the growing quantum algorithm developmentcommunity.
量子计算从理论到现实的转变促使人们需要新颖的软件工具来管理量子算法开发中日益增长的复杂性、精密性、艰苦性和易错性。我们介绍的 Qualtran 是一个用于表示和分析量子算法的开源库。利用适当的抽象和数据结构,我们可以模拟和测试算法,自动生成信息丰富的图表,并将资源需求制表。Qualtran 提供了现代成本最小化编译所必需的算法构建模块标准库。通过重新分析哈密尔顿仿真、化学和密码学中的关键算法,Qualtran 的能力得到了充分展示。Qualtran 输出的独立于体系结构的资源计数可以转发到我们的成本模型实现中,以估算物理成本,如壁钟时间和假设表面代码体系结构的物理比特数。Qualtran 为明确的构造和可重现的分析提供了基础,促进了日益增长的量子算法开发社区内的更大合作。
{"title":"Expressing and Analyzing Quantum Algorithms with Qualtran","authors":"Matthew P. Harrigan, Tanuj Khattar, Charles Yuan, Anurudh Peduri, Noureldin Yosri, Fionn D. Malone, Ryan Babbush, Nicholas C. Rubin","doi":"arxiv-2409.04643","DOIUrl":"https://doi.org/arxiv-2409.04643","url":null,"abstract":"Quantum computing's transition from theory to reality has spurred the need\u0000for novel software tools to manage the increasing complexity, sophistication,\u0000toil, and fallibility of quantum algorithm development. We present Qualtran, an\u0000open-source library for representing and analyzing quantum algorithms. Using\u0000appropriate abstractions and data structures, we can simulate and test\u0000algorithms, automatically generate information-rich diagrams, and tabulate\u0000resource requirements. Qualtran offers a standard library of algorithmic\u0000building blocks that are essential for modern cost-minimizing compilations. Its\u0000capabilities are showcased through the re-analysis of key algorithms in\u0000Hamiltonian simulation, chemistry, and cryptography. Architecture-independent\u0000resource counts output by Qualtran can be forwarded to our implementation of\u0000cost models to estimate physical costs like wall-clock time and number of\u0000physical qubits assuming a surface-code architecture. Qualtran provides a\u0000foundation for explicit constructions and reproducible analysis, fostering\u0000greater collaboration within the growing quantum algorithm development\u0000community.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179505","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
A Brief Overview of the Pawns Programming Language 卒子编程语言简介
Pub Date : 2024-09-05 DOI: arxiv-2409.03152
Lee Naish
Pawns is a programming language under development which supports purefunctional programming (including algebraic data types, higher orderprogramming and parametric polymorphism) and imperative programming (includingpointers, destructive update of shared data structures and global variables),integrated so each can call the other and with purity checked by the compiler.For pure functional code the programmer need not understand the representationof the data structures. For imperative code the representation must beunderstood and all effects and dependencies must be documented in the code. Forexample, if a function may update one of its arguments, this must be declaredin the function type signature and noted where the function is called. A singleupdate operation may affect several variables due to sharing of representations(pointer aliasing). Pawns code requires all affected variables to be annotatedwherever they may be updated and information about sharing to be declared.Annotations are also required where IO or other global variables are used andthis must be declared in type signatures as well. Sharing analysis, performedby the compiler, is the key to many aspects of Pawns. It enables us to checkthat all effects are made obvious in the source code, effects can beencapsulated inside a pure interface and effects can be used safely in thepresence of polymorphism.
Pawns 是一种正在开发中的编程语言,它支持纯函数式编程(包括代数数据类型、高阶编程和参数多态性)和命令式编程(包括指针、共享数据结构和全局变量的破坏性更新)。对于命令式代码,必须理解数据结构的表示法,并在代码中记录所有影响和依赖关系。例如,如果函数可能会更新其一个参数,则必须在函数类型签名中声明,并在函数调用时注明。由于共享表示(指针别名),一次更新操作可能会影响多个变量。当使用 IO 或其他全局变量时,也需要使用注释,而且必须在类型签名中声明。编译器进行的共享分析是 Pawns 许多方面的关键。它使我们能够检查源代码中的所有效果是否明显,效果是否可以封装在纯接口中,以及效果是否可以在多态的情况下安全使用。
{"title":"A Brief Overview of the Pawns Programming Language","authors":"Lee Naish","doi":"arxiv-2409.03152","DOIUrl":"https://doi.org/arxiv-2409.03152","url":null,"abstract":"Pawns is a programming language under development which supports pure\u0000functional programming (including algebraic data types, higher order\u0000programming and parametric polymorphism) and imperative programming (including\u0000pointers, destructive update of shared data structures and global variables),\u0000integrated so each can call the other and with purity checked by the compiler.\u0000For pure functional code the programmer need not understand the representation\u0000of the data structures. For imperative code the representation must be\u0000understood and all effects and dependencies must be documented in the code. For\u0000example, if a function may update one of its arguments, this must be declared\u0000in the function type signature and noted where the function is called. A single\u0000update operation may affect several variables due to sharing of representations\u0000(pointer aliasing). Pawns code requires all affected variables to be annotated\u0000wherever they may be updated and information about sharing to be declared.\u0000Annotations are also required where IO or other global variables are used and\u0000this must be declared in type signatures as well. Sharing analysis, performed\u0000by the compiler, is the key to many aspects of Pawns. It enables us to check\u0000that all effects are made obvious in the source code, effects can be\u0000encapsulated inside a pure interface and effects can be used safely in the\u0000presence of polymorphism.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179509","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Dynamic String Generation and C++-style Output in Fortran 在 Fortran 中动态生成字符串和 C++ 风格输出
Pub Date : 2024-09-05 DOI: arxiv-2409.03397
Marcus Mohr
Using standard components of modern Fortran we present a technique todynamically generate strings with as little coding overhead as possible on theapplication side. Additionally we demonstrate how this can be extended to allowfor output generation with a C++ stream-like look and feel.
利用现代 Fortran 的标准组件,我们提出了一种动态生成字符串的技术,尽可能减少应用程序端的编码开销。此外,我们还演示了如何将该技术扩展到以类似于 C++ 流的外观和感觉生成输出。
{"title":"Dynamic String Generation and C++-style Output in Fortran","authors":"Marcus Mohr","doi":"arxiv-2409.03397","DOIUrl":"https://doi.org/arxiv-2409.03397","url":null,"abstract":"Using standard components of modern Fortran we present a technique to\u0000dynamically generate strings with as little coding overhead as possible on the\u0000application side. Additionally we demonstrate how this can be extended to allow\u0000for output generation with a C++ stream-like look and feel.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179508","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
The MLIR Transform Dialect. Your compiler is more powerful than you think MLIR 转换方言。你的编译器比你想象的更强大
Pub Date : 2024-09-05 DOI: arxiv-2409.03864
Martin Lücke, Oleksandr Zinenko, William S. Moses, Michel Steuwer, Albert Cohen
To take full advantage of a specific hardware target, performance engineersneed to gain control on compilers in order to leverage their domain knowledgeabout the program and hardware. Yet, modern compilers are poorly controlled,usually by configuring a sequence of coarse-grained monolithic black-boxpasses, or by means of predefined compiler annotations/pragmas. These can beeffective, but often do not let users precisely optimize their varying computeloads. As a consequence, performance engineers have to resort to implementingcustom passes for a specific optimization heuristic, requiring compilerengineering expert knowledge. In this paper, we present a technique that provides fine-grained control ofgeneral-purpose compilers by introducing the Transform dialect, a controllableIR-based transformation system implemented in MLIR. The Transform dialectempowers performance engineers to optimize their various compute loads bycomposing and reusing existing - but currently hidden - compiler featureswithout the need to implement new passes or even rebuilding the compiler. We demonstrate in five case studies that the Transform dialect enablesprecise, safe composition of compiler transformations and allows forstraightforward integration with state-of-the-art search methods.
为了充分利用特定硬件目标,性能工程师需要对编译器进行控制,以便充分利用他们对程序和硬件的领域知识。然而,现代编译器的控制能力很差,通常是通过配置一系列粗粒度的单片黑盒子,或者通过预定义的编译器注释/语法。这些方法虽然有效,但往往无法让用户精确优化不同的计算负荷。因此,性能工程师不得不为特定的优化启发式实施自定义通路,这需要编译工程方面的专业知识。在本文中,我们介绍了一种技术,通过引入 Transform 方言(一种在 MLIR 中实现的基于 IR 的可控转换系统),对通用编译器进行细粒度控制。Transform 方言使性能工程师能够通过组合和重用现有但目前隐藏的编译器功能来优化各种计算负载,而无需实现新的传递,甚至无需重建编译器。我们通过五个案例研究证明,Transform 方言能够精确、安全地组合编译器转换,并允许与最先进的搜索方法直接集成。
{"title":"The MLIR Transform Dialect. Your compiler is more powerful than you think","authors":"Martin Lücke, Oleksandr Zinenko, William S. Moses, Michel Steuwer, Albert Cohen","doi":"arxiv-2409.03864","DOIUrl":"https://doi.org/arxiv-2409.03864","url":null,"abstract":"To take full advantage of a specific hardware target, performance engineers\u0000need to gain control on compilers in order to leverage their domain knowledge\u0000about the program and hardware. Yet, modern compilers are poorly controlled,\u0000usually by configuring a sequence of coarse-grained monolithic black-box\u0000passes, or by means of predefined compiler annotations/pragmas. These can be\u0000effective, but often do not let users precisely optimize their varying compute\u0000loads. As a consequence, performance engineers have to resort to implementing\u0000custom passes for a specific optimization heuristic, requiring compiler\u0000engineering expert knowledge. In this paper, we present a technique that provides fine-grained control of\u0000general-purpose compilers by introducing the Transform dialect, a controllable\u0000IR-based transformation system implemented in MLIR. The Transform dialect\u0000empowers performance engineers to optimize their various compute loads by\u0000composing and reusing existing - but currently hidden - compiler features\u0000without the need to implement new passes or even rebuilding the compiler. We demonstrate in five case studies that the Transform dialect enables\u0000precise, safe composition of compiler transformations and allows for\u0000straightforward integration with state-of-the-art search methods.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179506","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Register Aggregation for Hardware Decompilation 用于硬件解码的寄存器聚合
Pub Date : 2024-09-04 DOI: arxiv-2409.03119
Varun Rao, Zachary D. Sisco
Hardware decompilation reverses logic synthesis, converting a gate-leveldigital electronic design, or netlist, back up to hardware description language(HDL) code. Existing techniques decompile data-oriented features in netlists,like loops and modules, but struggle with sequential logic. In particular, theycannot decompile memory elements, which pose difficulty due to theirdeconstruction into individual bits and the feedback loops they form in thenetlist. Recovering multi-bit registers and memory blocks from netlists wouldexpand the applications of hardware decompilation, notably towards retargetingtechnologies (e.g. FPGAs to ASICs) and decompiling processor memories. Wedevise a method for register aggregation, to identify relationships between thedata flip-flops in a netlist and group them into registers and memory blocks,resulting in HDL code that instantiates these memory elements. We aggregateflip-flops by identifying common enable pins, and derive the bit-order of theresulting registers using functional dependencies. This scales similarly tomemory blocks, where we repeat the algorithm in the second dimension withspecial attention to the read, write, and address ports of each memory block.We evaluate our technique over a dataset of 13 gate-level netlists, comprisingcircuits from binary multipliers to CPUs, and we compare the quantity andwidths of recovered registers and memory blocks with the original source code.The technique successfully recovers memory elements in all of the testedcircuits, even aggregating beyond the source code expectation. In 10 / 13circuits, all source code memory elements are accounted for, and we are able tocompact up to 2048 disjoint bits into a single memory block.
硬件反编译逆转逻辑综合,将门-线-数字电子设计或网表转换回硬件描述语言(HDL)代码。现有技术可以反编译网表中面向数据的功能,如循环和模块,但在处理顺序逻辑时却很困难。特别是,这些技术无法反编译内存元素,因为内存元素被分解为单个位,并在网表中形成反馈回路,这给反编译带来了困难。从网表中恢复多位寄存器和内存块将扩大硬件反编译的应用范围,特别是在重定向技术(如将 FPGA 转换为 ASIC)和反编译处理器内存方面。我们提出了一种寄存器聚合方法,用于识别网表中数据触发器之间的关系,并将其归类为寄存器和存储器块,从而生成实例化这些存储器元素的 HDL 代码。我们通过识别共同的使能引脚来聚合触发器,并利用功能依赖关系推导出由此产生的寄存器的位序。我们在 13 个门级网表数据集上评估了我们的技术,其中包括从二进制乘法器到 CPU 的各种电路,并将恢复的寄存器和内存块的数量和宽度与原始源代码进行了比较。在 10/13 个电路中,所有源代码内存元素都得到了考虑,而且我们能够将多达 2048 个不相连的比特压缩到单个内存块中。
{"title":"Register Aggregation for Hardware Decompilation","authors":"Varun Rao, Zachary D. Sisco","doi":"arxiv-2409.03119","DOIUrl":"https://doi.org/arxiv-2409.03119","url":null,"abstract":"Hardware decompilation reverses logic synthesis, converting a gate-level\u0000digital electronic design, or netlist, back up to hardware description language\u0000(HDL) code. Existing techniques decompile data-oriented features in netlists,\u0000like loops and modules, but struggle with sequential logic. In particular, they\u0000cannot decompile memory elements, which pose difficulty due to their\u0000deconstruction into individual bits and the feedback loops they form in the\u0000netlist. Recovering multi-bit registers and memory blocks from netlists would\u0000expand the applications of hardware decompilation, notably towards retargeting\u0000technologies (e.g. FPGAs to ASICs) and decompiling processor memories. We\u0000devise a method for register aggregation, to identify relationships between the\u0000data flip-flops in a netlist and group them into registers and memory blocks,\u0000resulting in HDL code that instantiates these memory elements. We aggregate\u0000flip-flops by identifying common enable pins, and derive the bit-order of the\u0000resulting registers using functional dependencies. This scales similarly to\u0000memory blocks, where we repeat the algorithm in the second dimension with\u0000special attention to the read, write, and address ports of each memory block.\u0000We evaluate our technique over a dataset of 13 gate-level netlists, comprising\u0000circuits from binary multipliers to CPUs, and we compare the quantity and\u0000widths of recovered registers and memory blocks with the original source code.\u0000The technique successfully recovers memory elements in all of the tested\u0000circuits, even aggregating beyond the source code expectation. In 10 / 13\u0000circuits, all source code memory elements are accounted for, and we are able to\u0000compact up to 2048 disjoint bits into a single memory block.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179510","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
CoolerSpace: A Language for Physically Correct and Computationally Efficient Color Programming CoolerSpace:一种物理上正确、计算上高效的色彩编程语言
Pub Date : 2024-09-04 DOI: arxiv-2409.02771
Ethan Chen, Jiwon Chang, Yuhao Zhu
Color programmers manipulate lights, materials, and the resulting colors fromlight-material interactions. Existing libraries for color programming provideonly a thin layer of abstraction around matrix operations. Color programs are,thus, vulnerable to bugs arising from mathematically permissible but physicallymeaningless matrix computations. Correct implementations are difficult to writeand optimize. We introduce CoolerSpace to facilitate physically correct andcomputationally efficient color programming. CoolerSpace raises the level ofabstraction of color programming by allowing programmers to focus on describingthe logic of color physics. Correctness and efficiency are handled byCoolerSpace. The type system in CoolerSpace assigns physical meaning anddimensions to user-defined objects. The typing rules permit only legalcomputations informed by color physics and perception. Along with typechecking, CoolerSpace also generates performance-optimized programs usingequality saturation. CoolerSpace is implemented as a Python library andcompiles to ONNX, a common intermediate representation for tensor computations.CoolerSpace not only prevents common errors in color programming, but also doesso without run-time overhead: even unoptimized CoolerSpace programs out-performexisting Python-based color programming systems by up to 5.7 times; ouroptimizations provide up to an additional 1.4 times speed-up.
色彩编程人员可以操作灯光、材料以及灯光与材料相互作用产生的色彩。现有的色彩编程库仅为矩阵运算提供了一层薄薄的抽象层。因此,色彩程序很容易受到数学上允许但物理上无意义的矩阵计算所产生的错误的影响。正确的实现很难编写和优化。我们引入了 CoolerSpace,以促进物理上正确、计算上高效的色彩编程。CoolerSpace 允许程序员专注于描述色彩物理逻辑,从而提高了色彩编程的抽象程度。正确性和效率由 CoolerSpace 处理。CoolerSpace 的类型系统为用户定义的对象赋予物理意义和尺寸。类型规则只允许根据色彩物理和感知进行合法计算。除了类型检查,CoolerSpace 还能使用质量饱和度生成性能优化的程序。CoolerSpace 不仅能防止色彩编程中的常见错误,还能在没有运行时开销的情况下做到这一点:即使是未经优化的 CoolerSpace 程序,其性能也比现有的基于 Python 的色彩编程系统高出 5.7 倍;经过优化后,其速度最多可提高 1.4 倍。
{"title":"CoolerSpace: A Language for Physically Correct and Computationally Efficient Color Programming","authors":"Ethan Chen, Jiwon Chang, Yuhao Zhu","doi":"arxiv-2409.02771","DOIUrl":"https://doi.org/arxiv-2409.02771","url":null,"abstract":"Color programmers manipulate lights, materials, and the resulting colors from\u0000light-material interactions. Existing libraries for color programming provide\u0000only a thin layer of abstraction around matrix operations. Color programs are,\u0000thus, vulnerable to bugs arising from mathematically permissible but physically\u0000meaningless matrix computations. Correct implementations are difficult to write\u0000and optimize. We introduce CoolerSpace to facilitate physically correct and\u0000computationally efficient color programming. CoolerSpace raises the level of\u0000abstraction of color programming by allowing programmers to focus on describing\u0000the logic of color physics. Correctness and efficiency are handled by\u0000CoolerSpace. The type system in CoolerSpace assigns physical meaning and\u0000dimensions to user-defined objects. The typing rules permit only legal\u0000computations informed by color physics and perception. Along with type\u0000checking, CoolerSpace also generates performance-optimized programs using\u0000equality saturation. CoolerSpace is implemented as a Python library and\u0000compiles to ONNX, a common intermediate representation for tensor computations.\u0000CoolerSpace not only prevents common errors in color programming, but also does\u0000so without run-time overhead: even unoptimized CoolerSpace programs out-perform\u0000existing Python-based color programming systems by up to 5.7 times; our\u0000optimizations provide up to an additional 1.4 times speed-up.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142223611","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Sharing Analysis in the Pawns Compiler 卒子编译器中的分析共享
Pub Date : 2024-09-04 DOI: arxiv-2409.02398
Lee Naish
Pawns is a programming language under development that supports algebraicdata types, polymorphism, higher order functions and "pure" declarativeprogramming. It also supports impure imperative features including destructiveupdate of shared data structures via pointers, allowing significantly increasedefficiency for some operations. A novelty of Pawns is that all impure "effects"must be made obvious in the source code and they can be safely encapsulated inpure functions in a way that is checked by the compiler. Execution of a purefunction can perform destructive updates on data structures that are local toor eventually returned from the function without risking modification of thedata structures passed to the function. This paper describes the sharinganalysis which allows impurity to be encapsulated. Aspects of the analysis aresimilar to other published work, but in addition it handles explicit pointersand destructive update, higher order functions including closures and pre- andpost-conditions concerning sharing for functions.
Pawns 是一种正在开发中的编程语言,它支持代数数据类型、多态性、高阶函数和 "纯 "声明式编程。它还支持不纯命令式特性,包括通过指针对共享数据结构进行破坏性更新,从而大大提高了某些操作的效率。Pawns 的新颖之处在于,所有不纯 "效果 "必须在源代码中一目了然,并且可以通过编译器检查的方式安全地封装在纯函数中。纯函数的执行可以对函数的本地数据结构或最终返回的数据结构执行破坏性更新,而不必冒着修改传递给函数的数据结构的风险。本文介绍了允许封装杂质的共享分析。该分析的某些方面与其他已发表的工作相似,但它还处理了显式指针和破坏性更新、包括闭包在内的高阶函数以及有关函数共享的前置和后置条件。
{"title":"Sharing Analysis in the Pawns Compiler","authors":"Lee Naish","doi":"arxiv-2409.02398","DOIUrl":"https://doi.org/arxiv-2409.02398","url":null,"abstract":"Pawns is a programming language under development that supports algebraic\u0000data types, polymorphism, higher order functions and \"pure\" declarative\u0000programming. It also supports impure imperative features including destructive\u0000update of shared data structures via pointers, allowing significantly increased\u0000efficiency for some operations. A novelty of Pawns is that all impure \"effects\"\u0000must be made obvious in the source code and they can be safely encapsulated in\u0000pure functions in a way that is checked by the compiler. Execution of a pure\u0000function can perform destructive updates on data structures that are local to\u0000or eventually returned from the function without risking modification of the\u0000data structures passed to the function. This paper describes the sharing\u0000analysis which allows impurity to be encapsulated. Aspects of the analysis are\u0000similar to other published work, but in addition it handles explicit pointers\u0000and destructive update, higher order functions including closures and pre- and\u0000post-conditions concerning sharing for functions.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-09-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179511","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
期刊
arXiv - CS - Programming Languages
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1