Giter Club home page Giter Club logo

ttstar's Introduction

TTstar

Dependently typed core calculus with erasure inference.

Examples from the dissertation

Features

Erasure

  • erasure inference (fills in erasure annotations)
  • separate erasure checker (verifies consistency of inferred annotations)
  • erasure from higher-order functions
  • complete removal of unused arguments (rather than passing in NULL)
  • erasure polymorphism for functions
  • four constraint solvers
    • simple and straightforward O(nĀ²) solver
    • graph-based constraint solver
    • indexing solver (fastest, default)
    • LMS solver
      • "last man standing"
      • Adapted from "Chaff: Engineering an efficient SAT solver" by Moskewicz et al., 2001.
      • theoretically faster than the indexer, my implementation is slower
  • a tentative implementation of irrelevance (example)

Language

  • full dependent pattern matching clauses
  • pattern matching local let definitions are useful for emulating
    • case expressions
    • with clauses
    • mutual recursion
  • rudimentary term/type inference via first order unification

Practicalities

  • type errors come with backtraces
  • rudimentary FFI via foreign postulates
  • a simplified intermediate representation for backends (IR)
    • translation from TT to IR compiles patterns into case trees
  • native code generators
    • a codegen from TT: via Scheme (Chicken Scheme or Racket)
      • uses the matchable extension
    • a codegen from IR: produces standard Scheme
      • mostly R5RS-compliant
        • except that some programs redefine the same name repeatedly in let*
      • when interpreted with csi, the IR-generated code runs much (~3x) faster than the TT-generated code
      • only about 10% faster than TT-generated code when compiled using csc
    • a codegen via Malfunction, using IR
      • produces fast native code

Other stuff

  • dependent erasure (if x == 3 then erased else not_erased)
  • unused functions are removed entirely
  • Refl is always erased
  • Maybe sometimes becomes Boolean after erasure

Does not feature

  • totality checking
  • mutual recursion
    • a restricted form is easy to achieve using local let bindings
    • sufficient in all cases I've come across
  • much syntax sugar

ttstar's People

Contributors

ziman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ttstar's Issues

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.