Hollywood (Lua) to Swift converter?

Discuss any general programming issues here
Post Reply
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Hollywood (Lua) to Swift converter?

Post by SamuraiCrow »

Since Apple doesn't allow virtual machines with an interpreter other than one of theirs to be uploaded to the iOS app store, this limits the options for running Hollywood on iOS machines. The only way around it appears to be something to convert the Hollywood bytecode to Swift or Javascript, with the future possibility of the Web Assembly bytecode replacing the Javascript parser as a means to that end. Does anyone here know how to program Swift well enough to write a Lua or LuaJIT backend to export to it? Such a converter could be exactly what Andreas needs to get his iOS version of Hollywood Player on the app store.
I'm on registered MorphOS using FlowStudio.
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: Hollywood (Lua) to Swift converter?

Post by SamuraiCrow »

Updates:
Since Swift is NOT a bytecode JIT language as I had assumed before, the possibility of running Hollywood Player may not be possible on iOS. Compiling a dedicated iOS executable using the Swift runtime entails an LLVM toolchain usage.

Perhaps the first step would be to get Hollywood to run using LLVM's OrcJIT would be to try to rebase the language on an LLVM-based Lua derivative such as Ravi whose static typing will enhance performance at the very least. No minor update though so this would take us at least until Hollywood 8 or 9. :( (Further notes: Ravi is not quite up to version 1.0, OrcJIT and LLVM aren't available on the Amiga-likes yet and the Swift runtimes would still need doing.) Let's call this one a long shot. :P
I'm on registered MorphOS using FlowStudio.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Hollywood (Lua) to Swift converter?

Post by airsoftsoftwair »

Converting Lua to Swift still won't get you Hollywood's extensive function library and this surely can't be ported to Swift without going to extreme pains. The only way to get Hollywood stuff on the app store is to provide a framework containing the Hollywood runtime and then use minimal glue code in Objective C or Swift to load the applet. This shouldn't be against app store guidelines because even though the app uses a custom VM now, it is hardcoded to the applet so it cannot be used to execute arbitrary code. Many of today's games have their own VM (often based on Lua) and they are still on the app store so I think Apple is ok with that. The only thing which they don't allow is software which can be used to run arbitrary code on the iOS device. As long as the VM is tied to a specific applet, it won't be a problem AFAIU.
Post Reply