krestenkrab edited this page Sep 13, 2010 · 16 revisions
Clone this wiki locally

This is a clone of Kilim, which has some changes for supporting Erjang — a JVM-based Erlang VM.

Thanks to Sriram Srinivasan for making Kilim in the first place!
See Authoritative Kilim Site for lots of good material.

The original Kilim is now also hosted on GitHub here; eventually we want to make our kilim a proper clone of that version; but there is some work in doing that.

The additions/changes are roughly:
  • New methods on kilim.Mailbox: peek(), untilHasMessage() and untilHasMessage(long). Needed to implement ditto for Erjang.
  • New method on kilim.Task, task.kill(java.lang.Error ex) which makes ex be eventually thrown inside the target Task [before it can send a message at least]. Task.checkKill() can be called periodically to check for this.
  • A Performance Enhancement. Special case for kilim.State when only saving this and the pc. kilim.Fiber has three stacks now, one for State (sans pc and self), and separate stacks for this (a.k.a. self), and pc. For my Erjang performance tests, this speeds up the “ring problem” by almost a factor of two because it avoids a lot of allocations.
  • Generalized mechanism for finding class files [not complete]. “Kilim classic” reads class files at runtime using Class.forName. With ClassMirrors in this edition, classes can be also be loaded directly from .class files. This feature is incomplete, but intention is that the weaver tool should accept a -classpath argument so it can be run e.g. inside Eclipse. [I also have an eclipse builder in the making…]
  • Minor changes as I was browsing through the code to remove some warnings from Eclipse.

Wishes for the future

  • kilim.Pausable subclass / exception marker “kilim.TaskUser” that makes the weaver pass in the fiber, but does not generate save/restore code. This is ideal for calling Erjang-runtime functions that needs access to the current process.