fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Design doc on reusing typechecking results

Open psfinaki opened this issue 1 year ago • 3 comments

The design for #17260.

psfinaki avatar Jun 28 '24 13:06 psfinaki

:white_check_mark: No release notes required

github-actions[bot] avatar Jun 28 '24 13:06 github-actions[bot]

@psfinaki Thanks for starting this initiative, this may noticeably improve things!

I can add two things to consider:

  • Reusing type check info when non-F# projects are referenced

    Rider and Visual Studio both produce in-memory metadata for referenced C#/VB.NET projects. The approaches are different, but some of the issues should be similar. FCS uses in-memory metadata timestamp which depends on the project files, while fsc uses project output assembly timestamp. These two timestamps are likely to differ the most of the time, which would prevent us from reusing cached type check data for referencing F# projects. It would be nice if we found a way to reuse type check info when non-F# projects are referenced.

  • Different conditional compilation between FCS in Rider and fsc

    We use --noconditionalerasure flag to properly analyze erased symbols in the tooling. When type check caches are reused we should not have such difference between typed trees. I propose we change the erasure logic here: we should always keep these symbols in the typed trees and erase them later during IL generation instead.

auduchinok avatar Jul 24 '24 12:07 auduchinok

@vzarytovskii @T-Gro I updated the implementation plan as per our discussion last week - see if things make sense now.

I think at least the first stage was something more or less set, so I will gradually start tinkering with it.

psfinaki avatar Sep 11 '24 18:09 psfinaki