Slashdot Mirror


iPhone Gets .Net App Development

snydeq writes "Novell has announced MonoTouch 1.0, a commercial SDK that allows developers to build iPhone apps using Microsoft's .Net Framework instead of the Apple-designated C or Objective-C languages. The SDK leverages Novell's Mono runtime for running Windows apps on non-Windows systems, allowing developers to utilize code and libraries written for .Net and programming languages like C#. With MonoTouch, the Mono runtime provides such developer services as garbage collection, thread management, type safety, and Web services, said Mono leader Miguel de Icaza."

27 of 327 comments (clear)

  1. Launch Times? by glennrrr · · Score: 4, Interesting

    Well how long does it take to load the whole Mono framework runtime because every second counts on the iPhone?

    1. Re:Launch Times? by Gwala · · Score: 5, Informative

      Probably not too bad - my guess would be it's using the AOT version of Mono, which compiles the framework into the final application, resulting in much better load times in performance-critical environments (see http://www.mono-project.com/AOT )

      --
      #!/bin/csh cat $0
    2. Re:Launch Times? by Anonymous Coward · · Score: 4, Interesting

      If I am not mistaken and given that Apple bans other execution environments, the last step in building is compiling to native code. So there are no JIT times, I donÂt know about other loading times.

    3. Re:Launch Times? by digitalunity · · Score: 4, Interesting

      I would be more worried about WinForms compatibility. I developed a couple of .NET applications(never again!) and running them with the Mono runtime is markedly different than MS's runtime. Stability wasn't great with Mono and controls didn't always behave the same.

      Although I won't developing any more .NET applications if I can avoid it, it would still be nice if Mono matured to the point where it could replace the MS runtime without noticeable difference.

      --
      You can't legislate goodness. Let each to his own destiny, by will of his freely made choices.
    4. Re:Launch Times? by palegray.net · · Score: 3, Insightful

      My guess is approximately zero seconds, as Apple is sure to kill this.

    5. Re:Launch Times? by thetoadwarrior · · Score: 4, Insightful

      Like MS will ever allow that to happen. If .Net and Mono were completely compatible then it would be much easier to port apps to Linux and therefore remove the need for Windows.

    6. Re:Launch Times? by poetmatt · · Score: 4, Insightful

      It's no magic that Mono is always a version behind .net or more. It's just that lots of people are not realizing this yet, or the same with silverlight. It's stupid because if it was complete compatible then people would actually have more interest in windows, too.

    7. Re:Launch Times? by Snap+E+Tom · · Score: 3, Informative

      Because a secret agenda of theirs is to make you use XCode to develop apps. This was made quite clear to my former company on a project. That's why you won't see Java nor Flash any time soon, and the ToS explicitly forbids apps that execute external code. I theorize that by doing this they 1) want control and 2)hope that the iPhone development activity propagates into OS X development activity.

    8. Re:Launch Times? by SanityInAnarchy · · Score: 5, Interesting

      Actually, there are two large things standing in the way of that:

      1. The best .NET development tool, from what I can tell, is still going to be some form of Visual Studio.
      2. Unlike Java, .NET makes native bindings dirt simple. If you were using a DLL in C++, you can use the same DLL in C# relatively easily.

      #1 means that even if people want to target Mono, they might develop in VS.NET anyway, which is a bunch of VS.NET and Windows sales for Microsoft. #2 means that anyone who doesn't deliberately target Mono is probably going to call a bunch of native win32 code, just because it's so trivially easy to do so.

      Note that both of these exist even with a "100% compatible" Mono, unless it was also combined with a 100% compatible Wine, and we all know exactly how likely the latter is.

      --
      Don't thank God, thank a doctor!
    9. Re:Launch Times? by SanityInAnarchy · · Score: 4, Interesting

      How does this hurt Apple?

      I don't know, how does Google Voice hurt Apple? How does Java hurt Apple?

      I mean, you can sort of come up with a rationale, but it's really, really strained. Basically, it's not about whether it directly hurts apple, as whether it might hurt Apple, and/or whether it lets Apple give up even a tiny iota of control over their platform, and/or whether it hurts Apple's partners.

      In this case, it's probably about control. Apple is going to be very wary of any language which supports eval(), since that means my app could just download new code from the Internet and eval it, thus eliminating the middleman (bottleneck!) that is the Apple approval process for all future updates.

      --
      Don't thank God, thank a doctor!
    10. Re:Launch Times? by Cyberax · · Score: 5, Informative

      Java has quite nice bindings to C++ now in form of JNA ( https://jna.dev.java.net/ ), it's actually about as powerful as .NET interop.

      Of course, managed C++ is even better still.

    11. Re:Launch Times? by tyrione · · Score: 4, Insightful

      Because a secret agenda of theirs is to make you use XCode to develop apps. This was made quite clear to my former company on a project. That's why you won't see Java nor Flash any time soon, and the ToS explicitly forbids apps that execute external code. I theorize that by doing this they 1) want control and 2)hope that the iPhone development activity propagates into OS X development activity.

      Yes. Use our Development Tools on our Platform. Truly it is a secretive agenda. Get real.

    12. Re:Launch Times? by shutdown+-p+now · · Score: 3, Informative

      Java has quite nice bindings to C++ now in form of JNA ( https://jna.dev.java.net/ [java.net] ), it's actually about as powerful as .NET interop.

      Yeah, there's also J/Invoke.

      The problem is Java language itself. Yes, you can map unsigned ints to signed ones, pointers to longs and structs to classes, and so on - but mappings can get very complicated when API itself is (i.e. lots of nested structs/unions of arrays of pointers, etc). In C#, the type system lets you drop this level of abstraction when needed (or when it is simply inconvenient), and work with raw pointers, C-style fixed-size arrays, structs and unions with exact same memory layout - no marshaling involved. It is faster as well, obviously, since there's no need to copy data back and forth (which can cost a lot for large object graphs).

    13. Re:Launch Times? by EastCoastSurfer · · Score: 4, Informative

      I don't know, how does Google Voice hurt Apple?

      It hurts ATT and thus hurts Apple. The reason for the Google Voice rejection became clear when ATT announced their 'a-list' program to start on the 20th of this month. As long as you have a plan costing $59+ (most iphone plans) you can put 5 numbers on your a-list that will not count against your minutes. Add the Google Voice number to your a-list and boom, unlimited talk time.

  2. Re:Why CLR (.NET mono) and not JVM (Java)? by pavon · · Score: 4, Insightful

    MonoTouch compiles the code into a native executable, rather than shipping with a VM. Apple has no reason to disallow that.

  3. Re:Why CLR (.NET mono) and not JVM (Java)? by kalirion · · Score: 4, Insightful

    Since when has it needed a reason?

  4. Unity by tylersoze · · Score: 4, Informative

    Unity, www.unity3d.com, which uses Mono, has been available on the iPhone for some now.

  5. Re:Why CLR (.NET mono) and not JVM (Java)? by asdf7890 · · Score: 3, Informative

    Anyone know why Apple would allow one and not the other? Does Mono not multitask or something?

    No one has said that they would. The article itself states:

    Mono is associated with the LGPL (GNU Lesser General Public) license used for distributing free and open source software, Novell with MonoKit is distributing Mono under commercial terms. The LGPL requires that users can replace an LGPL library with their own version of a library, a conflict with App Store requirements, according to Novell.

  6. Re:Why CLR (.NET mono) and not JVM (Java)? by SanityInAnarchy · · Score: 3, Informative

    As the AC says, so does gcj.

    But the problem is, Apple has explicitly disallowed "frameworks" -- and this definitely sounds like a framework.

    Which is another way of saying, Apple is strongly discouraging if not outright banning one of the best ways to re-use code. Can anyone tell me why Apple is against code re-use on the iPhone?

    --
    Don't thank God, thank a doctor!
  7. No it doesn't. by Plug · · Score: 4, Informative

    MonoTouch is not a runtime or an "app", it's a library with which you compile your own apps. It's ahead-of-time compiled, so you end up with a binary that runs on the iPhone.

    It opens up iPhone development for millions of .NET developers, many of which may not have any interest in Objective C. And as far as I can tell, C#/Mono is garbage collected, and Objective C (on the iPhone) is not. That alone would make me interested in checking it out.

    If you're not interested, that's great, move along.

  8. Re:XOR to iPhone SDK? by Plug · · Score: 3, Informative

    It compiles to native code. It just allows you to use C# to do it.

  9. Re:Must be app-store approved... by Plug · · Score: 5, Informative
    1. It's not a "shell" or a "runtime", it is ahead-of-time compiled down to native code.
    2. This is a wrapper around native Apple UI objects, it's not using any Windows or .NET UI objects. You use the Apple Interface Builder just like you would if you were using Objective C.
  10. Re:Big Difference Between The Two by tylersoze · · Score: 3, Informative

    Haha! That's a good one. Although I'm sure the developers of the 250 games that have shipped with Unity probably care somewhat. :)

  11. Re:Mono? by RightSaidFred99 · · Score: 3, Interesting

    Are you being double-backwards redundantly hilarious? .Net and Microsoft are stable now. Let's see on what platforms the largest growth for remote exploits over the last year have been, shall we?

  12. Re:Mono by jcr · · Score: 4, Insightful

    I think you may be prejudiced by your previous experience.

    If his position is based on experience, then by definition it's not prejudice.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  13. Re:Why CLR (.NET mono) and not JVM (Java)? by ClosedSource · · Score: 4, Informative

    "MS fooled a generation of 20 and 30 somethings into buying its code books and learning how to code in their walled garden."

    Well, it was a much bigger garden than Apple's and the gardeners were well paid.

    "Once touched by MS you are not used to learning any new skills"

    Whatever you think of Windows, it could hardly be argued that developing for it didn't require learning "any new skills" (C, Win32,C++, MFC, COM, ATL, COM+, SQL Server, ASP, .NET framework, C#, ASP.NET, ADO.NET, DirectX, WCF, WPF, WWF, LINQ ...)

  14. As a beta user of this, let me clarify by rabtech · · Score: 3, Interesting

    Let me clarify how this works:

    1. Yes, it is compiled ahead-of-time so there is no violation of the iPhone Developer SDK ToS rules; this also means a lot of the powerful Reflection stuff doesn't work because you can't do runtime inquiry on a type and create an instance dynamically. It also means the DLR is unlikely to ever run on the iPhone.

    2. Much of the types map to Objective-C types, UI Kit, etc, and so does the only GUI library. (Note that types like System.String map to NSString, etc as well.)
    You actually still do your GUI in Interface Builder, but MonoDevelop picks up changes to the XIB and auto-generates partial classes to represent the XIB actions and outlets. This step alone eliminates a lot of the boilerplate crap you have to do with Xcode that we Visual Studio developers are used to having the computer take care of automatically. Events can be handled via the C# obj.Event += handler syntax, MonoTouch takes care of hooking it up behind the scenes.

    3. You can import Apple frameworks with DllImport and call any of the Foundation functions. There are also helpers that take handles (pointers) from those functions to Objective-C objects.

    4. Most of the glue is automatic by decorating your classes/methods with the proper attributes (eg: make a class implement a protocol, then mark the methods as to what message in the protocol it handles). It really is a very slick package and a joy to use.

    5. Garbage Collection! This rocks, it was very disappointing to see Apple fail to bring their GC over to the iPhone.

    6. Most of your libraries aren't going to work because they require reflection, framework classes, etc that don't exist or aren't statically linkable into your executable. Besides, that isn't the point. For me, the point is to use a language I am used to (avoiding the @synthesize, -/+, and [[[[[[[ crap that makes Objective-C annoying to use). It is impossible to overstate how much the automatic hookup with XIB files makes developing a GUI so much easier to do. I only wish IB would automatically make all controls Outlets, then I'd be set. I find that you spend way too much time spitting out boilerplate code and doing repetitive boilerplate actions in IB when the computer could just as easily figure all that out for me (like Visual Studio does with a WinForms app).

    --
    Natural != (nontoxic || beneficial)