Hacker News new | ask | show | jobs
by ad1ttya 3806 days ago
Maybe its because OpenTK has type safe bindings(OpenGL, OpenCL and OpenAL) for F# and C#.. http://www.opentk.com/
1 comments

It took an awesome amount of work to get that level of type-safety. Now that this is in place, other languages could use that infrastructure to provide type-safe bindings:

https://github.com/opentk/opentk/tree/develop/Source/Bind/Sp...

The */override.xml files contain directives to convert the official Khronos XML specifications into type-safe versions. All you need is a code generator for your language of choice.

If anyone is interested in trying this, I encourage you to contact the developers on github (there used to be C++ and Java code generators that have since been removed.)

>there used to be C++ and Java code generators that have since been removed.

What was the reason for removal? Difficulty of maintenance? Out of scope for a C# project?

Mainly lack of an interested maintainer.

It's also a bit tricky because some .Net assumptions are hardcoded (i.e. overload resolution, generics, pointers+references), which makes it harder to generate idiomatic code for other languages. Nothing that cannot be fixed with a bit of effort if someone interested shows up, but until then it's better to generate excellent bindings for one runtime than mediocre bindings for multiple (and pretty much every runtime comes with a mediocre OpenGL binding.)