×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    200

    Open C/C++ portability to "managed C" on Windows Phone 7?

    I am not entirely sure what section to post this is, but given the assumption that people in the Open C forum are probably the ones most interested in portability of "core engine" or "legacy" codebases, this here seems to be the most appropriate audience for now.

    This is kind of half question, half suggestion to Forum Nokia on a subject that will probably receive increasing attention over the coming year as the transition to WP7 is made.

    One of the big changes (at least from what has been known so far) coming from WP7 is the list of supported languages. At least today, Microsoft declare only XNA and Silverlight as supported development frameworks, and C# as the only supported language. While this may sound a bit similar to C/C++, at a detail level this is actually a very different language, especially in its "managed only" form that comes with more Java-like features such as Garbage Collection and handles instead of pointers.

    There are some other C/C++ variants that Microsoft experimented with on the CLR (the runtime interpreting the "bytecode" that C# and other languages get compiled to in a .NET world), but as the answers on this thread show

    http://stackoverflow.com/questions/2...ne-7-and-c-cli

    the restrictions to C/C++ code that can be ported in "/clr:safe" mode are actually quite severe, as it means avoiding many of the features of C that can be potentially unsafe, even just theoretically (i.e. you'll have to be able to convince the compiler that your code is not doing anything nasty, not some higher-level review):

    http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx

    Even then, the combination of using C++/CLI to target WP7 is not currently supported by Microsoft.

    As a result, I believe that one of the most important tasks for Forum Nokia over the coming year is to give developers guidance how to ensure that their code remains portable between the C++ centric Symbian/Qt codebase they are developing today and the future "managed C" world in Windows Phone 7. With the (now aborted) switch of the Symbian UI from Avkon to Qt there was at least still the assumption that "core engine" code could remain common between "classic" Symbian, Symbian+Qt and MeeGo, but as of today the development model of WP7 will imply major source code break at every level of application development.

    UI design will probably have to start from scratch in any case, but if even valuable core algorithms (game AIs, image processing, file format libraries etc.) have to be rewritten and re-tested from scratch, the effort to port "valuable" pieces of code will go up significantly unless portability beyond the Open C/C++ level is considered early on.

    So the time to prepare for this is probably "now", and not when the first WP7 devices start shipping.
    Last edited by mgroeber9110; 2011-03-07 at 10:01.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: Open C/C++ portability to "managed C" on Windows Phone 7?

    You can find a more or less similar thread, http://discussion.forum.nokia.com/fo...tion-questions, though no Nokia representatives have joined that discussion.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    200

    Re: Open C/C++ portability to "managed C" on Windows Phone 7?

    Quote Originally Posted by wizard_hu_ View Post
    You can find a more or less similar thread, http://discussion.forum.nokia.com/fo...tion-questions, though no Nokia representatives have joined that discussion.
    Thanks a lot - that is indeed the best place to continue discussion.

    As a follow up, I'll still cross-post a thought here that I originally wrote as a comment on AAS, as this relates specifically to Open C/C++:

    I now wonder if a "minimal" assured migration path should actually go through Open C/C++ rather that Qt - this would make it clear that the UI is "throwaway code", while stuff factored out to use only Open C libraries remains portable. This way, developers could already start to partition their code.

    This still leaves the issue of managed vs. unmanaged, but perhaps something along the following lines would work. Taking up Shaun's idea of a "what-if" Nokia announcement, how about this:

    "Nokia and Microsoft will work together ensure portability to WP7 with minor effort for code that fulfills the following requirements:

    - Only links to Open C library libc, libstdcpp, ... with the exception of API "x", "y", "z"
    - Compiles without errors in VC2010 with "/clr:safe" mode. A validation-only command line build of VC2010 is available on forum.nokia.com

    We recommend that you move as much logic as possible into libraries that fulfill these requirements, and add VC2010 validation to nightly builds to ensure no portability requirements are violated accidentally."

Similar Threads

  1. "My Nokia" message on "Sent" messages that won't open
    By txipumpumpa in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2009-09-30, 19:33
  2. Replies: 1
    Last Post: 2003-12-18, 17:38
  3. Replies: 0
    Last Post: 2003-10-23, 07:57
  4. Replies: 0
    Last Post: 2003-06-19, 17:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×