Replies: 11 comments
-
Hey, sounds interesting. Current
Yep, that's right
Concurrency is sort of supported. A short overview on what happens:
Integration Ideas
This would actually be quite easy by adding a field to
I think using such a thing would severely complicate things and a facade mimicing this could also be implemented when
Async/Task sort of raises a fundamental question: Nonetheless we had ThoughtsSo overall I think passing a Hope that helps a bit and I'd be happy to help with adding some adaptivity to the compiler/FCS. 😎 |
Beta Was this translation helpful? Give feedback.
-
Hey cool, yes, that makes sense TBH the "standard" representation of synchronous code in .NET is really functions
FWIW I think this is no different to BTW another topic that came up is about polling and watching in the file system. The F# compiler currently polls the timestamps on all dependent files prior to every step of the background computation. Presumably this would mean polling and modifying a It may also be interesting to give more samples/demos with database and file system connections into this system, e.g. a sea of adaptives adapting to changes on disk. And in general more systems programming samples. Every time I build a project/file-watcher tool like |
Beta Was this translation helpful? Give feedback.
-
Our implementation was actually starting the tasks (conceptually) in parallel and the entries were fed into the set as they arrived. So there was a huge difference to
Point taken, however there's an example for precisely that (admittedly not really succinct) 😁 Maybe we should just add common things like a |
Beta Was this translation helpful? Give feedback.
-
Cool, I hadn't seen that! I'll take a close look.
Yes, I think that would be great though I don't mean to distract - I wouldn't use it myself immediately but might when I next revisit |
Beta Was this translation helpful? Give feedback.
-
Hey, I just added a For the moment I think we should just keep it that way and wait until user-combinators converge to some decent API for that. |
Beta Was this translation helpful? Give feedback.
-
After some benchmarking by @luithefirst we found that including the With CancellationToken
Without CancellationToken
So I think it should probably be passed via a |
Beta Was this translation helpful? Give feedback.
-
I just did some more analysis. When measuring the first two benchmarks using a Stopwatch, there is no difference and both run at 28ns/Op. I also could not see any excessive overhead when using the performance profiler. By adding a
Unfortunately, I could not print any disassembly with BDN to inspect what is going on. Either some optimization must fail or there is a bug. When I manually measure the |
Beta Was this translation helpful? Give feedback.
-
FYI @dsyme
I just implemented Hope that helps with future directory-watchers 😁 |
Beta Was this translation helpful? Give feedback.
-
Lovely, thank you. I tweeted about this here: https://twitter.com/dsymetweets/status/1389545040582791176 Does the recursive directory structure watcher corretly take into account sub-directory creation and deletion? And does it prevent sub-directories from being deleted due to locking? Just wondering as I recall having that kind of problem in the past |
Beta Was this translation helpful? Give feedback.
-
Cool 👍 Actually I didn't check nested deletions, so i guess that means it will have the locking problem. Semantically the nested removal should work fine via We should certainly look into the locking things... |
Beta Was this translation helpful? Give feedback.
-
For posterity, @krauthaufen gave me a prototype that we've been using in FsAutocomplete and has worked extremely well. |
Beta Was this translation helpful? Give feedback.
-
@TIHan and I have been discussing using FSharp.Data.Adaptive in future work on making parts of the F# compiler and FSharp.Compiler.Service more incremental.
We've some questions about async, cancellation and exceptions.
As context, in our current incremental model the operations to evaluate final nodes in the dependency graph are always cancellable. In the language of FSharp.Data.Adaptive I believe this means as follows. Consider these operations:
In these cases, the
'T -> 'U
functions are not cancellable and might throw exceptions. My understanding is thatif any such function throws an exception then FSharp.Data.Adaptive never "saves" the exception as a result, it is just always propagated all the way up to the routine that requested the result.
some parts of the dependency graph calculation may have been committed, and this is done in an atomic way (there is a related question about concurrent update requests)
there is no special treatment if OperationCancelledException is thrown, and so throwing that exception is a valid way to represent cancellation.
however there is no cancellation token propagated, so these functions have to capture an exterior cancellation token.
Now one could imagine a variation on FSharp.Data.Adaptive that either
propagates a cancellation token
uses a computation expression like
cancellable { ... }
to represent synchronous cancellable codeuses an existing computation like
async { ... }
that has cancellation built in (but is richer, as it represents asynchronous code)Which would lead to signatures like this (option 1)
or this (option 2)
or this (option 3)
or this (combo of option 2 and 3 for tasks)
I'm curious about your thinking about this. Obviously complicates things.
Beta Was this translation helpful? Give feedback.
All reactions