Common LISP on iPhone/iOS

2019-04-05 01:18发布

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

If so, is it possible create it in a dynamic library?

5条回答
Luminary・发光体
2楼-- · 2019-04-05 01:41

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.

查看更多
淡お忘
3楼-- · 2019-04-05 01:41

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.

查看更多
Evening l夕情丶
4楼-- · 2019-04-05 01:50

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.

查看更多
Anthone
5楼-- · 2019-04-05 01:51

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.

查看更多
甜甜的少女心
6楼-- · 2019-04-05 01:57

There also exists Mobile Common Lisp1

查看更多
登录 后发表回答