[Openmcl-devel] M1 port: Call for funding

R. Matthew Emerson rme at acm.org
Sun Dec 31 18:03:32 PST 2023



> On Dec 31, 2023, at 1:09 PM, John DeSoi <john at desoi.dev> wrote:
> 
> I would be more interested in donating money and/or time if Swift integration was a possibility. I agree that the Objective-C runtime is not going away soon, but I think there are already APIs that are Swift only. And finding Objective-C examples and documentation will become increasingly difficult. 
> 
> Here is a take from a Zig developer:
> 
> 
> https://mitchellh.com/writing/zig-and-swiftui#appendix-why-not-objective-c

Note that Mitchell H. is writing here of combining a bunch of functionality implemented (as a C-callable library) in a cross-platform programming language (Zig in his case) with a user interface implemented in the common platform language (Swift & Swift UI in this case).

He points out, rightfully, that nowadays, the most convenient way to access macOS UI features is often via Swift or even SwiftUI.

I think this can be a great technique.

On the other hand, this is an inversion of the way that CCL has traditionally viewed the world, namely, that Lisp is the thing in control, and everything else is “foreign”. If CCL was changed to be a shared library that could be loaded into a regular app (which would be a very big change), then I could imaging writing UI code in Swift and SwiftUI, and implementing other logic in Lisp.

One thing that interests me personally is having a Mac-based IDE that provides an environment at about the same level of sophistication as MCL, which in my opinion hit a sweet spot. That implies having a Lisp-aware and Lisp-programmable editor, easy creation of windows and view from lisp, and so forth. This functionality might not expose everything that the platform UI libraries provide. It’s a big job to make a nice Lisp interface to these APIs, and there are just an awful lot of them.

I don’t know what would be involved in creating, say, a SwiftUI view from Lisp and being able to pass that to some Swift function. We can make Lisp functions that can be called by C; maybe we could someday extend that to Swift if that is needed (Swift can easily call C functions already).

Maybe in the future it becomes impractical or impossible to implement a UI in anything other than Swift. I wouldn’t like this, but I don’t get phone calls from Apple asking me what I would like. :-)

In such a case, maybe we have a sort of UI server process implemented in Swift & SwiftUI that communicates with a separate Lisp process via some IPC mechanism (this is the Emacs and Slime approach). Some people think that a web browser could be used in this way.

I like the idea of an in-process development environment, myself. It feels more alive to me, and as I have said before, I’m all about interacting with the computer as if I’m taking to some spirit or genie that resides in the machine. I’d rather talk in person (live, in-process environment) than over the telephone (the connection between Emacs and Slime) or by passing around virtual decks of punched cards (usual edit-compile-debug batch languages like C or Rust).

But this is all getting ahead of myself. I’d first like to get CCL running on ARM64, but I’m really interested in integration with Macintosh platform features too.

My impression is that many CL users and developers are generally happy to use Emacs and Slime, and are not very interested in a Macintosh IDE. (At least that’s my impression of the open source CL users.). Maybe that’s because such people have become very skilled with Emacs and Slime. I think also that there are some people who don’t care for the Macintosh. That’s OK: it’s a big world.

I do believe that it would be good to expose more people to CL, and asking people to learn Emacs and Slime along with CL is a very big request, in my opinion. If a user can easily download and install a double-clickable Mac app and start hacking Lisp, that really reduces the effort required to explore Lisp, and that can only be good.



> 
> John DeSoi, Ph.D.
> 
> 
> 
>> On Dec 31, 2023, at 8:29 AM, Gary Palter <gmpalter4clozure at fastmail.com> wrote:
>> 
>>>> 7.  What is your reading of the tea leaves with regards to the future of ObjC on the Mac platform?  Is it even worth bothering trying to port the ObjC bridge, or should we be thinking about a Swift bridge instead?
>>> 
>>> It seems to me that the Objective-C runtime is going to be around for some time yet. Maybe at some point it will go away, and I can only hope that Apple will provide some other way for non-Apple languages to access UI libraries. Swift doesn’t have a stable ABI as far as I know, so it’s not possible yet to talk about calling Swift directly from CCL (without going through C somehow).
>> 
>> Just for the record, the Swift ABI is stable on macOS starting with Swift 5.
>> 
>> ABI stability on other platforms is still under development.
> 
> 



More information about the Openmcl-devel mailing list