Main image of article Swift Playgrounds NES Emulator Stress-Tests Undefined Boundaries

Creating a side-scrolling iOS game isn’t uniquely difficult. However, many game studios and companies haven't ported their older, still-popular titles to mobile devices. Believe it or not, Swift Playgrounds, Apple's iPad-based app for teaching people how to program in Swiftmight be the perfect forum for those two worlds to collide. Delta Lite is an emulator for Swift Playgrounds that is meant to run old Nintendo titles. So far, it only has the original NES title "Super Mario Bros.," with an on-screen remote control. You might assume that Delta Lite uses games written in Swift, because that’s what Swift Playgrounds is about. Not so. Via a blog post, its developer explains that Delta Lite works by essentially loading an external file as a proxy in the Swift Playgrounds view:

"Swift Playgrounds only supports programs written in Swift. Unfortunately, the vast majority of emulators are written in C++, which means they cannot be used as-is. To work around this, I came up with a somewhat convoluted solution. I took the Nestopia emulator codebase, and then using Emscripten I compiled the codebase to JavaScript. I included this JavaScript file in Delta Lite, and then I use a hidden web view to run this JavaScript in the background, piping data to and from the web view as needed."

In 2017, Swift Playgrounds expanded its educational reach to drones and Internet of Things (IoT) devices; you can control your external gadgets via the app. And that wasn't the end of Swift Playgrounds' evolution: earlier this year, alongside iOS 11.3, the app opened up its subscription model for developers. The idea is that developers will use Swift Playgrounds to teach others how to code with hands-on examples and lesson plans. Think Udemy, just all done on the iPad. At the time, monetization for subscriptions wasn’t explicitly delineated. A WWDC 2018 session on Swift Playgrounds subscriptions didn’t clarify matters; Apple only says subscription content must be handled via an external website and hosted online. To that, we can assume such a website must also deal with subscription payments, which won’t feed through the App Store. Apple’s sly suggestion that subscription content be hosted on GitHub underscores that it likely wants Swift Playgrounds content to be free. Developer documentation doesn’t define a monetization strategy, either. But if the NES emulator (which is currently free) is any indication, developers are poking around the idea of making money via Swift Playgrounds. They may also be poking the bear; for example, Nintendo doesn’t take kindly to people sniping their games or intellectual property (and it enjoys a very cozy relationship with Apple). The core concept is sound: Playgrounds is a solid forum, and accepts (encourages, really) external content. That it might become more than a learning platform is intriguing, especially if there’s synergy around learning SpriteKit and in-game physics while creating a "Super Mario Bros." emulator (hintity-hint-hint, devs).