11 research outputs found

    One-Pass Reductions

    Get PDF
    We study OI and IO one-pass reduction sequences with term rewrite systems. We present second order decidability and undecidability results on recognizable tree languages and one-pass reductions. For left-linear TRSs, the second order OI inclusion problem and the second order OI reachability problem are decidable, the second order OI joinability problem is undecidable. For right-linear TRSs, the second order common IO ancestor problem is undecidable

    Lightweight Modular Staging: A Pragmatic Approach to Runtime Code Generation and Compiled DSLs

    Get PDF
    Software engineering demands generality and abstraction, performance demands specialization and concretization. Generative programming can provide both, but the effort required to develop high-quality program generators likely offsets their benefits, even if a multi-stage programming language is used. We present lightweight modular staging, a library-based multi-stage programming approach that breaks with the tradition of syntactic quasi-quotation and instead uses only types to distinguish between binding times. Through extensive use of component technology, lightweight modular staging makes an optimizing compiler framework available at the library level, allowing programmers to tightly integrate domain-specific abstractions and optimizations into the generation process. We argue that lightweight modular staging enables a form of language virtualization, i.e. allows to go from a pure-library embedded language to one that is practically equivalent to a stand-alone implementation with only modest effort

    Quoted Staged Rewriting: A Practical Approach to Library-Defined Optimizations

    Get PDF
    Staging has proved a successful technique for programmatically removing code abstractions, thereby allowing for faster program execution while retaining a high-level interface for the programmer. Unfortunately, techniques based on staging suffer from a number of problems — ranging from practicalities to fundamental limitations — which have prevented their widespread adoption. We introduce Quoted Staged Rewriting (QSR), an approach that uses type-safe, pattern matching-enabled quasiquotes to define optimizations. The approach is “staged” in two ways: first, rewrite rules can execute arbitrary code during pattern matching and code reconstruction, leveraging the power and flexibility of staging; second, library designers can orchestrate the application of successive rewriting phases (stages). The advantages of using quasiquote-based rewriting are that library designers never have to deal directly with the intermediate representation (IR), and that it allows for non-intrusive optimizations — in contrast with staging, it is not necessary to adapt the entire library and user programs to accommodate optimizations. We show how Squid, a Scala macro-based framework, enables QSR and renders library-defined optimizations more practical than ever before: library designers write domain-specific optimizers that users invoke transparently on delimited portions of their code base. As a motivating example we describe an implementation of stream fusion (a well-known deforestation technique) that is both simpler and more powerful than the state of the art, and can readily be used by Scala programmers with no knowledge of metaprogramming

    Doctor of Philosophy

    Get PDF
    dissertationI present the design of a parser that adds Scheme-style language extensibility to languages with implicitly delimited and infix syntax. A key element of my design is an enforestation parsing step, which converts a flat stream of tokens into an S-expression-like tree, in addition to the initial "read" phase of parsing and interleaved with the "macro-expand" phase. My parser uses standard lexical scoping rules to communicate syntactic extensions to the parser. In this way extensions naturally compose locally as well as through module boundaries. I argue that this style of communication is better suited towards a useful extension system than tools not directly integrated with the compiler. This dissertation explores the limits of this design in a new language called Honu. I use the extensiblity provided by Honu to develop useful language extensions such as LINQ and a parser generator. I also demonstrate the generality of the parsing techniques by applying them to Java and Python

    JavaScript仮想機械を記述するための領域特化言語

    Get PDF
    JavaScriptなどの動的なマネージド言語の仮想機械処理系(VM)の実装は,典型的にはCやC++が用いられる.動的な言語のVMは,実行時のデータ型に応じた分岐処理を多く持つため,CやC++で処理を直接記述する場合,あらゆる型の組み合わせに関して記述する必要があり,記述が非常に煩雑になる.一方で,組み込み機器上では特定のアプリケーションを繰り返し動作させると考えられるため,VMは限定されたデータ型に関する処理のみを持てばよい.しかし,CやC++ではそのようなVMを構築することは難しい.また,VM内部のデータの型は実行時に決定するため,CコンパイラはVM内部のデータ型に関するエラー検出やコンパイル時最適化ができない.他にも,GCをはじめとするVMの様々な処理を手動で実装するにはプログラマへの負担が大きいという問題がある.本論文では,以上の問題点を解決するために,VMの実装を記述するための独自の領域特化言語であるVMDLを設計し,組み込みシステム向けJavaScript処理系の実装に使用した.VMDLは,VM内部のデータ型粒度で解析可能な型システム,VMの実装に沿ったコードを自動生成できるよう関数にアノテーションを与えられる仕組み,多変数の型ディスパッチを簡潔に記述できるという特徴を持っている.その結果,C言語による実装では検出できなかったバグを検出したり,VM内部のデータ型粒度で最適化したりすることができた.また,ベンチマークを用いた評価を行い,既存研究による実装と比べて,VMサイズ・実行速度の両面からほぼ同等,あるいは結果が改善することを確認し,VMDLの有効性を示した.電気通信大学202

    Products and organizations, mirrors in a funhouse: three essays on the mirroring hypothesis

    Get PDF
    Much of the contemporary management literature on modularity implicitly assumes that increased product modularity is associated with advantageous increases in organizational modularity. Known as the “mirroring hypothesis,” this postulated relationship is the basis of prescriptions in favor of increasingly modular product design, despite inconclusive empirical evidence. The three essays in this dissertation seek to advance the extant literature on the mirroring hypothesis in the following ways: Essay one presents a systematic review of this fragmented literature. Specifically, this review finds that the extant literature currently contains inconsistent interpretations of modularity, as well as inconsistent conceptualizations of mirroring. Thus, debates on the mirroring hypothesis often amount to unproductive arguments over different things. Essay two puts forth a theoretical framework to explore mirroring between product and organization at the within-firm level. The proposed theory maintains that mirroring is contingent on the level of architectural knowledge, which correlates with a set of observable constructs. Essay three empirically tests the proposition that mirroring between product and organization is also contingent on the demand characteristics of the target customers. Using a sample constructed from the computer systems integration industry, I found empirical support for the proposed demand-side contingencies on mirroring. Research on the mirroring hypothesis has made important contributions to our understanding of the interactions between technology and organization. However, the extant narratives of mirroring in fact encompass distinct causal mechanisms interacting across multiple units of analysis. As this dissertation research shows, the structural correspondence between product and organization is like mirrors in a funhouse – there are many mirrors; and many of the mirrors are distorted

    AUTOMATING DATA-LAYOUT DECISIONS IN DOMAIN-SPECIFIC LANGUAGES

    Get PDF
    A long-standing challenge in High-Performance Computing (HPC) is the simultaneous achievement of programmer productivity and hardware computational efficiency. The challenge has been exacerbated by the onset of multi- and many-core CPUs and accelerators. Only a few expert programmers have been able to hand-code domain-specific data transformations and vectorization schemes needed to extract the best possible performance on such architectures. In this research, we examined the possibility of automating these methods by developing a Domain-Specific Language (DSL) framework. Our DSL approach extends C++14 by embedding into it a high-level data-parallel array language, and by using a domain-specific compiler to compile to hybrid-parallel code. We also implemented an array index-space transformation algebra within this high-level array language to manipulate array data-layouts and data-distributions. The compiler introduces a novel method for SIMD auto-vectorization based on array data-layouts. Our new auto-vectorization technique is shown to outperform the default auto-vectorization strategy by up to 40% for stencil computations. The compiler also automates distributed data movement with overlapping of local compute with remote data movement using polyhedral integer set analysis. Along with these main innovations, we developed a new technique using C++ template metaprogramming for developing embedded DSLs using C++. We also proposed a domain-specific compiler intermediate representation that simplifies data flow analysis of abstract DSL constructs. We evaluated our framework by constructing a DSL for the HPC grand-challenge domain of lattice quantum chromodynamics. Our DSL yielded performance gains of up to twice the flop rate over existing production C code for selected kernels. This gain in performance was obtained while using less than one-tenth the lines of code. The performance of this DSL was also competitive with the best hand-optimized and hand-vectorized code, and is an order of magnitude better than existing production DSLs.Doctor of Philosoph

    Acta Cybernetica : Volume 22. Number 3.

    Get PDF

    Language Support for Programming High-Performance Code

    Get PDF
    Nowadays, the computing landscape is becoming increasingly heterogeneous and this trend is currently showing no signs of turning around. In particular, hardware becomes more and more specialized and exhibits different forms of parallelism. For performance-critical codes it is indispensable to address hardware-specific peculiarities. Because of the halting problem, however, it is unrealistic to assume that a program implemented in a general-purpose programming language can be fully automatically compiled to such specialized hardware while still delivering peak performance. One form of parallelism is single instruction, multiple data (SIMD). Part I of this thesis presents Sierra: an extension for C ++ that facilitates portable and effective SIMD programming. Part II discusses AnyDSL. This framework allows to embed a so-called domain-specific language (DSL) into a host language. On the one hand, a DSL offers the application developer a convenient interface; on the other hand, a DSL can perform domain-specific optimizations and effectively map DSL constructs to various architectures. In order to implement a DSL, one usually has to write or modify a compiler. With AnyDSL though, the DSL constructs are directly implemented in the host language while a partial evaluator removes any abstractions that are required in the implementation of the DSL.Die Rechnerlandschaft wird heutzutage immer heterogener und derzeit ist keine Trendwende in Sicht. Insbesondere wird die Hardware immer spezialisierter und weist verschiedene Formen der Parallelität auf. Für performante Programme ist es unabdingbar, hardwarespezifische Eigenheiten zu adressieren. Wegen des Halteproblems ist es allerdings unrealistisch anzunehmen, dass ein Programm, das in einer universell einsetzbaren Programmiersprache implementiert ist, vollautomatisch auf solche spezialisierte Hardware übersetzt werden kann und dabei noch Spitzenleistung erzielt. Eine Form der Parallelität ist „single instruction, multiple data (SIMD)“. Teil I dieser Arbeit stellt Sierra vor: eine Erweiterung für C++, die portable und effektive SIMD-Programmierung unterstützt. Teil II behandelt AnyDSL. Dieses Rahmenwerk ermöglicht es, eine sogenannte domänenspezifische Sprache (DSL) in eine Gastsprache einzubetten. Auf der einen Seite bietet eine DSL dem Anwendungsentwickler eine komfortable Schnittstelle; auf der anderen Seiten kann eine DSL domänenspezifische Optimierungen durchführen und DSL-Konstrukte effektiv auf verschiedene Architekturen abbilden. Um eine DSL zu implementieren, muss man gewöhnlich einen Compiler schreiben oder modifizieren. In AnyDSL werden die DSL-Konstrukte jedoch direkt in der Gastsprache implementiert und ein partieller Auswerter entfernt jegliche Abstraktionen, die in der Implementierung der DSL benötigt werden

    Twenty years of rewriting logic

    Get PDF
    AbstractRewriting logic is a simple computational logic that can naturally express both concurrent computation and logical deduction with great generality. This paper provides a gentle, intuitive introduction to its main ideas, as well as a survey of the work that many researchers have carried out over the last twenty years in advancing: (i) its foundations; (ii) its semantic framework and logical framework uses; (iii) its language implementations and its formal tools; and (iv) its many applications to automated deduction, software and hardware specification and verification, security, real-time and cyber-physical systems, probabilistic systems, bioinformatics and chemical systems
    corecore