Mecca available on macOS
Jacob Carlborg
doob at me.com
Wed Aug 7 11:01:55 UTC 2019
I would like to announce that I've ported Mecca [1] to macOS. It was
merged in May but I never bothered to announce it until now. Everything
except the file watcher has been ported and is working. Unfortunately
the unit tests fail in Travis CI, but they pass locally and in Circle
CI. Something related to a timer that is failing.
When it comes to the implementation, it's structured so that the new
code will work on any Darwin platform (it's only tested on macOS). In
this process I also moved some platform specific code for Linux to the
`mecca.platform` and `mecca.reactor.platform` packages. This means that
all platform specific code lives in these two packages and there are no
version blocks outside of these packages (as far as I could find). The
version blocks that exist are very few, due the the platform specific
code lives in their own files. They're just needed to import the correct
platform specific file. I think this turned out really nice compared to
the mess that's in druntime, where most files are littered with version
blocks.
The Darwin implementation uses kqueue, which is available on other
platforms as well, like the various BSD flavors. The kqueue specific
code is guarded with its own version block to make it possible to reuse
on other platforms, if someone wants to port Mecca to a new platform.
Some timer related code is implemented using libdispatch on Darwin, but
I think this could be implemented using kqueue as well. I think
libdispatch is available on *BSD as well, but might not be installed by
default.
[1] https://github.com/weka-io/mecca
--
/Jacob Carlborg
More information about the Digitalmars-d-announce
mailing list