LLMs For Software Portability

Jun 8, 2023

Gaming has historically been a second-class experience on macOS. Most games target DirectX 12 APIs and run best on Windows, and as a result, most gamers bought PCs. With Apple’s Game Porting Toolkit that supports DirectX 12, more games will be playable on powerful M1 and M2-based laptops. The moat is eroding with software portability.

It’s not just gaming — Apple had strategically used portability before with Rosetta, which made the transition from x86_64 on Intel to arm64 on Apple Silicon seamless. Microsoft supports Linux binaries through an embedded Linux kernel in WSL 2.

AI doesn’t power any of these portability layers directly. But the task is something that AI-powered coding assistants excel at — given multiple specifications (e.g., Apple’s Metal, Vulkan, and DirectX 12), build a compatibility layer between them. This process is long and complex and potentially requires a lot of continued maintenance (the APIs might even intentionally diverge). But in the end, it is testable and specification-driven. There might need to be creative solutions, but the problem space is constrained.

Some other compatibility layers that might be interesting to build with the assistance of AI:

  • Cloud Service Interoperability. Multi-cloud might be a reality if we could translate code and infrastructure between platforms more easily. An LLM-assisted transpiler that rewrites an AWS Lambda Function to a Google Cloud Run Function. Or translating basic infrastructure-as-code templates to deployments on each cloud.
  • Programming Language Interpreters. WebAssembly already provides an interesting cross-language compilation target, but what if code could be translated at the language level? LLMs can already rewrite a simple JavaScript function to a Python function, but I imagine we could do this more iteratively for larger chunks of code.
  • Operating System Translators. We already have WINE for Windows applications on Linux and WSL for Linux applications on Windows. What if we could build and maintain more translation layers like this?
  • A Unified SQL. There are tens of SQL dialects that all differ in tricky ways. What if queries could work across databases and utilize database-specific features and speed-ups?
Daily posts on startups, engineering, and AI