-
Notifications
You must be signed in to change notification settings - Fork 788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking
F# AOT, Trimmability, ILLink
#13398
Comments
I'll make a start on the RFC this weekend (reflection free codegen). What is the "recursive generics" issue? Does it manifest in non-string-related code? If not, then this issue is a subset of the other one on string functions. |
@charlesroddie the |
You can make generic recursion crash something at runtime. I'm not too keen on fiddling with F# to find it, but here's some C#: System.Console.WriteLine(Count<int>(3));
System.Console.WriteLine(Count<int>(100));
static int Count<T>(int i) =>
i switch
{
0 => 0,
_ => 1 + Count<Foo<T>>(i - 1)
};
struct Foo<T> { } This will print following warning at compile time:
The at runtime, the first call will succeed and print the number (because the depth was sufficiently low), but throws for the second call:
|
We don't make any effort in the dotnet/runtime repo to make libraries work with reflection-free mode, besides no-brainer easy fixes that would be accepted even without reflection-free mode. Reflection-free mode things should ideally be separate issues that either have a no-brainer easy fix that would be acceptable even without the NativeAOT reflection-free mode as a motivating scenario, or can be easily Won't fixed as undesirable. |
Tracking
F# AOT storyTracking
F# AOT, Trimmability, ILLink
Trimming annotations tracked here: #15980 Resolved issues
Probably not issues/need more info
Remaining issues
|
Wanted to add here that |
Original description
AOT and trimmability is around the corner, and FSharp has issues with some of these technologies. There visible issues with NativeAOT, but I suspect R2R may AOT less code due to these issues or maybe trimmer keep more code.
Describe the solution you'd like
I would like to create action plan of known issues for NativeAOT and trimmability of generated FSharp code to have smaller steps toward F# ❤️ AOT goal. I would like that reflection-free mode of NativeAOT, as opposed to normal NativeAOT mode where reflection working would be also considered.
Describe alternatives you've considered
Seems to be fsharp/fslang-suggestions#919 reach some conclusion, so I think we should go to action.
Also I consider target just NativeAOT with reflection (default), but seems to be having no-reflection is easy way to uncover issues with trimmability and unnecessary reflection usage in app. I consider that approach more of technique to find issues faster, plus I may have smaller app.
Open issues
printf
usage requires a lot of rd.xml boilerplate, like it shows here.FSharp.Core.OptimizedClosures.FSharpFunc
has recusive generics (?)printf "%А"
does not work in reflection-free mode. There preliminary work here Reflection free code gen #12960$"{x}"
breaks in reflection-free mode.The text was updated successfully, but these errors were encountered: