Tensegritics / Tensegritics/ClojureDart

Transfer type inference of the expression to the var

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pondering-design
Dominant language
Clojure
Stars
1.6k
Forks
119
PR merge metrics
No merged PRs in 30d

Description

Brain dump on this behavior:

  • Core issue (def x (constructor....)) x is dynamic
    • or more generally the inference of the expression doesn't transfer to the var
    • thus the user has to type hint the var itsef
  • Why is it like that?
    • Because so does Clojure
    • Because if you redef and that the inferred type change you have to recompile every code referring this var (and this may cascade) thus promising nothing is easier.
  • Right now we transitively recompile all dependants so we could transfer the inferred type without adding complexity. It will impact REPL design though, maybe stick to a broadly sweeping dependants recompilation for REPL too.
  • Conceptually the inferred type may be too precise when you think of types as contracts.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the issue's discussion of (def x (constructor....)), inferred types, redefinition, and dependent recompilation. Determine the design for transferring an expression's inferred type to its var while accounting for REPL recompilation and type-contract precision; done means the behavior and recompilation implications are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, dart
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.