Open pjmagee opened 3 weeks ago
Then comes the discussion around the new features of dagger functions
and how does this look and feel? This will mostly be designed around .NET Attributes I would suppose but unsure how the DX would be for an F# developer.
It may be better to actually split and focus on a csharp named sdk, and if f# is popular, F# sdk should be made (which could still potentially have some benefits of any shared .net code) - One idea is that a
CSharp Project is used to generate the C# SDK from the source generator and a main F# project is used which pulls in those C# generated types.
This is supposedly what a lot of F# developers do. They do sometimes require C# Projects due to the popularity of C#.
Yeah, this is my original goals that I hope this SDK would be.
I've try with F# recently at https://github.com/wingyplus/dagger-dotnet-sdk/pull/14. The code is a bit ugly but its works. 🙈
My thought is we can write the SDK with C# and make language in the family (F#, PowerShell, etc.) calling this SDK. I'm not sure if we need a small wrapper to make DX better for the language. We can discover it after make C# works. :)
For the functions
, I see 2 ways we can go:
However, we might need to write a module runtime library to load the code (C# method, F# function) to register module into the Dagger Engine (like Go main function does in dagger.gen.go
) which looks like it depends on the language. I hope that we can play around with the Attribute somehow and sharing it across languages.
Reason for this issue:
.NET SDK generally would mean support for any language on the .NET runtime
Source Generators (Roslyn) is unique to C# but there does seem to be discussions within F# community on redirecting compilation from
csc
(C# compiler) and taking theIL
to incorporate into F#.https://github.com/fsharp/fslang-suggestions/issues/864