Wednesday, December 29, 2010

Aneris, Ceres update & more (for the end of the year)

Aneris

Aneris is a simple AST walking interpreter, that supports delimited continuations, W7, POSIX & most everything that Vesta does. I created it as a useful test of E-prime's & Enyo's ability to meaningfully compile preDigamma programs. The nice thing about Aneris is that it doesn't use any code that is specific to preDigamma, and, as such, it can run itself. I'm pretty happy with the way it came out.

Ceres

Ceres has been updated to support the full W7 system, as well as continuations (it had delimited continuations before). I hope that I'll be able to release Ceres, Vesta, E-prime, & Aneris early-2011.


Grid Computing

I've been using the SHARK (Scheme Hacks Against Raging Kingdoms *or* Scheme High Availability Research Kit) Grid for some time now; I hope to allow users to log in shortly after I release Digamma. I hope to add serializable environments to Vesta/Aneris/Ceres before then, so that grid nodes can fail & still hold the vast majority of a user's state (esp. since snap shotting the VM on a regular basis & storing to SHARK's data nodes shouldn't be that big of an issue). 


2011 & Beyond

Once I've released the Digamma environment, I'll move towards an IPN-style format here: the blog will start hosting my experiments & labs that focus on using Digamma in the "real world," as well as the usual developments wrt compilers, interpreters, operating systems & language design. 

Happy 2011!

Friday, October 29, 2010

Update, E' & contains

I've been working heavily on Digamma, to the point where I've not blogged about it in a year, so here's a quick update.

Vesta is working well; so well that I don't have any other scheme interpreters installed on any of my machines anymore. That's a good sign, since I use Scheme & C for just about everything. Vesta itself is just about as fast as you can possible get with an AST walking interpreter; a simple fib program, that computes & prints the Fibbonacci values for 3,4,5,10,15,20 runs in about 0.245u, where as C runs at 0.00u and natively compiled PreDigamma runs at 0.01u. I don't have timings for Ceres yet, as I'm still working on that.


E'

Enyo, the PreDigamma compiler, is a rather large piece of software; it has a type inference engine, nice code generation back-end (so that PreDigamma can target other systems, such as Inferno's Limbo or even Plan9's ken cc). This isn't fun though, so I thought about having some fun. Enter E': a tiny compiler for PreDigamma to C. It's 400 or so lines, a tail call optimizer & support for PreDigamma save for macros, syntax,c-macros, c-syntax, FFI & types. That's quite a few features missing, but it works well; I've been using it for quite a few little utilities here & there, and it compiles nicely. For instance, it turns this:


(def fib (fn (t i j n)

 (if (<= n 1)

  i

 (fib i (+ i j) t (- n 1)))))


into this:


SExp *
fib(SExp *t, SExp *i, SExp *j,SExp *n)
{
   SExp *ret = nil;
   int s1 = 0;
   while(!s1)
   {
      SExp *it0 = flte(list(2,n,makeinteger(1)));
      if(it0 == nil || it0->type == NIL || ((it0->type == BOOL || it0->type == GOAL) && it0->object.c))
      {
         s1 = 1;
         ret = i;
      }
      else
      {
          t = i;
          i = fplus(list(2,i,j));
          j = t;
         n = fsubt(list(2,n,makeinteger(1)));
      }
    }
    return ret;
}

Which is pretty nice, and quite speedy.


Contains

There's a new primitive in Digamma, called contains. This is analogous to Python's in, and it works on all collexions:

contains c : COLLEXION v : ATOMIC [key-or-value : BOOL] => BOOL

 the key-or-value part is for if you're testing a dict: you may want to test whether it has the key v or the value v, so there's a boolean flag for that. Nice, semantically simple & clean; Total positive in my book.