How to convert a C# gtk application to F#

I have a working C# program. But totally no idea how to convert it to F#.

Crosspost,
https://www.reddit.com/r/fsharp/comments/1h98yp9/plotting_a_square_with_fgtksharp_cairo/

Try running it through one or more of the Chat AIs - ChatGPT et al. It will likely be an iterative exercise though, as I doubt they will get it right at the first attempt.

I tried Gemini but the code did not compile even after multiple attempts.

Depending on how much time and patience you have you could try several of the AIs. My experience in the past year with various code snippets is that in the worst case they all fail but, in many cases, some will get it right and others wrong. Or among those that get it right, some will give better or more complete answers than the others.

I’ve also found that they can get it mostly right, but it’s enough of a starting point for you to complete it correctly.

FYI in my browser, these are the ones I have hooked up (only free versions):

ChatGPT
Perplexity
Gemini
Phind
Claude
Codeium (works better as IDE coding assistant though, rather than in-browser)
Venice Chat
Copilot
Meta AI
You
Brave AI (as part of Brave Search in Brave browser or as added search engine)
Aria (in Opera browser only)

Phind specialises in tech queries and is often better than the others, but not always. Though, recently, the site has been unstable.

Another line of attack, depending on which IDE you are using if any, is to make use of GitHub Copilot or Codeium. Paste the code in and ask them to explain why it doesn’t compile and fix it if possible. This has worked for me with Codeium and Rust for example (but not always).

I also learned today that GitHub Copilot is now offering a free tier, but I’ve not really exercised it properly yet. I just asked it to summarise an existing class of mine, which it did well.

1 Like

yes this also useful for future future,

Oh, don’t worry. Slowly, step by step read compiler messages and fix it. After any time it will be complete. Good luck!