go2cs icon indicating copy to clipboard operation
go2cs copied to clipboard

Go to F#?

Open xD0135 opened this issue 2 years ago • 2 comments

Great job developing this project, it is simply amazing🎉

What are your thoughts regarding transpiling Go to F#? Is this something that you have considered?

xD0135 avatar Mar 19 '23 05:03 xD0135

I have not considered this - but it could turn out be fairly simple given how well F#/C# interop, i.e., lots of one-to-one mappings for datatypes for IL support. However, the resultant code, although operational, in this case might not be very "FSharpy", i.e., not very "functional in style", since most translated things would be mutable.

ritchiecarroll avatar Mar 19 '23 16:03 ritchiecarroll

Thank you for the details, and great to hear that it could be a simple implementation.

I think the mutable aspect is something that could be solved by a design decision. For example, since in F# everything is immutable by default, follow that pattern, but then provide a CLI flag --mutable that allows the user to make the mutability decision during conversion. There could also be dynamic checks during the conversion that automatically adds mutable to variables that are allocated (var foo string) and receive a value after the initial assignment (foo = "bar"). These are just some examples that allows the conversion to follow closer to the F# way of doing things.

If starting a go2fs project is something that you're interested and have time, I would definitely be interested in using.

xD0135 avatar Mar 20 '23 01:03 xD0135