以前根据 CCL 的教程学会了如何在 Common Lisp 中调用 Cocoa 框架,编写 MAC 应用程序。git
最近在考虑如何经过 Common Lisp 调用 Cocoa Touch 框架,开发 iOS 程序(iPhone/iPad),首先须要解决的问题就是如何在 Common Lisp 中启动 iOS 模拟器,而且创建起通讯,进行交互(把写好的 APP 上传到模拟器中)。
github
虽然对于 iOS 高手来讲没什么技术含量,不过确实是一个必须解决的问题(商业化的 Mocl 已经实现),准备慢慢搞定,这样,之后就能够直接使用 Common Lisp 来开发 iOS 应用了。shell
话说如今苹果最新发布的 swift 也支持 REPL 了,说明 Lisp 这座金矿还有太多值得挖掘的宝藏,为何不直接用 Lisp 来开发 app 呢?express
搜索了一下,找到下面这篇文档,准备先学习参考一下swift
原文以下:app
The ECL for iOS distribution includes a code example of a Common Lisp application running on the iPhone.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).ide 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.post 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 |