开发者

Common LISP on iPhone/iOS

Is it possible to call a Common Lisp function in iOS?

If so, is it possible create it in a dyn开发者_如何学Pythonamic library?


It depends on what you mean by calling a CL function, but most likely ECL will be your shortest path. Start here, as there is a patch for ECL to better accommodate iOS: http://funcall.posterous.com/tag/iphone

ECL generates C code, so you should be in safe territory with Apple's shifting policies.


Have you tried MOCL?

According to the website "mocl is a highly optimizing CL implementation, delivering tight native code via LLVM/Clang".

Maybe you can create a dynamic library, though it is designed for use the other way around.


Clozure Common Lisp (CCL) runs in Linux on the ARM, and Gary Byers long ago made an experimental iPhone version, but it would only run on a jail-broken iPhone. The problem is that the CCL compiler writes executable code, but iOS out-of-the-box does not allow a writable page to be made executable, so you can't ever RUN that code.

We've had discussions about putting the code that ships with an iOS app be in a read-only code section, and adding a byte-code compiler, so that code created at run-time can be fairly quickly interpreted, but nobody has offered to fund that project, so it hasn't gotten done.

You might think that we could just interpret code created at run-time, but the current CCL "interpreter" compiles non-trivial code before executing it.

MOCL is probably your best option to write code callable from other apps, but that's only a guess, since I haven't used it.


You could use Gambit Scheme or Clozure Common Lisp, both are able to interface with Cocoa, the first because it generates C and the latter because there is a bridge from Clozure to Cocoa. Do a google search about it and you will find a few things.


You might want to keep an eye on this (new) project. It will be publicly available during October 2019: EQL5 iOS EQL5 iOS libs


There also exists Mobile Common Lisp1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜