archives

Kai

Came across this in the announcement of the new LLVM release. It looks interesting, I haven't had time to check it out.
Kai (Japanese 会 for meeting/gathering) is an experimental interpreter that provides a highly extensible runtime environment and explicit control over the compilation process. Programs are defined using nested symbolic expressions, which are all parsed into first-class values with minimal intrinsic semantics. Kai can generate optimised code at run-time (using Low Level Virtual Machine) in order to exploit the nature of the underlying hardware and to integrate with external software libraries. It is a unique exploration into world of dynamic code compilation, and the interaction between high level and low level semantics. It is born out of my desire to learn more about programming languages.

Is cloning independent of message-passing

I was thinking about constructors in class based languages and how the idea might relate to prototype-based languages, when it occurred to me that if you try to create a prototype-language with message-passing, you'll have to define the basic "clone" operation outside of the message passing framework. Here's a brief description of the thoughts that brought me to this conclusion.

I was considering how I might want to have some code execute whenever a object is cloned -- like a constructor in a class-based language. I could send an "init" message to each object right after it is cloned. But this doesn't describe the process of actually the cloning the object in the first place. So let me define a "clone" method which returns the new object. Let's say the clone method operates by creating a blank object and then adding the parent object's own members to it. But that raises the question: where do we get an empty object? It seems to me that the language runtime has to provide this empty object and that the semantics related to it have to be separate from the semantics for messaging. In other words: you cannot describe object creation purely in terms of sending messages to existing objects.

I wanted to get this idea down in some form while it was still fresh, so it's possible that I'm missing something. I'm not familiar with the formal semantics for non-class-based languages, so if there are papers that contradict (or support) what I just said, please point me towards them.

Thanks.