Announcement: Starting work on EiffelVision for Mac OS X

by Daniel Furrer (modified: 2009 Mar 17)

I started working on a new port of EiffelVision for Mac OS X.

My plan is to use Cocoa (instead of Carbon as with the unfinished "vision4mac" port) and I'll be working on it 100% during the next 6 months. If you're interested in hearing more about it feel free to leave your comment here so that I know I should keep you updated :)

I'm mostly planning out the details now but I do have a small proof-of-concept application running already that creates a Cocoa window from an Eiffel application by using embedded Objective-C calls.

Comments
  • Peter Gummer (15 years ago 19/3/2009)

    Definitely interested, Daniel!

    Is this made possible by changes in the Eiffel compiler to allow it to call Objective-C?

    • Daniel Furrer (15 years ago 21/3/2009)

      Objective-C

      At the moment the only thing I am doing is inlining Objective-C in Eiffel features just like with regular C code (there's also no special keyword as you can see). E.g. I can write: frozen menu_insert_item (a_menu: POINTER; a_menu_item: POINTER; an_index: INTEGER) is external "C inline use <Cocoa/Cocoa.h>" alias "[ { NSLog(@"NSMenu %x insertItem: %x atIndex: %i", (int)$a_menu, (int)$a_menu_item, $an_index); [(NSMenu*)$a_menu insertItem: $a_menu_item atIndex: $an_index]; } ]" end I'm not sure yet if any more support is needed and what it will look like.

      • Manu (15 years ago 21/3/2009)

        Ideally, it would be better to have something like objective-C instead of just C. I mean it is necessary because I'm sure you need to pass a special option to the C compiler and EiffelStudio is not providing it to you. So if you put `objective-C' rather than C, EiffelStudio will know that it needs to pass that C compiler option to compile objective-C code.

      • Paul Bates (14 years ago 17/4/2009)

        Huh! I'd never tried that! I assumed gcc would just complain if a *.c file was found to using Objective-C code. I was going to look into having the compiler generate .m files but I guess there is no need :)

        Daniel, I very, very much look forward to the port. If I can offer some assistance then I let me know, although I probably cannot help you with the port efforts because I have other priorities.

        • Daniel Furrer (14 years ago 24/4/2009)

          cool

          There is a flag for gcc that allows ObjC code in a .c file :)

          Glad to hear that you're looking forward to it.

  • Peter Gummer (15 years ago 23/3/2009)

    We need that Cocoa Vision2!

    Just to emphasise how Vision2 for Cocoa would help us, we've just had a problem reported by a user trying to run our application. This is at the end of the log that they sent us:

    dyld: Library not loaded: /opt/local/lib/libgtk-x11-2.0.0.dylib

    I suspect they didn't read our installation instructions:

    The following prerequisite software is needed for the Mac version of ADL Workbench:

    • Install X11 from your Mac's Developer Tools disk.
    • After installing X11, run Software Update. (This is especially important if you have Leopard, because the version of X11 on the CD has many bugs.)
    • Download and install the latest .dmg file for MacPorts from http://svn.macosforge.org/repository/macports/downloads/.
    • When MacPorts is installed, open a new Terminal window and execute the following command: sudo port install gtk2. This will download, compile and install the gtk2 library and all of its dependencies. (This can take a few hours depending on the speed of your machine.)'

    It will be so nice not to have to worry about any of that!

  • Paul Bates (14 years ago 18/4/2009)

    Daniel, I was thinking about this project late last night and wondered how you were going to address a few things without compiler support. Cocoa use selectors which are a unbound Objective-C message, this might cause an issue. Also Cocoa relies on delegates and implemented informal/formal protocols to achieve some fundamental tasks. Have you managed to utilize use of selectors or delegates without the use if generated or hand-crafted Objective-C classes?

    For instance, how/where would you implement the applicationShouldTerminate: delegated message for the NSApplication object?

    • Daniel Furrer (14 years ago 24/4/2009)

      Delegates ...

      Thanks for this interesting question and sorry for only getting back to you now. (It would be nice if the system could send messages if a new comment is posted...)

      It is indeed something that I have spent quite a bit of time on because I hoped there would be a nice solution but it turns out that writing a couple of pure Objective-C files is the proper solution IMO. I currently have a pure Objective-C file for all the classes whose delegates I need. This file only contains a very thin wrapper, i.e. a class with the delegate methods that call the appropriate Eiffel methods (whose locations are passed in the constructor). (Only 15 out of the around 170 classes in the Cocoa UI use Delegates and then there are a couple of DataSources so it's not too bad. For more see Cocoa Fundamentals)

      Please feel free to add your suggestions if you see a better solution!

      • Manu (14 years ago 24/4/2009)

        Simply subscribe to the RSS feed at the bottom of http://www.eiffelroom.org/recent_changes. This is the best way to keep updated from new things happening on eiffelroom.

        • Daniel Furrer (14 years ago 27/4/2009)

          Access denied

          You are not authorized to access this page. :)

          • Administrator (14 years ago 27/4/2009)

            Now, the recent changes should be accessible by anyone. Could you confirm?

            • Daniel Furrer (14 years ago 13/5/2009)

              nope, still the same message.

              • Jocelyn-Fiat (14 years ago 13/5/2009)

                You really mean http://www.eiffelroom.org/recent_changes is not accessible for you? Can you paste the exact message?

                Can you try again. ... Previously I checked it was available for anonymous visitor. It seems that for standard user, it may not be accessible. Now it should be...

                • Daniel Furrer (14 years ago 27/5/2009)

                  Ah, I really have no clue what was wrong but it is indeed working now. thanks

                  • Jocelyn-Fiat (14 years ago 27/5/2009)

                    It was a matter of configuration on the web site. Thank you for the confirmation.