Factor/Java Factor

Java Factor or JFactor refers to the implementation of Factor in Java, which is now all but obsolete.

The old Factor downloads directory has some JFactor releases; the last Factor release to include JFactor was version 0.68.

JFactor was abandoned for several reasons:

  • The JVM does not support efficient Tail calls or Continuations. JFactor would simulate its own call stack, leading to a performance hit.
  • The JVM does not support efficient Multiple dispatch, so performance of generic arithmetic suffered.
  • Because there's no way to dump an image with the JVM, much of the implementation had to be written in Java -- the parser, compiler, and so on. The amount of Factor code parsed on startup had to be minimized to avoid long delays, and this complicated the implementation and made this less elegant.
  • Most Java implementations cannot deploy stand-alone native executables with minimal size overhead.
  • There are many other issues, most arising from the fact that the JVM was designed with Java in mind and not Dynamic languages.

The native Factor implementation was at first known as "CFactor". Early CFactor releases were only interpreted, not compiled as JFactor was, but even then they beat JFactor because the CFactor VM was specifically designed with Factor in mind. Later Factor releases added a native compiler, leaving JFactor in the dust. See Implementation history.

If the Factor community grows by an order of magnitude, there will be enough manpower around that some enterprising developers (no pun intended) can revive JFactor and maintain it in parallel with the primary Factor implementation. Also many of the above JVM-level concerns are being worked by the OpenJDK project; for example, the recent work on invokedynamic and tail calls would be relevant to a modern re-implementation of Factor in Java.

For the time being however, Factor will remain a native language.

This revision created on Fri, 30 Jan 2009 19:37:38 by slava