life happens, I think this method has a high degree of problems - especially if doing such maintenance is a complicated and time consuming process, as I assume it is, unless one has all these tools(that they must write themselves..)caseih wrote:As I see it, there are two solutions to the bindings problem. One is for community members to step up and volunteer to maintain the bindings for a particular library. For example, TJF seems to be maintaining GTK .bi files. There are tools to make the maintenance a bit easier by automating some of the translation from C header files. TJF wrote one of those tools himself (I think I have his username right).
This is obviously the 'ultimate' - have it be so easy to maintain that it could even be done by anyone with a step by step instruction sheet... BUT, as you pointed out, writing this 'ultimate' translation tool, in and of itself, seems a task as complicated as writing the original FB compiler itself.... BUT, any person (or group) developing a language, that also took the time to write such a tool during the development process (probably the easiest and best time to write this tool) would give their new language a GREAT boost in overall desireability by anyone looking to learn and keeping an eye to future support of the language. This is what is needed for FreeBasic to become a serious and 'popular' alternative to the C variations.... and, along those lines, if it also had some built-in, easy functions like PNG support that did not depend on libraries, that would make it all the more appealing....The other solution is more technical, though related. If a full translation tool existed that could parse all of the complexities of C header files to FB code, then the problem becomes elementary. Any valid C .h file could be used, perhaps with a transparent translation step, with FB. This would be ideal, and there was some work done in this area. This is really hard, though, as basically one is making a full C99 compiler that emits FB code. Matters are further complicated by the preprocessor too, both FB's preprocessor, and C's preprocessor. If translation were completely transparent then #defines in FB code would be able to trigger things in C .h files. It would be seamless.
You know, I think back to when I first learned programming, which was in a form of basic. And of course the tutorial always starts out with 'Hello World' of some form. It was exciting to actually 'control' the computer and its screen, to know that instead of 'hello world' I could put anything I WANTED inbetween those quotes and I would make the computer display it. Then, on down the line, I tried to teach myself 'C'.. and there too was a 'hello world'... but I had to type 10 lines of code that was explained as 'we will tell you what these do later' before even getting to the 'printf' line... those 'mystery lines' of code were so daunting compared to the simplistic and completely knowable BASIC lines, that I felt 'C' was out of my league - even without having previously programmed, I understood the BASIC commands enough to make me feel confident, unlike the cryptic C language written by necromancers and evil magical beasts.... make it easy for beginners so they gain the confidence to learn the harder stuff... builds loyalty as well, just look at all of us die-hard BASIC users!