stevepoole wrote:Hi,
I can see one problem porting C programs to QLs. C language allows you to construct code in a huge number of ways. For example just consider FOR loops : Converting C FOR loops to QL Basic FOR loops would probably need to be done by hand, as I doubt whether software could do it, there being just too many combinations.
So forget QL Basic for now. This leaves the possibility of converting PC C into a QL C. As Tim said, QL C contains many keywords specific to the QL. This is a botlekneck when converting QL C to PC C, and the opposite would be much harder to achieve. CPort was written over 30 years ago by a professional QL firm, so who would have the time to write a cross-compiler to convert from PC C to QL C today?
Perhaps it would be more feasable to do it for QPC2, as this emulates QLs already via software. But again, a major task, and one that perhaps only Marcel Kilgus would be capable of undertaking in any case. But that would be to ask a great deal from him!
The fact that nobody has attempted it before reveals the difficulty of the task...
Very few QL programs seem to have been written in QL C, probably because Qlers love to tinker with code, and C code is far less easy to comprehend than Basic, so tinkering would be problematical.
Perhaps the best solution would be for a C programmer to write his algorythm in pseudocode, which somebody could rewite in Basic for QLers. This would ammount to authorised reverse-engineering!
Regards,
Steve Poole.
Nice long rant, unfortunately almost 100% wrong and very misleading to people reading this thread.
1) There is a actively maintained 68k cross compiler, it just needs QL linker info added, there was some basic work on this done on the forum which can be obtained by search.
2) qdos-gcc and c68 cross compilers already exist.
3) I ported Wander engine and one of the collosal cave versions from "PC C" to "QL C" in a matter of minutes + a couple of hours debugging. Its really not that hard to port CLI stuff. GFX stuff its pretty easy to extract the GFX routines and convert them to access QL screen structure.
4) Seems to be a fair number of QL C programs on dilwyns site
Please don't go round trying to make out C on QL is some unassailable task when all the tools are already there for a competent programmer.