Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Could compilation on the device be possible?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-18-2009, 12:30 PM
Newbie
 
Join Date: Aug 2007
Posts: 4
Default Could compilation on the device be possible?

I have always like the idea of being able to do full development on the device, even partial (as Basic4PPC offers) is a great benefit but to complete the process would be even better. It’s not that the device is necessarily the best platform for development (it isn’t) but using just the device allows things to be tried any time, as you always carry your phone, don’t you?

I have been puzzling over this for ages and have seen questions posted before asking whether it is possible to do the full compile on the device and the response I always remember is "the compilation process includes methods which are not supported on the device". I assume this means there is x86 code which Basic4PPC uses but has no control over.

I did wonder whether something like DOSBox could be used to run the x86 code but knowing that one Windows component which is called is 1.5MB in size suspect this wouldn’t work as is. In the past before using Windows Mobile I used a DOS emulator on Psions (5, 7, Netbook) to develop PIC microcontroller code …. I’d write the code using a text editor running natively on the ARM based machine and then run the assembler under the DOS emulator.

I was about to give up on the idea but after some further web searching I finally believe there MIGHT be potential for FULL development on the device which means the possibility to develop, compile and test code without having to transfer between machines.

I’ll apologise here in case I use the wrong terminology, etc. I am an electronics design engineer with fairly limited software experience, command line type stuff rather than OS or GUI. I originally wanted something simple to allow me to write code for the PPC devices but expected it to be console type software. I ended up with Basic4PPC which does so much more (fairly easily) but am probably still getting my head around what I might describe as event driven software.

See what you think to my thoughts below and whether it could be a possibility:

I know csc.exe is run when compiling Basic4PPC because of the command prompt box which appears and that csc (by it's own admission ..... what it tells you if you run it ..... is Microsoft's Visual C# compiler for .NET framework). I also remember that ilasm.exe has been referred to which I have seen described as a compiler to common intermediate language (is this non-optimised compilation?). I’m assuming these executables are part (or hopefully all) of what Erel refers to as the “methods” not available on the device.

I've come across the "Mono" project before, but it appeared again when I googled something along the lines of ' +csc.exe +"Windows Mobile" '. But interestingly this time I found a reference to msc.exe, what appears to be an open source version of csc.exe

I understood the idea of Mono was to rewrite the .NET code as open source to allow Microsoft .NET programs to run on Linux for example. This in itself wouldn't help us compile Basic4PPC but could perhaps, if my understanding is correct, one day let us run compiled Basic4PPC code under Linux or maybe other operating systems.

It seems, having discovered msc.exe that you could now compile code under Linux to use (mono).NET, and reading a little further, msc is tested by using it to compile 'standard' C# code and testing it both with .NET and (mono).NET. i.e. This says that if you created msc for Windows you could use it in place of csc.exe. This brings us to my theory, expanding on this idea, maybe if you created (compiled) msc for Windows Mobile then the device IDE could call this (msc.exe".ARM") where the desktop IDE calls the standard csc.exe".x86".

Could this be enough to make full compilation on the device a possibility?

I guess if this were possible it would be the biggest step to on-device compilation and would be fairly easy to implement (in effect very similar to the desktop). Along with this I guess there might be a few further “wants” for the device IDE, the first of which, in my mind at least, would be to support different screen/form sizes like on the desktop and along with this the need to support dimensions potentially larger than the screen the form is being designed on. (it might even give some hope to the idea that one day the IDE could run under Linux, or Windows CE or something else!)

I shall be very interested to read any feedback on the idea!

p.s. I like the idea of the device IDE being provided as a CAB so that a PC isn’t needed to get the code onto the device and also, as mentioned in the current beta testing, the desktop IDE to be provided in a form that can be copied to the machine rather than installed. I use the installed desktop IDE then copied to a memory stick (along with PortableApps) and used on various machines ….. if the need to install in the first place (or option to install or not) could be provided it would be a great benefit.

Regards,

Mark
(XDA Zest, Touch HD, ipaq 214)
Reply With Quote
  #2 (permalink)  
Old 05-18-2009, 06:10 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

The optimized compiler works by first converting the Basic4ppc source code into C# code and then running csc.exe which compiles the C# code into a device or a desktop executable.
csc.exe is a windows program and it cannot run on a Windows Mobile device.
I'm not familiar with msc.exe however Windows Mobile doesn't appear in its supported platforms list.

As I currently see it the legacy compiler will be removed in the future from Basic4ppc and only the optimized compiler will be available. So I don't think that compiling on the device will be possible in the near future.
__________________
Basic4android documentation
Reply With Quote
  #3 (permalink)  
Old 05-18-2009, 09:34 PM
Newbie
 
Join Date: Aug 2007
Posts: 4
Default More thoughts!

I referred to msc.exe as a mono equivalent of csc.exe

I've also found references to

mcs and gcs which are compilers for 1.0 and 2.0 runtimes.

There's a good description here and a link to sources but I'm afraid beyond me.
http://www.mono-project.com/CSharp_C...#Obtaining_MCS

The line

"MCS is written in C# and uses heavily the .NET APIs (in particular it uses Reflection and Reflection.Emit). MCS runs on Linux with the Mono runtime and on Windows with both the .NET runtime and the Mono runtime."

is perhaps encouraging but I probably don't fully understand what it is saying .... still wonder if this could be built/compiled for Windows Mobile.

Regards,

Mark
Reply With Quote
  #4 (permalink)  
Old 05-19-2009, 09:31 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Mark Stonton View Post
in particular it uses Reflection and Reflection.Emit ... is perhaps encouraging .... still wonder if this could be built/compiled for Windows Mobile.
Nope! The Compact Framework, even the latest version 3.5, lacks Reflection.Emit and some of the other Reflection stuff necessary to support a managed compiler.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimized compilation susu Questions (Windows Mobile) 10 01-15-2009 10:07 PM
optimized compilation manu Questions (Windows Mobile) 4 08-06-2008 07:17 PM
Error during compilation mozaharul Questions (Windows Mobile) 2 06-10-2008 03:50 AM
Optimized Compilation problem on the device bob Questions (Windows Mobile) 4 03-12-2008 02:05 PM
Version 6.0 Device optimized compilation problem HarleyM Bug Reports 0 12-28-2007 03:01 AM


All times are GMT. The time now is 04:36 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0