Giter Site home page Giter Site logo

Incremental typechecking about primer HOT 1 OPEN

dhess avatar dhess commented on May 22, 2024
Incremental typechecking

from primer.

Comments (1)

hmac avatar hmac commented on May 22, 2024

Our current approach is to blindly apply an action and then perform a full typechecking pass, and abort if that fails. This guarantees that we will never apply an action that causes a type error but is extremely inflexible and inefficient. Hazelnut is smarter than this, inserting holes where necessary to ensure that the action can be applied whilst maintaining type correctness. We want to do something similar.

The current approach I have in mind is twofold:

  • persist type information in the AST, so we don't have to recreate it each time
  • when applying an action, perform some amount of local typechecking/inference, making use of the cached type information to avoid having to recheck the whole program.

There are at least two difficulties with this approach:

  • We still need a typing context available when doing local typechecking, so we may need to walk the AST from the root to the node in question to build this up. The context should tell us both what bindings are in scope (and their type) and also whether the node we are looking at is being checked against a type or being asked to synthesise a type.
  • It's probably easier to introduce typechecking bugs by relying on stale typing information - we should pay attention to this when introducing new syntactic forms (a simple example: changing a type definition will require a complete check of the whole program).

from primer.

Related Issues (20)

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.