4 research outputs found

    Extending OCaml’s open

    Get PDF
    We propose a harmonious extension of OCaml's 'open' construct. OCaml's existing construct 'open M' imports the names exported by the module 'M' into the current scope. At present 'M' is required to be the path to a module. We propose extending 'open' to instead accept an arbitrary module expression, making it possible to succinctly address a number of existing scope-related difficulties that arise when writing OCaml programs

    Compiling dynamic languages via statically typed functional languages

    Get PDF
    Dynamic languages enable rapid prototyping, but are generally not viewed as providing the best performance. As a result, software developers generally build a prototype in a dynamic language and then rewrite the application in C or Fortran for high performance. This costly rewriting step can be avoided by improving the performance of dynamic languages. Dynamic languages are usually interpreted for easier implementation. The traditional approach to improve their performance is to build an optimizing compiler. However, building a compiler from scratch is much more time-consuming than implementing an interpreter. Our thesis is that we can build effective compilers for dynamic languages by translating them into statically typed functional languages which have good compilers and automatic memory management. In particular, we believe that modern statically typed languages provide precise control over data representations, and come with runtime systems that have competitive performance. To investigate the viability of this approach, we have built a compiler for the dynamic language Python by translating it into the statically typed functional language OCaml. An interesting practical advantage of using modern statically typed functional languages is that they use Hindley-Milner type systems, which means that there is no need for the translation to construct type terms. We compare the performance of our implementation, Monty, with that of CPython, the reference Python implementation, and with Jython, a Java implementation of Python, using a suite of 370 benchmarks. Our experiments show that some programs compiled using our approach run up to 4.6 times faster than CPython. However, due to a number of engineering reasons, some programs also run significantly slower than CPython. We pinpoint the specific causes of performance degradation and assess the potential for removing these causes in future work. Our implementation is significantly faster than Jython, up to a factor of 100 in some cases. A by product of our research is a proposal for an improved array copying implementation in OCaml

    An Enhanced Hardware Description Language Implementation for Improved Design-Space Exploration in High-Energy Physics Hardware Design

    Get PDF
    Detectors in High-Energy Physics (HEP) have increased tremendously in accuracy, speed and integration. Consequently HEP experiments are confronted with an immense amount of data to be read out, processed and stored. Originally low-level processing has been accomplished in hardware, while more elaborate algorithms have been executed on large computing farms. Field-Programmable Gate Arrays (FPGAs) meet HEP's need for ever higher real-time processing performance by providing programmable yet fast digital logic resources. With the fast move from HEP Digital Signal Processing (DSPing) applications into the domain of FPGAs, related design tools are crucial to realise the potential performance gains. This work reviews Hardware Description Languages (HDLs) in respect to the special needs present in the HEP digital hardware design process. It is especially concerned with the question, how features outside the scope of mainstream digital hardware design can be implemented efficiently into HDLs. It will argue that functional languages are especially suitable for implementation of domain-specific languages, including HDLs. Casestudies examining the implementation complexity of HEP-specific language extensions to the functional HDCaml HDL will prove the viability of the suggested approach

    Mécanismes Orientés-Objets pour l'Interopérabilité entre Systèmes de Preuve

    Get PDF
    Dedukti is a Logical Framework resulting from the combination ofdependent typing and rewriting. It can be used to encode many logicalsystems using shallow embeddings preserving their notion of reduction.These translations of logical systems in a common format are anecessary first step for exchanging proofs between systems. Thisobjective of interoperability of proof systems is the main motivationof this thesis.To achieve it, we take inspiration from the world of programminglanguages and more specifically from object-oriented languages becausethey feature advanced mechanisms for encapsulation, modularity, anddefault definitions. For this reason we start by a shallowtranslation of an object calculus to Dedukti. The most interestingpoint in this translation is the treatment of subtyping.Unfortunately, it seems very hard to incorporate logic in this objectcalculus. To proceed, object-oriented mechanisms should be restrictedto static ones which seem enough for interoperability. Such acombination of static object-oriented mechanisms and logic is alreadypresent in the FoCaLiZe environment so we propose a shallow embeddingof FoCaLiZe in Dedukti. The main difficulties arise from theintegration of FoCaLiZe automatic theorem prover Zenon and from thetranslation of FoCaLiZe functional implementation language featuringtwo constructs which have no simple counterparts in Dedukti: localpattern matching and recursion.We then demonstrate how this embedding of FoCaLiZe to Dedukti can beused in practice for achieving interoperability of proof systemsthrough FoCaLiZe, Zenon, and Dedukti. In order to avoid strengtheningto much the theory in which the final proof is expressed, we useDedukti as a meta-language for eliminating unnecessary axioms.Dedukti est un cadre logique résultant de la combinaison du typagedépendant et de la réécriture. Il permet d'encoder de nombreuxsystèmes logiques au moyen de plongements superficiels qui préserventla notion de réduction.Ces traductions de systèmes logiques dans un format commun sont unepremière étape nécessaire à l'échange de preuves entre cessystèmes. Cet objectif d'interopérabilité des systèmes de preuve estla motivation principale de cette thèse.Pour y parvenir, nous nous inspirons du monde des langages deprogrammation et plus particulièrement des langages orientés-objetparce qu'ils mettent en œuvre des mécanismes avancés d'encapsulation,de modularité et de définitions par défaut. Pour cette raison, nouscommençons par une traduction superficielle d'un calcul orienté-objeten Dedukti. L'aspect le plus intéressant de cette traduction est letraitement du sous-typage.Malheureusement, ce calcul orienté-objet ne semble pas adapté àl'incorporation de traits logiques. Afin de continuer, nous devonsrestreindre les mécanismes orientés-objet à des mécanismes statiques,plus faciles à combiner avec la logique et apparemment suffisant pournotre objectif d'interopérabilité. Une telle combinaison de mécanismesorientés-objet et de logique est présente dans l'environnementFoCaLiZe donc nous proposons un encodage superficiel de FoCaLiZe dansDedukti. Les difficultés principales proviennent de l'intégration deZenon, le prouveur automatique de théorèmes sur lequel FoCaLiZerepose, et de la traduction du langage d'implantation fonctionnel deFoCaLiZe qui présente deux constructions qui n'ont pas decorrespondance simple en Dedukti : le filtrage de motif local et larécursivité.Nous démontrons finalement comment notre encodage de FoCaLiZe dansDedukti peut servir en pratique à l'interopérabilité entre dessystèmes de preuve à l'aide de FoCaLiZe, Zenon et Dedukti. Pour éviterde trop renforcer la théorie dans laquelle la preuve finale estobtenue, nous proposons d'utiliser Dedukti en tant que méta-langagepour éliminer des axiomes superflus
    corecore