The generator is not at all intended to be run on a per assembly basis... this is just not possible. The generator should be run, let say, before root assembly, SlimDX.dll, as a pre-build event, and It will generate all the code for all the assemblies.
wow... all those legal issue are scaring me... seriously... I can move the struct declaration but I will keep the defines (they are just defines, and In my life, I haven’t seen any legal issue with defines).... Structs declaration will be moved to their XML counterpart... that will be loaded by the generator (this plainly stupid, xml vs .h)
So, if I understand how you want to setup the project, you have in mind to have a single project with the tools (parser/generator) together with all the assemblies.So the solution should look like this?
Oh, btw, could you prefix your svn checkin for v2 with v2?
No, I really don't agree.
One reason is that the defines in win32_ext are not the same than in the windows SDK headers, some of them are used to catch things (like the GUID), someme of them are not defined like in win32 (like BOOL, because BOOL in win32 is mapped to unsigned int, and we NEED to have the information that it is a bool in C#), some of them are used to black list some part of DirectX SDK headers....etc.
Also, working with win32 sdk headers would lead to handle a lots of #include dependency, because the types are defined in several swapned includes, just a plain nightmare.
This is definitely not something I would do and agree with it, plus, I didn’t intend to work on a generic C++/C parser that would be able to parse any kind of C++ header file, I don’t have time, and NO interest in it.
--
You received this message because you are subscribed to the Google Groups "slimdx-devel" group.
To post to this group, send email to slimdx...@googlegroups.com.
To unsubscribe from this group, send email to slimdx-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/slimdx-devel?hl=en.
There is a large palette between quick and dirty vs slow and heavy. On the
other hand, Keep It Simple and Smart, this is what I'm trying to follow on
every project I have been working so far (And I have been technical lead of
dozens of developers for several years, so I do know what is really dirty,
and what is leading to great things).
But ok, If Josh feels confortable to handle the task to handle correctly
this, I'm fine.
On this particular issue (defines and 4 structs defined in the code), I'm
just amazed by the solution you are validating to overcome the problem
(starting from the point that I still don't see the problem, anyway).
Also, so far, I have been the only contributor on the current v2 code, which
represents already a substantial amount of work (btw, I have been paying to
myself my salary for the 2.5 last months to work on this, just in case you
wouldn't understand how much I'm involved in this :D ), so I would be glad
to have some support!
Washu, concerning 1). I will write something soon. I have written a small
document on my blog If you haven't read it yet. There is a bit of
explanation here about the idea behind the process.
But the brandly new v2 has changed little bit things, so It might be a good
idea to write this down.
Concerning 2)
For A) As far as the process is transparent, I'm Ok. Josh proposed something
to update the vcproj directly, It would be great. But please, nothing like
"exit visual studio, restart".
For B) I agree on this, as It's going much easier to maintain, develop, and
would lead to other nice opportunities.
Concerning the doc, ok, this is clearly a disappointment. Now, I would like
to hear your solution(s).
Current statistics for v2 generated code are:
Number of interfaces : 251
Number of methods : 1714
Number of parameters : 5016
Number of enums : 285
Number of structs : 252
Number of fields : 1469
Number of enumitems : 2732
Number of functions : 297
Which is more than 10,000 documentation items to fill. What do you propose?
I cannot consider a "solid and rock" library without an API documentation.
There could be someone to write a tool to extract the current SlimDX
documentation and map it to v2 (although the current documentation is far
from being filled), could-it be a starting point?
I'm sorry for this. I just had the bad feeling that you (not you directly)
telling me "Boy, you have a short seeing view on things, you don't know what
kind of direction to go for, you are developing quick and dirty. On our
side, we are thinking long term and develop things for the next century".
>>>>>>> The generator is a good idea, and so far we like what it's
>>>>>>> producing.
>>>>>>> The problem is with the generator source code its self. It is very
>>>>>>> inflexible, requiring modification at the source level in order to
>>>>>>> add
>>>>>>> new imports, also a lot of it needs refactoring to clean it up and
>>>>>>> make it more readable and maintainable. As the generator is going to
>>>>>>> be a core component to SlimDX.2 it has to be very high quality code,
>>>>>>> as we're going to have to live with it for a few years at the least.
>>>>>>>
>>>>>>> Common examples of problems includes the lack of configuration data/
>>>>>>> files for indicating parse points. As an example, all of the
>>>>>>> "Program*.cs" files should be configuration XML files, not hard
>>>>>>> coded.
I agree, and It didn't say that current code should stay as it is. This code
is a large prototype/proof of concept, and I did it because I was
frigthtened by the direction SlimDX 2 was taking (or not taking).
I mean, If all of this, starting from the whole generator, was so obvious,
It would have been already done... and I doubt that If I came to SlimDX team
with only the idea of it, you would have say "yeah, cool, we go for it"...
but most probably, I would have heard "We tried already but It's not
praticable, sorry". Then, that's why I was little touchy on comments,
because It's like you were finally talking about my work in terms of "oh, of
course, but it's so badly implemented, we have greater plans". Voila, this
whole debate is probably because we don't know yet enough each other, as
well as you need to make enough space for me to get in the SlimDX team as
much as I need to leave and let large part of the work I did in other good
hands. :)
That's said, I fully agree with all of you in improving the whole code, and
happy that you are taking it seriously and going to improve it, and more
happy because I do know that SlimDX team members are clever to push things
in right direction (Ok, I had to learn some general behavior about the legal
issues, which frustrated me at the beginning, but that's fine now... It's
probably a cultural thing, as probably in France, we are mush less sensitive
to this subject!)
For the XML based configuration, I agree, and previous work on the code has
been largely done in this direction, although I was still keeping C# code in
order to refine the code usage, ease the debugging for a particular mapping,
clearly identify mapping functions and to prepare things to make them
simpler (older version were far less flexible than that). The tagging system
for example was not done at the beginning, but then, I found that It was the
most practical way to associate things easily in order to manipulate the C++
object model.
>>>>>>> Other issues are things like OnIncludeLoad in CppHeaderParser.cs,
>>>>>>> which assumes an incorrect accessibility level to the header files
>>>>>>> (fixed in recent commit), and also silently fails if it can't load
>>>>>>> the
>>>>>>> header (prints out the exception and then returns blank).
This behavior was largely due to Boost.Wave. Boost::wave for example is
testing the files in the include path you provide, before calling
OnIncludeLoad, which is pretty stupid, because you cannot implement loading
include files from anything else than the disk. Also, all the OnXXX are
called from boost::wave which is native code, meaning that you cannot
forward exceptions to the upper managed level. Like for the generator, the
parser is far from being failsafe proof in all C++ cases, again, It's a
prototype and I do agree that It needs to be improved. Though, it's working
on DirectX SDK headers now.
The way the code running right now is like this :
- .NET/CppParserHeader.Run() => .NET/Boost.Wave.Net.Preprocessor.Run() =>
... => (C++)boost::wave => BoostWave.NET => OnXXX => handle includes,
tokens and Parse
In fact, It would probably safer to only handle includes and tokens in the
OnXXX and then after Boost.Wave.Net.Preprocessor.Run() returns, handling the
whole parsing for all the tokens. I will look at it at some point.