Git Product home page Git Product logo

ir-metaocaml's Introduction

This repository holds the code for a (re)implementation of MetaOCaml I did as part of my Master's thesis work at UBC. The thesis is available from the UBC's cIrcle system (if the link above is dead, then try googling for "Evgeny Roubinchtein" "IR-MetaOCaml").

The main motivation for this work came from me wanting to explore a particular option for avoiding redundant type-checking in the MetaOCaml compiler. The fact that the type checking is redundant was pointed out in The MetaOCaml files (2010 ACM SIGPLAN Workshop on ML). The particular strategy that I chose for avoiding redundant type-checking was to use an OCaml intermediate representation (specifically, values of type Lambda) as the implementation of values of type code.

Things that are currently working:

  1. "Turn-key" generation of native code. The generated OCaml code is native code for the architecture for which native code generation is supported (internally, the implementation hooks into ocamlnat).
  2. Cross-stage persistence: values are preserved between the levels ("stages" of evaluation).
  3. Covers: the example of covers given in Walid Taha's Ph.D Thesis "Multistage Programming: Its Theory and Applications" works.

Things that are not currently working:

  1. Using "let rec" in the code fragments. The basic difficulty is the circularity of reference required by "let rec", combined with the current implementation strategy for cross-stage persistence.

Things that are unlikely to ever work:

  1. Presenting terms of type "code" to the programmer in a way the latter can recognize as "code written by me, with some mechanical transformations applied." I consider this to be a serious limitation, because interactively experimenting with fragments of code is extremely valuable for both learning about multi-stage programming and debugging multi-stage programs. This presentation of terms to the programmer was not a design goal of the system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.