fslang-suggestions icon indicating copy to clipboard operation
fslang-suggestions copied to clipboard

Allow all declarations to be mutually referential and the compiler takes files in any order

Open baronfel opened this issue 8 years ago • 2 comments

Submitted by Kevin Ransom on 10/19/2015 12:00:00 AM
39 votes on UserVoice prior to migration

With F# becoming more and more multi-editor and cross-platform, it is becoming increasingly difficult to teach all build/edit tools about F#'s file order. The F# community are currently struggling to "update" each new build/edit tool to understand that F# actually needs a file order.

Part of the problem is that there is no standard textual way to specify this file order except as command line arguments, and these are not stored in an editable form. There is no standard way to specify the F# file order. We need an (optional) solution to this problem that is closer to home and doesn't involve modifying build/edit tools.

This proposal is one of three alternatives to deal with this problem in the F# language/compiler itself. The specific proposal covered by this UV entry is to just change F# to use no file order at all, allowing all declarations in an assembly to be mutually referential with other declarations.

Related alternative:

  • Keep a file order, but infer it from #load/#require declarations.
  • Keep a file order, but optionally have it specified by a fileorder.fsx or fileorder.txt or fileorder.json:

Original UserVoice Submission Archived Uservoice Comments

baronfel avatar Oct 20 '16 01:10 baronfel

Of the three proposals, the explicit import/require proposal has the most potential. I don't think this proposal is possible.

JeroMiya avatar Mar 10 '22 00:03 JeroMiya

Dependency file order is F#'s single most valuable feature for large projects.

FunctionalFirst avatar Mar 11 '22 19:03 FunctionalFirst