You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is there something fundamental why the below doesn't work? Due to the fact that vars are shared but their types are not?
It would be a killer feature, as you can test language interop quickly.
Thx, KN
#!fsharp
type U = One
let y = One
#!csharp
#!share --from fsharp y
y
Error: (1,1): error CS0103: The name 'y' does not exist in the current context
The text was updated successfully, but these errors were encountered:
As for whether sharing new types transparently should be supported, I'd say it makes intuitive sense. But it implies sharing the dependency graph from e.g. F# into C#, including NuGet packages. And in some cases the F# and C# kernels might already have conflicting versions loaded. So this gets complicated and also hard for people to reason about.
agreed, dependency walk is definitely "too hard and fragile".
How about non-transparent, i.e. explicit "#!share --from fsharp U"? Would this work, assuming stuff below U exists in both kernels?
The type definition itself would need to be shared, which requires referencing the in-memory assembly where it was defined. That assembly's dependency graph transitively includes the previous submissions' dependency graphs. I don't think this would work around the problem.
Another approach could potentially be to transparently create an isomorphic type in C#, serialize the F# type, and deserialize it to the C# type. Of course this would break all references to specific instances.
Is there a specific thing you're trying to accomplish?
Version: 1.0.522904+cdfa48b2ea1a27dfe0f545c42a34fd3ec7119074
is there something fundamental why the below doesn't work? Due to the fact that vars are shared but their types are not?
It would be a killer feature, as you can test language interop quickly.
Thx, KN
The text was updated successfully, but these errors were encountered: