| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|---|
| 2 | <html>
|
|---|
| 3 | <head>
|
|---|
| 4 | <title>The (preliminary) Cocoa-based development environment for OpenMCL</title>
|
|---|
| 5 | </head>
|
|---|
| 6 |
|
|---|
| 7 | <body>
|
|---|
| 8 | <h1>The (still preliminary) Cocoa-based development environment for OpenMCL</h1>
|
|---|
| 9 | <h2>General information</h2>
|
|---|
| 10 | <p>
|
|---|
| 11 | The OpenMCL Cocoa demo's been around for over a year; a variety
|
|---|
| 12 | of things have kept it from moving forward:
|
|---|
| 13 | </p>
|
|---|
| 14 | <ol>
|
|---|
| 15 | <li>
|
|---|
| 16 | <p>
|
|---|
| 17 | It was difficult (in some cases, impossible) to get Cocoa's
|
|---|
| 18 | runtime system and OpenMCL's cooperative threads to interact
|
|---|
| 19 | reasonably.
|
|---|
| 20 | </p>
|
|---|
| 21 | </li>
|
|---|
| 22 | <li>
|
|---|
| 23 | <p>
|
|---|
| 24 | The demo code was written using a set of reader macros and
|
|---|
| 25 | other constructs that made it possible to sort of embed
|
|---|
| 26 | Objective-C like code in lisp. (It was actually a bit worse
|
|---|
| 27 | than writing Objective-C code, since there was absolutely
|
|---|
| 28 | nothing in the way of compile-time type- or sanity-checking
|
|---|
| 29 | going on; the code was all effectively written at the lowest
|
|---|
| 30 | level of OpenMCL's ffi.
|
|---|
| 31 | </p>
|
|---|
| 32 | <p>
|
|---|
| 33 | The code's (almost ...) all rewritten using a Lisp-to-ObjC
|
|---|
| 34 | bridge package developed and contributed by Randall Beer.
|
|---|
| 35 | The bridge offers a lot of features that make Cocoa programming
|
|---|
| 36 | in OpenMCL saner, safer, and Lispier than it had been; it's
|
|---|
| 37 | a good thing, and seems to be an important step towards
|
|---|
| 38 | closer integration of CLOS and ObjC.
|
|---|
| 39 | </p>
|
|---|
| 40 | </li>
|
|---|
| 41 | <li>
|
|---|
| 42 | <p>
|
|---|
| 43 | There was a proof-of-concept example that showed how it was
|
|---|
| 44 | possible to save the demo IDE as a double-clickable bundled
|
|---|
| 45 | application. A lot of the steps involved in that process
|
|---|
| 46 | had to be performed manually, and the result wasn't too
|
|---|
| 47 | usable ...
|
|---|
| 48 | </p>
|
|---|
| 49 | </li>
|
|---|
| 50 | </ol>
|
|---|
| 51 | <p>
|
|---|
| 52 | These issues have been addressed to a large degree; the demo
|
|---|
| 53 | IDE's still barely usable (neither the editor nor the listener
|
|---|
| 54 | windows are particularly lisp-aware, a lot of development and
|
|---|
| 55 | debugging tools are missing, etc.) but I think that the foundation
|
|---|
| 56 | for building this stuff is significantly stronger than it was.
|
|---|
| 57 | </p>
|
|---|
| 58 | <p>
|
|---|
| 59 | All of this is (obviously) MacOSX-specific. The <a
|
|---|
| 60 | href=http://www.gnustep.org>GNUstep Project</a> is trying to
|
|---|
| 61 | provide a cross-platform, opensourced version of OPENSTEP (and
|
|---|
| 62 | therefore a potentially high degree of compatibility with Cocoa.)
|
|---|
| 63 | It might therefore be possible to port some of this to GNUstep
|
|---|
| 64 | and Linux; I don't know how much would be involved in that.
|
|---|
| 65 | </p>
|
|---|
| 66 |
|
|---|
| 67 | <h2>Random technical issues & to-do list</h2>
|
|---|
| 68 |
|
|---|
| 69 | <h3>Lisp-awareness</h3>
|
|---|
| 70 | <p>
|
|---|
| 71 | The demo IDE's listener and editor windows are slightly
|
|---|
| 72 | customized versions of Cocoa's NSTextView class; the underlying
|
|---|
| 73 | editor buffers are accessed as "attributed strings". There's no
|
|---|
| 74 | support for lisp-syntax-aware navigation in NSTextView buffers,
|
|---|
| 75 | and adding that support at the "attributed string" level would
|
|---|
| 76 | seem to be a tedious, error-prone process.
|
|---|
| 77 | </p>
|
|---|
| 78 | <p>
|
|---|
| 79 | I think that it'll be possible to effectively replace the
|
|---|
| 80 | Cocoa text system's buffering mechanism with Lisp data structures
|
|---|
| 81 | (e.g., PHemlock buffers), and continue to use the Cocoa text
|
|---|
| 82 | system for display, scrolling, selection, and raw event handling.
|
|---|
| 83 | </p>
|
|---|
| 84 |
|
|---|
| 85 | <h3>Modularity</h3>
|
|---|
| 86 | <p>
|
|---|
| 87 | There's code in the demo IDE that's very specific to the IDE
|
|---|
| 88 | application itself; some other code probably needs to be
|
|---|
| 89 | in any (hypothetical) OpenMCL-based Cocoa application. This
|
|---|
| 90 | obviously needs to be refactored a bit.
|
|---|
| 91 | </p>
|
|---|
| 92 | <p>
|
|---|
| 93 | The bundle directory used by the demo IDE ("ccl:OpenMCL.app")
|
|---|
| 94 | is something that I originally created in ProjectBuilder a
|
|---|
| 95 | long time ago. It'd be nice (and probably not too hard)
|
|---|
| 96 | if there was a simple way to create skeletal bundle hierarchys
|
|---|
| 97 | that could be populated and customized to create other types
|
|---|
| 98 | of applications, and if the lisp (in various ways) helped
|
|---|
| 99 | to support this process.) There are obviously lots of things
|
|---|
| 100 | that could be done here ...
|
|---|
| 101 | </p>
|
|---|
| 102 |
|
|---|
| 103 | <hr>
|
|---|
| 104 | <!-- Created: Sun Jun 2 22:37:21 MDT 2002 -->
|
|---|
| 105 | <!-- hhmts start -->
|
|---|
| 106 | Last modified: Mon Sep 1 19:54:26 MDT 2003
|
|---|
| 107 | <!-- hhmts end -->
|
|---|
| 108 | </body>
|
|---|
| 109 | </html>
|
|---|