The trampoline system for generating the P/Invoke calls works well. The parser is functional, but not in an ideal state and I don't think we should bother pursuing that line of development anyway (I'll explain in a moment). The generator can produce usable, fully-managed assemblies from an API description. The toolchain uses a combination of XML and JSON, but JSON is being transitioned out because using XML will allow for XSLT to be leveraged to transform input API descriptions.
The goal, I remind you, was to take an API description in XML form, transform that via a set of rules (such as understanding that "GetFoo" and "SetFoo" methods on an interface can be turned into "Foo" property).
Given the direction Microsoft is taking with the Direct3D SDK and the difficulty of parsing C++ code, I'm of the opinion that we should drop the parser from the toolchain, because it's not a fun thing to maintain and it has pretty limited utility given that the DX headers will not be changing that frequently. We can run something like GCC-XML over the D3D headers locally, run that through XSL transforms, and check in the resulting XML API description (this will not violate the GPL license of GCC-XML). It can probably be hand-tweaked from there to account for API updates.
That's basically what Mike and I had been up to. In comparison to SharpDX, we intended to have something that was more broadly applicable (the SharpDX code has a lot of hard-coded rules in C# for leveraging transformation and was exceedingly difficult to modify cleanly, we have a more uniform approach implemented or planned and are more amenable to data-driven rules which would allow the v2.0 generator code to be split off into its own project for wrapping other C-like APIs). Most importantly, of course, our approach is legal. SharpDX violates the GPL (by including the gcc-xml binaries, which were modified to compile on modern Windows, without making the source available) and -- at least the last time I checked -- scrapes the MSDN documentation and reproduces it without consent.
Some other commentary and response:
- I agree that old APIs should be dropped, and I think your list is pretty conclusive in terms of what we should bother supporting.
- Using IDisposable is Bad(tm). We should absolutely use an explicit AddReference/ReleaseReference model to deal with the COM reference counts. The end-user can trivially wrap this in a faux-RAII IDisposable wrapper if they so choose.
- A fully-managed re-implementation of the Effects framework is an interesting idea and would certainly provide a way for SlimDX to differentiate itself. Wrapping the Effects11 code is obnoxious anyhow. I'd be interested in this except that it will probably involve parsing and I absolutely hate parsing.
- Multiple assemblies just lets an end-user include only the code they want or need. I think it's a bit cleaner, and it also makes it easier to work with the API description XML since it keeps it more localized. There is no real compelling technical reason though.
So, all of this said... I don't know how much of my discussions with Mike you've seen from IRC, Promit. But for the benefit of these other fellows on the cc-line, I'll repeat the gist of my current state of mind:
I am not all that interested in the direction Microsoft is taking Windows with Windows 8. Not from a user's perspective, and not from a developer's perspective either. I will withhold some measure of judgement until the thing actually ships, but right now I've basically stopped doing Windows development as a hobby. Consequently I'm not that motivated to continue working on SlimDX for the time being. I think the generate-from-API-XML approach has merit and that we've proven, with the current v2 codebase, that it is viable. So I might continue to develop that technology as a separate project regardless of what you do with SlimDX, once my sense of "burn out" goes away.
But for now you're probably safe assuming that I won't be making too many active contributions to the codebase over the next few months.
Can you elaborate on what the "leveraging WinRT heavily" approach might look like?
-- jmp
--
-- jmp