Moksa: News


Old News (Olds!?)

New news comes out on the main web page

December 8th, 1999: Evaluation of Mercury

The latest update updates the IO primitives a bit, cleaning them up. It's not done, by a long shot, but something's come up.

After writing a bunch of Prolog code, I discovered a programming language called Mercury. Mercury is a generalization of Prolog with two significant advantages (for me). First, it is rigorously typed, allowing serious compile-time optimizations. Second, it is entirely logical (without any of Prolog's imperative functionality).

Mercury intrigues me. I am evaluating it now, reading their online papers, and playing with their compiler to write programs, and it's an exciting language. I truly disliked Prolog's dynamic type system: I am an earnest believer in static typing -- in Java, once your program compiles, it often just runs. Apart from anything else, Mercury is a much faster language than Prolog, and this interests me as well.

What does this mean for Moksa? Well, that's yet to be seen. I may port Mercury to a Java framework, or I may give up on it after my evaluation and go back to pure Prolog. We shall see.

December 2nd, 1999: Freedom from JavaClass -- enter the Rhino

Well, it's done. I've officially removed any need for users to download and install extra software when they run Moksa: everything's in one small-ish (0.5M) JAR file.

The answer? I used to depend on JavaClass, a package for reading and manipulating Java class files. JavaClass is a good package, but it was overkill for my needs (for example, I don't need to parse or edit existing class files), and so was larger and heavier-weight than I might have liked. It also allowed more flexibility by representing each instruction as an object, which I couldn't really afford.

Anyway, after a couple grueling days, I've switched over to use the bytecode engine out of Rhino. I don't use the stock version (it has dependencies on Rhino, proper, and I had a few mutes I had to make to it so it could generate everything I needed, plus I don't want to conflict with existing installs of Rhino), but it provided nearly all the functionality I needed, at a very low cost. See the package com.svincent.smalljava.rhino for more information.

With the shackles of 3rd party libraries gone, I finally made my Makefile generate a JAR file for distribution: moksa.jar is now available for putting in your CLASSPATH or invoking with the -jar option of the java utility.

Anyway. Next steps? More cleanup. Ultimately, I want to improve performance by changing the compiler to not create so many objects in the invocation of a Rule. Once I feel sufficiently ambitious, I'll do that. In the meantime, I want to clean the whole beast up.

November 30th, 1999: Cleanup + Refactoring!

General cleanup. Moksa had gotten gross with silt and some poor design decisions early on. Some of that has been removed. In particular, the class com.svincent.moksa.Wam used to be the center of the universe, doing all sorts of unrelated things. Now its functinality has been seperated out into three classes:

  1. Wam - exactly an implementation of a WAM: no more, no less
  2. PrologEngine - the top-level class with the public interface + subsystems such as the package manager and I/O.
  3. PrologFactory - a factory for creating various objects used by Moksa (particularly PrologTerms and Continuations.

Much nicer. Plus another round of documenting some of the code, and a release. Next step? Probably to remove my dependency on the JavaClass API. I want to be self-sufficient. I'm going to look at the Rhino bytecode generation API. It has an API inside of it that seems small and pleasant: the main deal is only 1500 lines of code. Shouldn't be a problem to use it, either: it's under the fairly liberal MPL.

November 25th, 1999: ANTLR is gone!

I just removed the dependency on ANTLR that I had. No more ANTLR grammars for me: I've now got two. The next step is to hook up the Prolog-based parser, and to add an option to Prologc that can switch between them. Plus lots of improvements.

November 24th, 1999: New Parser and Package Manager

Things are coming along nicely. I finished a pure-Prolog parser to replace the ANTLR-based parser I have currently. It's not hooked up, yet, but it will be.

Also, lots of commenting, general improvements, and headway towards removing gross things that have crept in. I figured it was time for a release to give myself a bit of a break from heads-down programming. I've also re-engineered the web site a bit, wrote a touch more documentation (or at least rearranged that which was already there, and brought back some from older and better days), and just generally improved things.

Anyway, tonight is my night to watch TV (Hercules and Xena: the only shows I ever watch, and tonight's Hercules is the final episode of the series! Gasp!), so I'll get as much done as possible, and probably dothe actual release tomorrow.

November 17th, 1999: Repackaged things

It came to my attention that the distribution of MoksaProlog that was put up yesterday didn't work. Go figure. Anyway, it's all repackaged, life is good, and I'm reworking how the web site works. You can really download Moksa now.

And in lieu of documentation, here's a quick tutorial in using MoksaProlog.

Simplified Usage:

     java -jar moksaProlog.jar [-src prolog-file] [-rule rule-def] [-goal goal]
  

The other option you might be interested in is -help. It prints a help message and exits the compiler. That's where all the options are documented.

So, for example, using the test.pl source file distributed with MoksaProlog, you could type:

      java -jar moksaProlog.jar -src test.pl -goal "append ([a, b], [c], L)."
  

And get

      MoksaProlog 0.1 Ready.
      That''s all folks!
      Did append, got [a, b, c, d, e, f]
      'append ([a, b], [c], L).' succeeded with bindings:
           L = [a, b, c]
  

Pretty super. Go nuts. I apologize for the lack of an interactive environment. That'll be one of the next things I do.

November 16th, 1999: MoksaProlog does Compilation

Step 2 is done. I got up really early this morning, and added dynamic compilation to bytecodes to MoksaProlog. Plus, I added command line options, and everything.

Soon I'll package it up nicely so that it's easier to compile (it currently depends on 2 packages, ANTLR and JavaClass, which aren't distributed with it -- this will change)

What's left? Well, cleanup, solidification, and general improvements. Complete ISO Prolog support. Add extensions.

And finally, extend to support true Moksa stuff: constraint logic programming.

Soon, soon, soon....

November 15th, 1999: First release of MoksaProlog

It's buggy, it's shaky, it's really alpha (0.1), but it works, and implements nearly all of core Prolog (minus many of the builtin terms). I stick it here for public amusement, not widespread use. It is, of course, being distributed under the Gnu Public License.

What's MoksaProlog, you ask? Well, I'm glad you did. MoksaProlog is the first (very early) release of a new 100% Java Prolog environment. It runs with JDK1.2, and will ultimately support all of ISO Prolog. Bug reports would be appreciated.

It will eventually have many useful extensions. Even this early alpha release has some primitive facilities for interacting with Java objects from Prolog. Internet I/O will be implemented, including such wonderful things like XML processing, sending/receiving mail, etc. Some interesting mechanism for dynamically loading modules off of the Internet will be supported, also.

MoksaProlog is just the beginning, however. I'm only writing this Prolog environment as a basis for Moksa, which is my constraing logic programming language for generating random content for roleplaying games. Overkill, I admit, but I don't like half-hearted solutions.

What's next on my plate? Well, first thing is to integrate Smalljava into the main interpreter, so that terms can be dynamically (and statically) compiled into Java source and/or bytecodes. After that, probably rewrite the parser in Prolog (the current parser is the ugliest thing I've ever seen), build an interactive environment, then go nuts writing all the ISO Prolog builtin terms.

After I have a reasonably complete and efficient Prolog environment, I'll add the final constaint programming features that will turn it into Moksa. Then, it shall be complete. And Moksa shall walk the earth, and God will see that it is good.

"Blurring the line between subjective and objective reality," indeed.

Older News: First release of Smalljava

Smalljava is a Java API for generating bytecodes in a natural, convenient way.

Once Smalljava is stable, work will begin on MoksaProlog, a 100% Java Prolog environment, which will become the basis of Moksa.


Moksa can be found at http://www.svincent.com/moksa/

Comments, Criticisms, Complaints, Crazy Cookies to: svincent@svincent.com

To Shawn's web page!