ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthieu Riou" <matth...@offthelip.org>
Subject SimPEL early feedback
Date Mon, 08 Sep 2008 20:09:14 GMT
Hey guys,

I thought it was a good time for me to start giving some very early
feedback on the development of the SimPEL compiler and partial runtime
I'm currently working on in the sandbox. I'm at a point where I can
execute a few very basic processes. Here are 3 test case processes
that currently execute and produce a sensible reply:

process HelloWorld {
   receive(myPl, helloOp) { |msgIn|
       msgOut = msgIn + \" World\";
       reply(msgOut);
   }
}

process XmlData {
    receive(dataPl, dataOp) { |msgIn|
        friendInfo = <friend></friend>;
        friendInfo.name = msgIn.person.firstName + " " + msgIn.person.lastName;
        friendInfo.phone = msgIn.person.phone;
        reply(friendInfo);
    }
}

process SimpleIf {
    receive(ifPl, ifOp) { |quantity|
        if (quantity > 20) {
            status = 0;
        } else {
            status = 1;
        }
        reply(status);
    }
}

You can also have a look at the test case itself as it shows the
format of messages going in and out:

http://svn.apache.org/repos/asf/ode/sandbox/simpel/src/test/java/org/apache/ode/simpel/SimPELRuntimeTest.java

A few observations based on these 3 examples:

  * Given those examples compile, it means that the basic compiler
infrastructure is in place. It's fairly simple for now but hopefully
won't be too hard to extend as I keep adding activities. There's an
ANTLR tree walking grammar based on the AST built by the parser
grammar (also ANTLR). The actions of the tree walker use a basic Java
class as a helper that pulls off most of the OModel building. Scoping
is done at the grammar level (which I think is good). The result of a
run is supposed to be a valid OModel.

  * The only supported activities at the moment are receive, reply,
sequence ( { .. } blocks), if and assign. Except maybe assign (because
it ties into the expression runtime), these are the easy ones. So
there's still a lot of fun left :)

  * The E4X expression compiler and runtime is mostly working, even
though I expect a couple more surprises (I havent tested XML templates
yet for example). It's grossly unoptimized at the moment but already
produces interesting results. In the second test process, for example,
you can see that name and phone nodes are created dynamically in
friendInfo.

  * If you check the test case, you'll see that messages are still
wrapped. That shouldn't be necessary in the end, as long as the send
method accepts the process name (=service name by default) and the
operation (wrapped element = operation + Request by default). Yeah,
the compiler uses several naming conventions as it builds the WSDL
document from the process definition. They're not configurable yet but
should be at some point and people who want to should even be able to
provide their own WSDL when they have one.

  * Hopefully we'll be able to not leak XML. Meaning that if you want
to only manipulate simple types, you'll only see simple types (like in
that third process). I'm still wondering whether we should provide
in-language and message level support for JSON data structures. It
could be pretty neat but also means we would have to do some XML <->
JSON conversions which is challenging at best. Anyway we're not even
close to that sort of problems at this point.

In a nutshell that's what exists at the moment which is not even the
tip of the iceberg. Although there's some surface covered. From that
you can probably guess the looong list of things left to do. Mixing
both language features and embedded IL features that would be: gradual
support for more activities, beefing up the embedded IL (which is very
primitive now), SimPEL correlation with function declarations
(probably lots of fun), bindings for Java and other languages, better
configuration, Spring friendliness, coding more advanced processes in
SimPEL to see how they look like, various optimizations and more....
As you can see, if you're interested in helping for some of these,
there's a lot of possibilities. Some would probably be easier to get
into than others though. In any case, feel free to ask.

That's it for today, hopefully I'll have more to show in a couple of
months for ApacheCon :) Comments definitely welcome.

Cheers,
Matthieu

Mime
View raw message