How far along is this? I think she's underestimating how hard it is to implement a modern filesystem that won't eat users' data. I've been working on a Linux APFS driver[0] for several years, and it's not fully functional yet. It's a pity that she is working with FreeBSD, or it could have been of use to her.
I suppose FreeBSD made more sense as a base considering MacOS is derived from BSD.
The XNU kernel does not have a stable syscall ABI so perhaps it doesn't matter if the syscalls are different because the implementation of libSystem can convert as appropriate in userspace (see also: WINE).
As another commenter noted: XNU = Mach + FreeBSD.
What you are referring to is what NeXTSTEP was, Mach + BSD4:
* https://en.wikipedia.org/wiki/NeXTSTEP#Unix
By the time Apple got to them it was a few years later, and so they decided to updated that part of the kernel, and also brought in FreeBSD's userland.
Partially, XNU is Mach AND the FreeBSD-Kernel:
That said, there's nothing stopping you or anyone else from reworking my code into a (gpl-licensed) FUSE driver. I don't think it's a straightforward task, but it can definitely be done.
Historical note: FreeBSD used to support XFS; I believe it was ported from Linux.
Why is that so hard? Because of edge-cases? Caching/Timing considerations?
How hard this is, it depends on the filesystem. Something like FAT, for example, is pretty much designed for ease of implementation, with few edge cases. Modern filesystems are not like that at all, the data structures are very complicated, so they must be extremely well tested before they are good enough to use. That would probably require an fsck to check for subtle inconsistencies; in the case of APFS you can use mine, but it's still very incomplete. Apple's published fsck is not very thorough.
As an example of the kind of problems to expect, I recall a bug in the Linux HFS+ driver. If you had a drive with lots of short filenames and lots of long filenames, and you started deleting the short filenames, eventually you would lose half of your files. This kind of things happen because HFS+ has variable-length keys in the index nodes of its trees, so deleting a record may trigger a complicated cascade of node splits. APFS inherited this feature, and it was very annoying to implement.
But HFS+ is very well documented; APFS is not, and that doesn't help.
[0] https://www.theregister.com/2018/02/16/apple_file_system_bug...
• C being a shitty language that does not force or even encourage programmers to handle errors
• implementation knowledge about file system technology is generally stuck in the 1990s
• disk controller hardware lying to the OS to make them appear more performant than they really are
visit https://danluu.com & ctrl+f "files"
I don't see where this is coming from. Most of the world's top filesystems are written in C, and they work just fine. Maybe other languages could get better results, but it's hard to say with so little data.
> implementation knowledge about file system technology is generally stuck in the 1990s
If you are talking about me, that might be true, I'm relatively new to this and still learning. But there's definitely people out there with some serious "implementation knowledge". And tools like xfstests did not exist in the 1990s, that makes a huge difference.
And for specific examples of options with better safety records, then sure Rust would be one possibility, as would Ada, or Frama-C if you need to stick with C.
> I'm simply disputing your general claim that moving away from C would not help
I never said such a thing, I said we don't know. As always, in theory, there is no difference between theory and practice; in practice, there is.
FTFY
Btrfs' implementation is even used to do most of the functionality in the tools (like send/receive) rather than using the kernel to do it (in order to minimize context switches that reduce I/O performance).
The benchmarks on their website[1] compare it running on a 4 x 3.20GHz with hardware AES-N instructions, against an in-kernel implementation of a different cryptosystem running on a 2.7GHz cpu that does NOT have AES instructions. I also can't see anything that speaks to speed of the storage (or if this is controlled for), so I'm admittedly quite skeptical.
The numbers they do publish aren't particularly impressive to me either, so we may also have wildly different ideas about what "quite high performance" even means.
[1]: https://nuetzlich.net/gocryptfs/comparison/#performance
On top of that, since there is no single standard interface in the kernel, kernel maintainers are skeptical of adding shims to the mainline kernel. The Linux kernel developers are perhaps the most famous for being vocal about this, but they are not unique.
That being said, there are portable file system implementations that use FUSE. See e.g. NTFS-3g[1]
Hard to see how this can be done legally. The libraries (sorry, Frameworks) that make up the user-space runtime for macOS are all proprietary. There's no replacement for the most important parts of it.
https://www.eff.org/cases/oracle-v-google
https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America,_....
I meant to imply that unlike the case with Windows/Wine, there is no reimplementation of the overwhelming majority of macOS APIs. So if you wanted to do this now, you could only do it by copying frameworks directly from macOS (which some people are doing for various reasons), and that does have some potential legal issues.
Theoretically, a reimplementation is possible. It doesn't exist, it's a huge project (far, far bigger than GNUstep), and as someone notes down-thread, it's also a moving target. There are also uncounted numbers of bugs in the current implementation of Apple's APIs, and for many things to work correctly you'd need to implement the bugs too since developers have designed around them.
Yes, Wine exists. But Wine started in 1993. The idea that a bit of hard work by some good developers is going to provide a reimplementation of the macOS frameworks in a year or three strikes me as without any foundation in reality.
And you're right - the Cocoa API continues to evolve, so if the goal is "source compatible with latest and greatest macOS APIs" it's hard to see how a small group of open source devs can out-run the sum totality of every API engineer at Apple.
I have similar feelings about cross-platform tools like Flutter as well - the idea in a vacuum is reasonably sound, but then you run into the basic scale problems of maintaining compatibility with a moving target - a moving target that has >10x more staffing than you do.
That decision only applies in the USA. I think it will be undetermined in many jurisdictions.
IBM hasn't been doing that for decades, despite the supreme court decision being quite recent - I think that was more about clean room reimplementation than APIs.
My point wasn't about ruling differently but the lack of rulings/laws making it explicitly legal creating uncertainty and opportunities for Oracle/Apple to go after people. Some countries have other ways to deal with it too, e.g. NZ allows reverse engineering for compatibility purposes, which seems likely to cover APIs (not sure, haven't needed to know).
As an example of how this works in practice, the disassembler/decompiler Hopper has both MacOS and Linux versions that are compiled from the same code.
Now, how successful they'll be extending the open source frameworks to made this useful in compiling non-trivial software that wasn't written with "dual compatibility" is a fair question, but the starting pieces are there, and patching the compilers and creating a copy of MacOS's filesystem layout would go a long way in making it easier to compile MacOS software on FreeBSD/GNUstep.
And in any event, so far as doing it legally, I don't see why this would be any less legal than Wine's recreation of the Win32 API/libraries. Only difference is Apple might be more litigious than Microsoft, but Microsoft doesn't exactly lie down to software theft...
I was following and trying to use GNUstep 15 years ago, and they were constantly chasing a moving target and were not managing to catch up. (Plus naturally the reimplementation bugs, plus the differences in interpretation of the "spec" which forced the programmer to be very careful and not take shortcuts.)
That's the huge issue when you are trying to reproduce an API which is not under your control by any mean, and is still alive and changing.
It had to be, it was forked from KHtml, which was GPL.
Those frameworks are also a tiny part of the full set that you need to build non-trivial software on macOS.
Audio? Video? so much more stuff that nobody has ever tried to reimplement the APIs for.
Yes, such a reimplementation would be legal,but Wine has been a project for 20+ years and has a huge headstart compared to any idea of doing this for macOS.
But yet, I misunderstood the GP comment, and what I said was not really appropriate in that context.
Why? Things like Wine and Proton exist and Windows is proprietary.
There is absolutely no equivalent for macOS frameworks. GNUStep is a tiny part of the picture, and in addition has not kept up with the fairly radical changes that Apple has introduced to the frameworks that GNUStep does correspond to.
That may have been incorrect.
This is no more menace to them than ReactOS for Microsoft.
OTOH Wine, properly improved and adjusted, sort of made a dent in the market in the form of Steam game consoles.
It's a tall order, but sometimes projects like this take off.
The main design goals are:
* source compatibility with macOS applications (i.e. you could compile a Mac application on Airyx and run it)
* similar GUI metaphors and familiar UX (file manager, application launcher, top menu bar that reflects the open application, etc)
* compatible with macOS filesystems (HFS+ and APFS) and folder layouts (/Library, /System, /Users, /Volumes, etc)
* self-contained applications in folders or a single file and a (mostly) installer-less experience for /Applications
* mostly maintain compatibility with the FreeBSD base system and X11 - a standard Unix environment under the hood
* compatible with Linux binaries via FreeBSD's Linux support
* eventual compatibility with x86-64 macOS binaries (Mach-O) and libraries
* pleasant to use, secure, stable, and performant
[0] https://github.com/mszoek/airyx