3 ms·
Writing an F# wrapper for a C# API is considerably less involved than writing an OCaml wrapper for a C API. This is because F# and C# share: * build tools *
by dfgdghdf 6y ago
Writing an F# wrapper for a C# API is considerably less involved than writing an OCaml wrapper for a C API.
This is because F# and C# share:
* build tools
* package management
* garbage collector
* base types (string, int, etc).
The F# type-checker understands C# types, so you know that you are consuming the C# API correctly (at least at the type-level). F# can be be used as a new syntax for C#, if you wanted to go that way.
- akra 6y agoMore interestingly you can also go the other way if you use only the lower level F# features (F# being mostly a superset of C# features) and a C# developer won't realise that they are calling F# code - it's all just .NET IL in the end. Did it often when creating libraries at work; it isn't like invoking another language's binary code at all. One of the pro's I guess of working with a VM (JVM/.NET) based language - interop between languages is usually much easier and so niche languages can have a much larger ecosystem than they otherwise would have.