# Retrocomputing: What would it take to add PowerPC/Darwin9 support?

**URL:** <https://forums.swift.org/t/retrocomputing-what-would-it-take-to-add-powerpc-darwin9-support/71797>\
**Category:** Compiler\
**Tags:** off-topic\
**Created:** [May 13, 2024, 4:41pm UTC](https://forums.swift.org/t/retrocomputing-what-would-it-take-to-add-powerpc-darwin9-support/71797 "2024-05-13T16:41:21Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![turbolent](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/turbolent/32/6562_2.png) [@turbolent](https://forums.swift.org/u/turbolent)\
**Post date:** [May 21, 2024, 9:54pm UTC](https://forums.swift.org/t/retrocomputing-what-would-it-take-to-add-powerpc-darwin9-support/71797/8 "2024-05-21T21:54:39Z")

</div>

Not a pipe dream, but a reality! 😉

 ![image](https://global.discourse-cdn.com/swift/original/3X/0/3/03118867a1aa7815cecbad9633f1e7ea0c912882.jpeg)

You can already target Darwin/PowerPC today, see [x.com](https://twitter.com/turbolent/status/1485439938946420736) (and many other systems, see [x.com](https://twitter.com/turbolent/status/1621992945745547264)), by cross-compiling to WebAssembly, and then further compiling to native code, via e.g. [w2c2](https://github.com/turbolent/w2c2), or [wasm2c](https://github.com/WebAssembly/wabt/tree/main/wasm2c).

This requires no changes to the Swift compiler or LLVM.

This approach comes with support for [WASI](https://wasi.dev/) (essentially a POSIX-like/subset API), but you can also import and call "host" C functions. I'm currently working on [GitHub - turbolent/W2C2BridgeGenerator: Generate bindings for w2c2 from a bridgesupport file](https://github.com/turbolent/W2C2BridgeGenerator), a tool that automatically generates bindings for C and Objective-C code, so it's possible to use all Mac OS X frameworks, e.g. AppKit (via [GitHub - turbolent/BridgeSupport-Tiger: Modern BridgeSupport (LLVM/Clang-based), adjusted for Mac OS X Tiger (10.4) and Leopard (10.5)](https://github.com/turbolent/BridgeSupport-Tiger)).

Even small Swift binaries are quite large, as they include the whole Standard Library. Those binaries can be translated to C very quickly with w2c2, but the final compilation with gcc takes quite a while, especially on era-appropriate hardware.

The new Swift [Embedded feature](https://forums.swift.org/t/embedded-swift/67057) greatly improves the size and performance of WebAssembly binaries, see [Some feedback from my short experience with SwiftWasm - #5 by Max\_Desiatov](https://forums.swift.org/t/some-feedback-from-my-short-experience-with-swiftwasm/69605/5). However, this feature is still experimental and seems to have some bugs ([Bug in Embedded/ARC/WebAssembly combination?](https://forums.swift.org/t/bug-in-embedded-arc-webassembly-combination/71967)).

---

_[View the full topic](https://forums.swift.org/t/retrocomputing-what-would-it-take-to-add-powerpc-darwin9-support/71797)._
