graalvm-mobile

https://github.com/phronmophobic/mobiletest
raspasov 2021-07-06T01:10:49.249900Z

One use-case that I think can be super useful is calling native APIs from the REPL. I had to build a custom camera component in Swift and I felt like going back to the dark ages, using the debugger, setting break points, etc. If I had a Clojure REPL into Swift/Objective-C (ideally Swift) the experience could potentially be much better.

raspasov 2021-07-06T01:13:26.250200Z

I’m not sure how possible that would be… Since you’d have to compile some Objective-C on the fly and execute it? I believe that is possible (but I have never tried it myself, have only heard/read stories). Not sure about that strategy with Swift.

raspasov 2021-07-06T01:16:10.250400Z

Just found this: https://github.com/johnno1962/InjectionIII

raspasov 2021-07-06T01:16:21.250700Z

Perhaps worth a look.

phronmophobic 2021-07-06T01:24:26.250900Z

I was able to get some basic objective-c interop working using https://developer.apple.com/documentation/objectivec/1456712-objc_msgsend?language=objc (along with a few other https://developer.apple.com/documentation/objectivec/objective-c_runtime?language=objc calls). I think that should enable most objective c interop, but I'm not sure how how easy it is to make a repl for Swift. I'll check out the project the InjectionIII project, but Swift seems overall less friendly for dynamic runtime interaction.

1
raspasov 2021-07-06T01:30:31.251100Z

This project (InjectionIII) actually seems like the real deal… It looks like you can eval Swift/Obj-C on the fly.