Page 1 of 2

PureBasic Cross-Compiler for Windows CE

Posted: Fri Jun 16, 2006 8:45 am
by Frontier
Hello,

I am evaluating the demo version of PureBasic 4.0 and so far I'm quite impressed with the quality of the software; so much that I consider buying it to show my support to the team (my main development system is and always will be C/C++).

I am particularily impressed by the powerfull RAD features PureBasic has and the tight code it produces. That makes me thing that *if* PureBasic gets a Windows CE cross-compiler, will become an instant hit on the platform and will boost PureBasic sales even further, since:

- The only professional-quality developer tools available are eMbedded Visual Tools (eVB - discontinued - and eVC++), Visual Studio 2005 (native and .NET development)
- PellesC (which is excellent, but is still C so it's not RAD).
- FreePascal fails to produce working code for these devices, due to linker (ld) deficiencies.
- NS/Basic is very expensive and not very optimized.

This means that PureBasic, once targeting Windows CE, will simply have no competitor in the Basic RAD area. .NET programming is possible on Windows CE, but these applications tend to be slow and bulky (heck, they're slow on desktop PC's too) for the under-powered CPU's these devices have.

If it was available for CE as well, I would pay extra to get it, plus the desktop version (regarding PureBasic). The fact that PureBasic uses Pelles linker (which can do CE PE executables) is encouraging, but I do not know how the backend works (I suspect that it produces asm code and this could be a problem).

Anyway, just my thoughts on this excellent tool, I just hope that Fred and his team have plans for Windows CE support, since this platform could definetely benefit from such a quality tool.

Best Regards from Greece,
Manos

Posted: Fri Jun 16, 2006 8:49 am
by netmaestro
Very good idea. Handhelds are a rapidly-growing market, and to me it would make far better business sense to focus on serving that market than MacOS. IMHO MacOS enjoys a small, fiercely loyal following that will probably never grow any larger than it is. The future is in the handhelds.

Posted: Fri Jun 16, 2006 8:52 am
by Trond
Now what if Apple releases a handheld mac?

Posted: Fri Jun 16, 2006 9:24 am
by Poshu
With the huge impact of Mac Intel (boot camp is love) I wouldn't say that... I just bought my very first Mac and I know a few other people who've done the same.

In addition, the case of handeld support has already been disputed & Fred can't support every system.

Posted: Fri Jun 16, 2006 9:27 am
by Frontier
Trond wrote:Now what if Apple releases a handheld mac?
Apple is doomed, forget it.
I'm not a Windows user, I am an Amigan :) but I do understand a couple of things regarding Apple switching to x86 (mainly their inability to control the PowerPC evolution - the Amiga/MorphOS is more capable of that). The fact that netmaestro writes above is 100% correct, even x86 Macs are not worth the trouble compared to the handheld market.

Symbian is strong in telephones, but that's it (and the OS - as I develop in Symbian C++ also - is not up to the level of Windows CE). Palm is going nowhere (Linux in particular, but that will take some time). CE is very strong, especially in the enterprise market (== more income for the PureBasic team by developers supporting enterprise/vertical markets and PureBasic users as there is much less piracy in this platform), has professional quality tools but alas only C/C++ managed/unmanaged and .NET. Clearly there is a market waiting for PureBasic to be taken. Just imagine all those who wrote for eVB and cannot go to VB.net (.NET bulkiness, incompatibility, e.tc). Imagine all those developers switching to PureBasic, which can do Win32 (available as a subset to CE), has all the familiar tools available working natively (aka fast), such as SQL Server CE/Mobile, SQLite, e.tc. Just thinking of the possibilities that PureBasic has on Windows CE, makes me very excited :D

In any case, I'm willing to help regarding a possible CE port (I'm proficient in C/C++ and CE), as I develop for this platform from 1998. My only concern is that I suspect that PureBasic has a lot of asm code (library and compiler) and that could be a problem; however, if this is not the case and the backend is more "compatible" (i.e C), then it is very easy - now that the compiler supports Unicode (CE is only Unicode) - to create a cross-compiler for Windows CE.

Posted: Fri Jun 16, 2006 9:39 am
by Frontier
Poshu wrote:With the huge impact of Mac Intel (boot camp is love) I wouldn't say that... I just bought my very first Mac and I know a few other people who've done the same.
In any case, I do not expect x86 Apples to even come close to 1/20th of the PC market, it's just another niche system for few people (quite expensive too).
In addition, the case of handeld support has already been disputed & Fred can't support every system.
We're not talking about some niche systems here, but Windows CE - which can be derrived from the Win32 PB (which works) - it is mainstream. All the base API calls are 100% the same (provided that PB is OS-friendly written), it's not something not-so-much-common like MacOSX for x86 or AmigaOS (which seems abandoned).

In any case, I assume that Fred wants to make some money out of it and CE is the way, as there ARE customers for PB, much more than those from MacOS. I just don't understand the negativity regarding Windows CE, after all Fred - in an interview - said that the compiler is portable, so that would not be a problem. What's wrong with making more money with something as good as PureBasic?

Just my thoughts.

Posted: Fri Jun 16, 2006 10:32 am
by Num3
It's just a thought, but with PB 4.0 you can build a special WINCE subsystem for PB, and force a manual compilation for HandHeld devices of the Pellec code...

WINCE API is quite small and compact, so i think a subsystem for it, would be quick to make!

Posted: Fri Jun 16, 2006 11:08 am
by mskuma
netmaestro wrote:Handhelds are a rapidly-growing market.. The future is in the handhelds.
WinCE is not just about handhelds - CE = Consumer Electronics, or basically any constrained environment/platform e.g. set-top boxes, GPS units, medical devices, headless systems, toys, POS terminals, and PDAs. I am not sure whether handhelds are the future.. look at the PDA market in general. Sony pulled right out of the market - not bright at all. One could look at the UMPC market.. this could be the future.. hmm maybe. MS threw a lot at the Origami project - getting some interest, but it (like many others like it) is an XP platform.
Frontier wrote:CE is very strong, especially in the enterprise market
I am not sure - while I agree it is used there, I think WinXP Embedded (XPe) is at least as strong (if not stronger these days) due to the inherent attraction that XPe supports the Win32 API (so many more apps available compared to CE) and the relative lack of experienced CE developers (somewhat unique API set). There are many WinXPe thin clients (dumb Citrix or MS terminal services stations).

However there remains a market for genuine CE products running on the cheaper WinCE OS platform. I agree there is a distinct lack of tools choice in the CE space, and PB could make an impact. If Fred is feeling so inclined, now might be a good time to look at CE with a new version coming (CE6) but this market is not so 'cut and dried' due to the availability of WinXPe and the increasing amount of 'embedded' hardware than can run it (albeit at greater licensing cost. This maybe the most compelling reason for some people to use CE over WinXPe - so on the other hand, having a PB version for CE might attract more people to develop for it, thus giving a good market reason to consider a CE version).

Posted: Fri Jun 16, 2006 11:08 am
by DoubleDutch
It's just a thought, but with PB 4.0 you can build a special WINCE subsystem for PB, and force a manual compilation for HandHeld devices of the Pellec code...

WINCE API is quite small and compact, so i think a subsystem for it, would be quick to make!
The WinCE is very close to the existing windows API.

The problems is that it's a different processor. Its an ARM not an x86 (I know different varieties of PocketPC exist, but they are now quite rare).

If PocketPC is supported then Windows Mobile will automatically be supported as its based on WindowsCE too.

It would be great to write native apps (not Java based ones) for windows mobile phones.

I guess though that a PocketPC version is a long time away, probabily after the Amiga version! ;) ... :(

Posted: Fri Jun 16, 2006 11:45 am
by Dare
PureBasic supporting a handheld (WinCE or whatever) would be an exciting (and I think a clever) move.

Would love to see it (and use it). Doubt it will happen. Probably the main obstacle is not enough hours in the day for the small PureBasic team.

For the gurus: Is getting fasm to run on the handheld OS of choice the main requirement? (For all I know, fasm has already been ported).

Posted: Fri Jun 16, 2006 12:13 pm
by DoubleDutch
I seem to remember Fred once writing that porting to a different processor wasn't that difficult because of the virtual processor the compiler really compiles for or something. Anyone else remember this?

If thats the case, then if WinCE calls are so similar to Windows calls, then why should a PocketPC version be that hard to create?

(I don't mean to compile and edit on PocketPC - I mean to generate an executable for an ARM based PocketPC).

Posted: Fri Jun 16, 2006 12:20 pm
by DoubleDutch
Here is where he mentions the virtual processor:

http://www.purebasic.fr/english/viewtop ... +processor
The main differences against normal compiler was the integration of a Virtual Processor (which actually use the 680x0 assembly mnemonics) right from the beginning to allow different kind of assembly (or any langage in fact) output without changing the compiler core.
The linux version was a logic choice, as it shares the same Virtual Processor than the Windows one (x86) and 'only' the libraries had to be rewritten.
Fred: How long would it take to write a Virtual Processor section for the ARM processor, so that PocketPC could be supported by cross compilation?

I'm sure that most people would donate if you started a fund to help pay the dev costs.

Posted: Fri Jun 16, 2006 12:47 pm
by Frontier
Actually CE does not only stand for 'Consumer Electronics' but 'Compact Edition'. None knows what CE really means, anyway :)

The fact is that CE is not only about PDA's, but phones (Smartphones), internet appliances, the AutoPC (imagine being able to program your car audio logic in PureBasic/CE...). It is an embedded realtime operating system (like AmigaOS is), but fully compatible with Win32 and technologies (MFC, COM, ...), that has a small memory footprint and little demands on the underlying hardware, thus low power consumption.

The UltraPC is none of the above and will never be. Period! The same goes for TabletPC as well.

Reading the background of the making of PureBasic, by Fred, I learnt that the main compiler logic is written in C, not in asm (the library is), plus the Virtual Processor technology means that ARM/MIPS/SH3 code can be produced (ARM would suffice, since it's the dominant processor on the CE market these days): even PellesC (which directly supports CE and it's free) can be used to create the PureBasic cross-compiler (as correctly stated above), only the compiler needs to be adapted (and the library - that is the main issue IMHO), the IDE and the rest development will be done on the desktop.

Anyway, I am willing to help in any way creating a PureBasic cross-compiler for CE (donations included).

Some quick links for the free developer tools for CE and the device emulator that aid in developing Windows CE applications from the desktop, without having to use a real device:

- eMbedded Visual C++ 4.0 (targeting ARM for CE 4.2 and 5.0): http://msdn.microsoft.com/mobility/othe ... fault.aspx
- SQL Server Mobile (Free SQL Server for Windows CE): http://msdn.microsoft.com/sql/mobile/default.aspx
- PellesC (another free excelent tool): http://www.smorgasbordet.com/pellesc/

Thank you for your time.

Posted: Fri Jun 16, 2006 1:46 pm
by dracflamloc
Considering he hasnt even finished the linux or mac version of pb4 yet.... this would be something he probably wouldnt get to for a year.

Posted: Fri Jun 16, 2006 6:42 pm
by Bonne_den_kule
I think 64 bit support has higher priority then supporting WinCE.