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
Hot Reload #11636
Comments
https://devblogs.microsoft.com/dotnet/introducing-net-hot-reload/
Of course F# is staying behind in terms of tooling again. |
What's the current status if:
Is hot reload able to support that currently? I.e. loading the updated assembly. |
It'll happen eventually here, but hot reload is a very new technology that is likely to undergo several changes well after .NET 6. We'll plug into it when it's more stable. |
@happypig, @charlesroddie -- |
For me personally the biggest win is with projects that we start with
"dotnet watch run". Usually those are expecto tests or asp.net core
servers. If dotnet watch run would work like fable and keep a compiler in
memory that only recompiles the stuff that is dependent on the files that I
touched, then the dev cycle could speed up dramatically.
I don't think we would need hot module replacement like webpack does - just
restart the process like dotnet watch run would do right now.
Kevin Ransom (msft) ***@***.***> schrieb am Di., 8. Juni
2021, 23:46:
… @happypig <https://github.com/happypig>, @charlesroddie
<https://github.com/charlesroddie> --
what do you want hot reload to do for you? Just asking for a feature name
is probably not going to get anything moving. We don't have plenty of other
C# features also, and we don't plan on going down the VB route of moaning
whenever we don't get some new C# feature.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11636 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOANETHSOIUAQRKRF6SVLTR2FSPANCNFSM46EKO77A>
.
|
From the linked thread:
Most important is a quick development loop when changing bits of UI (likely to be MAUI with WinUI as primary development platform). For non-UI code I don't need to run code very often, sometimes only once after finishing a work item to check that it works. But for UI code a lot of tweaks and adjustments are important and need to be visualized by running the code. Hot reload would be perfect for this but does look like a very large task for F# to support Edit and Continue which it is based on. A typical UI tweak doesn't affect the API of an assembly so reference assemblies will speed up the loop. Hypothetically if it were possible, while running an application, to edit a dependent project, build it, and switch in the dll, it might capture most of the benefit of hot restart. But this may not be possible in dotnet? |
Would support for generating files for FSI scripting, like the one provided by the F# Power Pack back in the day, be an alternative in this case? Together with script debugging, of course. |
I am using blazor with fsharp. Hot reload will speed up the poductivity a lot. |
This is a critical tooling enhancement for my usage of F#. Is there some way I can contribute to move up the timeline? |
I don't think we have a full understanding of what has to be done yet. |
I decided to spelunk and get a better idea of what it takes to implement hot reload. Full notes are in this gist https://gist.github.com/farlee2121/24915fb0518ad4ca6631bc33d0ff401c Finds so far
Oustanding investigations
|
A quick update. I made an experimental fork. It's pretty basic so far
The running program will show changes, and much faster than the existing dotnet watch. A more accurate description is that rebuilding tries to output both dlls and pdbs, but those resources are already in use by the debugger process. |
@farlee2121 Don't be shy, post a GIF! |
Sorry for my ignorance, but what exactly is that demonstrating? Watch will recompile and relaunch an application today without hot reload. |
Correct. Here is the described state of my experiment I was asked to gif.
I also believe it to be faster, but my sample is only one project. While the above requirements are met with the I'm still working on demonstrating updates to F# code using existing delta appliers (true hot reload). |
I see, thank you. |
An update on my efforts.
A few other conclusions likely obvious to the FSharp team, but I had to dig for
Things I'll probably need help on if I can demonstrate a successful reload
|
I suppose @farlee2121 needs someone from Roslyn/HotReload team to join this thread |
That would certainly help |
I got a bit more work in tonight. I also set up more experiments to understand what behaviors hot reload handles for C# now. I found the results more fickle than I expected. Asp.net works fine, but I've yet to get blazor wasm working, and the console app only updates if I stop at a breakpoint. Issue ScopeMy updates have been a bit hodge-podge, so here's a summary in light of the original question: what would it take to implement hot reload for F#. I'm more confident than ever that the DeltaAppliers should be reusable for F#. "Starting in 6.0, the runtime (.NET Core and Mono) expose APIs to patch a running app". This should be language-agnostic, and addresses the complexities of different runtime conditions. My sdk fork demonstrates how to plug F# into the hot reload hierarchy. I can provide more details if needed. It's basically the single The main work to be done is an F# compiler api method that takes changed files in a project and outputs assembly patches in a format mappable to System.Reflection.Metadata.MetadataUpdater. We still need to understand that format properly. This api method should also notify when a "rude edit" that can't be handled at runtime is made so hot reload can prompt for a restart. When it's all done, we add |
Any progress so far? |
I started a new job and haven't had time for this lately. |
@dsyme can you please help on this cool feature? Do you know any Roslyn team members who can help here? |
F# support for this would be so much appreciated. I created a small repository to illustrate the problem for the new readers: https://github.com/PiotrJustyna/binoculars What I'm after is for the PID not to change as the code hot-reloads. It does work perfectly for C# I plan to use it for work where, in order to speed up deployments, we could hot swap certain F# components in our C# and F# hosts. Eagerly observing this issue |
This feature would improve our team daily workflow. I don't understand why is not being planned to introduce for F# language. It will leave the language as a second class citizen when compared with C# and even VB.NET. |
It can improve bolero developments. I am also making a library Fun.Blazor, looking forward to hot reload for a long time. I hope F# team can take this as soon as possible, they and Roslyn team are all in Microsoft right? They can discuss the C# implementation detail. |
Is your feature request related to a problem? Please describe.
C# is getting Hot Reload for .NET 6. Will F# receive the same experience? Roslyn has had work done to support this. The F# compiler doesn't seem to have any equivalent work on this.
Describe the solution you'd like
F# can use hot reload just like C#.
Describe alternatives you've considered
Staying behind in terms of tooling again.
Additional context
If the issue is about:
Add any other context or screenshots about the feature request here.
dotnet/core#5510
The text was updated successfully, but these errors were encountered: