之前根据 CCL 的教程学会了如何在 Common Lisp 中调用 Cocoa 框架,编写 MAC 应用程序。
最近在考虑如何通过 Common Lisp 调用 Cocoa Touch 框架,开发 iOS 程序(iPhone/iPad),首先需要解决的问题就是如何在 Common Lisp 中启动 iOS 模拟器,并且建立起通信,进行交互(把写好的 APP 上传到模拟器中)。
虽然对于 iOS 高手来说没什么技术含量,不过确实是一个必须解决的问题(商业化的 Mocl 已经实现),准备慢慢搞定,这样,以后就可以直接使用 Common Lisp 来开发 iOS 应用了。
话说现在苹果最新发布的 swift 也支持 REPL 了,说明 Lisp 这座金矿还有太多值得挖掘的宝藏,为什么不直接用 Lisp 来开发 app 呢?
搜索了一下,找到下面这篇文档,准备先学习参考一下
原文如下:
The ECL for iOS distribution includes a code example of a Common Lisp application running on the iPhone. The example is a Swank server, the backend for the SLIME and MCLIDE Lisp development environments (disclosure: I am the developer of the latter). Following the steps in the readme will build the application and place it on your iPhone/iPad, or alternatively on the iPhone simulator that comes with Xcode. You can then connect to the iOS device using SLIME or MCLIDE, providing a REPL from which you can evaluate Lisp expressions directly on the device and interactively develop the app. The code example in the init.lisp file runs on the device as the application starts. It currently loads the swank server and notifies the user with a text field, button and alert dialog. The ECL for iPhone project doesn't yet provide much user interface functionality from Lisp, but you can use the Xcode Interface Builder to design the GUI. ECL compiles to C and supports inline Objective-C, so you can use Common Lisp as an abstraction layer on top or integrate Common Lisp implemented functionality with Objective-C code. The repository for the project includes examples of combining Common Lisp with Objective-C, including the implementation of basic widgets.
|
||||
add comment |
来源:oschina
链接:https://my.oschina.net/u/219279/blog/283060