1. 33

I.e., it’s WINE but for running macOS programs on Linux.

Looks like they still have a lot of work cut out for them (e.g., it does not yet support GUI applications), but it also looks like a solid effort and already has a fair bit working.

I have never really been drawn to having a lot of macOS things on Linux, but I suspect those in the creative sphere (e.g., video editors, audio creators and the like) may find this really interesting when it reaches its potential.

  1.  

  2. 9

    From what I can remember, the tricky part with the GUI is that Cocoa (OS X’s widget toolkit) is difficult to work with. I believe GNUStep (https://www.gnu.org/software/gnustep/) is the most complete compatible library

    1. 9

      Fun fact: GNUStep is older than Cocoa! It was originally a FOSS reimplementation of the NeXTStep toolkit.

    2. 5

      Whoa! I’ve wanted this forever!

      1. 4

        Question for people who know about this area: what exactly does a translation layer do? Is it basically about re-implementing APIs from the translated OS to work in the host OS?

        1. 13

          My understanding of both WINE, the WSL and this is essentially that the translation layer is a piece of software that intercepts system calls from programs which target the original platform and transforms them into system calls (and system library calls in some cases, if I am not mistaken) suitable for the platform on which they are being run.

          This allows the programs to be run without recompilation or modification on the new system, since there’s just an intermediate talking to the system for the program (very much like a translator in real life).

          This is just my limited understanding of how they work, so it could very well be wrong; anyone who knows better than I, please correct me!

          1. 11

            That is an excellent summary. I would also add that WINE doesn’t just fake syscalls; it also fakes the dynamic linker to replace attempts to load system libraries. Depending on the library and the configuration, it may replace them with its own internal implementations, or with libraries in one of the normal Windows file formats. Libraries that it loads from files may be either clean-room reimplementations that are part of the WINE project, or original implementations from Microsoft or a third party. Wine does not recommend using Microsoft’s implementations for anything, but some users do, for increased compatibility, especially with games.

            1. 5

              Note that the CPU architecture must match for this to work. If macs were still using powerpc the linux host would also need to run on a powerpc.

              Also worth pointing out is that tricks like this are only needed to run proprietary software which cannot be recompiled by the end user.

              1. 2

                Was curious about that for OS X on PowerPC to spare build systems doing pkgsrc bulk builds. The kernel is fairly aggressive with regards to usage of resources & systems run fairly slowly with OS X anyway. It currently takes a month to attempt a full build of every package in the pkgsrc tree on a G4 Mac Mini. Would be cool to either be able to use modern Power hardware to speed that process up.

                1. 2

                  If you don’t mind the power consumption, fast G5s are pretty cheap on eBay. A quad core model with lots of RAM and fast disks should do a bulk build a lot faster than a G4 Mini.

                  1. 1

                    The issue is not so much the hardware, it’s OS X. G4 Mini running NetBSD-HEAD is impressively quick in comparison. I have neither the space or the strength to house a G5 PowerMac. I have a 1st gen G5 iMac however.

              2. 2

                The thing is implementing the libraries after you implement the syscalls, and things might not end up being compatible. For Linux, practically everything is open source for you to use, and Linux is a simple enough system you can get right to running libc and friends unmodified. It’s implementing the alien-tp-POSIX Windows API and now CoreFoundation and Cocoa that’s the hard part.

                1. 1

                  Okay, cool, and that makes sense. I’ve only used Wine a couple times, and it always seemed a bit like magic.