33 research outputs found

    Uniting Language Embeddings for Fast and Friendly DSLs

    Get PDF
    The holy grail for a domain-specific language (DSL) is to be friendly and fast. A DSL should be friendly in the sense that it is easy to use by DSL end-users, and easy to develop by DSL authors. DSLs can be developed as entirely new compilers and ecosystems, which requires tremendous effort and often requires DSL authors to reinvent the wheel. Or, DSLs can be developed as libraries embedded in an existing host language, which requires significantly less effort. Embedded DSLs (EDSLs) manifest a trade-off between being friendly and fast as they stand divided in two groups: - Deep EDSLs trade user experience of both DSL authors and DSL end-users, for improved program performance. As proposed by Elliott et al., deep EDSLs build an intermediate representation (IR) of a program that can be used to drive domain-specific optimizations, which can significantly improve performance. However, this program IR introduces significant usability hurdles for both the DSL authors and DSL end-users. Correctly transforming programs is difficult and error prone for DSL authors, while error messages can be cryptic and confusing for DSL end-users. - Shallow EDSLs trade program performance for good user experience. As proposed by P. Hudak, shallow EDSLs omit construction of the IR, i.e., they are executed directly in the host language. Although friendly to both DSL end-users and DSL authors, they can not perform domain-specific optimizations and thus exhibit inferior performance. This thesis makes a stride towards achieving both (1) good user experience for DSL authors and DSL end-users, as well as (2) enabling domain-specific optimizations for improved performance. It unites shallow and deep DSLs by defining an automatic translation from end-user-friendly shallow DSLs, to better-performing deep DSLs. The translation uses reflection of the host language to cherry-pick the best of both shallow and deep EDSLs. During program development, a DSL end-user is presented with user friendly features of a shallow EDSL. Before execution in a production environment, programs are reliably translated into the high-performance deep EDSL with equivalent semantics. Since maintaining both shallow and deep EDSLs is difficult, the thesis further shows how to reuse the shallow-to-deep translation to automatically generate deep EDSLs based on shallow EDSLs. With automatic generation of the deep EDSL, the DSL author is required only to develop a shallow EDSL and the domain-specific optimizations for the deep EDSL that she deems useful. Finally, the thesis discusses a new programming abstraction that eases the development, of a specific kind, of deep EDSLs that are compiled in two stages. The new abstraction simplifies management of dynamic compilation in two-stage deep EDSLs

    Comparing Rapid Type Analysis with Points-To Analysis in GraalVM Native Image

    Full text link
    Whole-program analysis is an essential technique that enables advanced compiler optimizations. An important example of such a method is points-to analysis used by ahead-of-time (AOT) compilers to discover program elements (classes, methods, fields) used on at least one program path. GraalVM Native Image uses a points-to analysis to optimize Java applications, which is a time-consuming step of the build. We explore how much the analysis time can be improved by replacing the points-to analysis with a rapid type analysis (RTA), which computes reachable elements faster by allowing more imprecision. We propose several extensions of previous approaches to RTA: making it parallel, incremental, and supporting heap snapshotting. We present an extensive experimental evaluation of the effects of using RTA instead of points-to analysis, in which RTA allowed us to reduce the analysis time for Spring Petclinic, a popular demo application of the Spring framework, by 64% and the overall build time by 35% at the cost of increasing the image size due to the imprecision by 15%

    Synchronization of Huygens' clocks and the Poincare method

    Full text link
    We study two models of connected pendulum clocks synchronizing their oscillations, a phenomenon originally observed by Huygens. The oscillation angles are assumed to be small so that the pendulums are modeled by harmonic oscillators, clock escapements are modeled by the van der Pol terms. The mass ratio of the pendulum bobs to their casings is taken as a small parameter. Analytic conditions for existence and stability of synchronization regimes, and analytic expressions for their stable amplitudes and period corrections are derived using the Poincare theorem on existence of periodic solutions in autonomous quasi-linear systems. The anti-phase regime always exists and is stable under variation of the system parameters. The in-phase regime may exist and be stable, exist and be unstable, or not exist at all depending on parameter values. As the damping in the frame connecting the clocks is increased the in-phase stable amplitude and period are decreasing until the regime first destabilizes and then disappears. The results are most complete for the traditional three degrees of freedom model, where the clock casings and the frame are consolidated into a single mass.Comment: 23 pages, 8 figure

    D'Alembert sums for vibrating bar with viscous ends

    Full text link
    We describe a new method for finding analytic solutions to some initial-boundary problems for partial differential equations with constant coefficients. The method is based on expanding the denominator of the Laplace transformed Green's function of the problem into a convergent geometric series. If the denominator is a linear combination of exponents with real powers one obtains a closed form solution as a sum with finite but time dependent number of terms. We call it a d'Alembert sum. This representation is computationally most effective for small evolution times, but it remains valid even when the system of eigenmodes is incomplete and the eigenmode expansion is unavailable. Moreover, it simplifies in such cases. In vibratory problems d'Alembert sums represent superpositions of original and partially reflected traveling waves. They generalize the d'Alembert type formulas for the wave equation, and reduce to them when original waves can undergo only finitely many reflections in the entire course of evolution. The method is applied to vibrations of a bar with dampers at each end and at some internal point. The results are illustrated by computer simulations and comparisons to modal and FEM solutions.Comment: 18 pages, 8 figure

    Online Testing of Federated and Heterogeneous Distributed Systems

    Get PDF
    DiCE is a system for online testing of federated and heterogeneous distributed systems. We have built a prototype of DiCE and integrated it with a BGP router. DiCE quickly detects three important classes of faults, resulting from configuration mistakes, policy conflicts and programming errors

    Explicit solution for vibrating bar with viscous boundaries and internal damper

    Full text link
    We investigate longitudinal vibrations of a bar subjected to viscous boundary conditions at each end, and an internal damper at an arbitrary point along the bar's length. The system is described by four independent parameters and exhibits a variety of behaviors including rigid motion, super stability/instability and zero damping. The solution is obtained by applying the Laplace transform to the equation of motion and computing the Green's function of the transformed problem. This leads to an unconventional eigenvalue-like problem with the spectral variable in the boundary conditions. The eigenmodes of the problem are necessarily complex-valued and are not orthogonal in the usual inner product. Nonetheless, in generic cases we obtain an explicit eigenmode expansion for the response of the bar to initial conditions and external force. For some special values of parameters the system of eigenmodes may become incomplete, or no non-trivial eigenmodes may exist at all. We thoroughly analyze physical and mathematical reasons for this behavior and explicitly identify the corresponding parameter values. In particular, when no eigenmodes exist, we obtain closed form solutions. Theoretical analysis is complemented by numerical simulations, and analytic solutions are compared to computations using finite elements.Comment: 29 pages, 6 figure
    corecore