The Source for Java Technology Collaboration
User: Password:



Tom Ball

Tom Ball's Blog

Jackpot Early Access Available

Posted by tball on March 13, 2006 at 05:03 PM | Comments (11)

jackpot_logo_small.gif

Well, it's been a long haul, but Jackpot is now available as an early access release. It's not pretty or have a rich command set yet, but the core engine works and there is lots of documentation to read and sample transformations to try out. Everything can be found at the Jackpot project home page.

As previously promised, this early access release is geared toward developers who want to create their own queries and transformations, rather than people who just want to use built-in commands. For the JavaOne timeframe, we are planning on a beta release with some major UI improvements as well as a much more interesting command set.

I'm looking forward to reading everyone's feedback. If you have ideas about Java transformations, join the project!

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Thanks a lot! I really like it so far.

    Posted by: gfx on March 13, 2006 at 05:46 PM

  • Wow! This looks absolutely fantastic. The expression/algebra you have is really clear to read, while not being verbose at all. I'm looking forward to installing it when I have some free time--thanks for pushing to get this released to the community. Cheers! Patrick

    Posted by: pdoubleya on March 14, 2006 at 03:57 AM


  • Hi Tom,

    I am having a bit of trouble understanding this rule engine. you have the following cleanup rule that i don't quite get...

    { $p$; $t $v = $e; return $v; } => { $p$; return $e; }

    if $p$ is a meta-list, and $v and $e are meta-variables...
    What is the $t a meta-type, i don't get it?

    i understand this one
    { $p$; $v = $e; return $v; } => { $p$; return $e; }
    but i don't get this one:
    { $p$; $t $v = $e; return $v; } => { $p$; return $e; }

    Could you plz explain it a little, what is the difference beetween the two and what a $t $v is? is $t different form $meta-variable and why the syntax looks like the same is $t a "keyword" special token?

    Posted by: danielmd on March 14, 2006 at 07:39 AM

  • In meta-variables and lists, the letters don't matter -- they are just identifiers. I tend to use 'T' or 't' to indicate a type, which would match types like "int" or "String". But it's completely a matter of personal taste.

    So in your example, "$v = $e;" is an assignment to a variable, matching statements like "i = 3;". "$t $v = $e;" only matches a variable declaration with an initializer, such as "int i = 3;". Sometimes you want to match any assignment, and other times you need to only match variable declarations. I'll work on making the tutorial clearer.

    Posted by: tball on March 14, 2006 at 08:44 AM


  • Ok, now i think i get the workings of the rule engine, it is just looking for patterns the $t $v it is not validating anything, it can be my own types/classes, it is just being used as wildcard values, the code must already be valid for this to work, right?!?

    The rule language is a bit cryptic at first, it is a bit like programming with Templates in C++ ;^) once you learn it you see the power. Still learning...

    Posted by: danielmd on March 14, 2006 at 10:43 AM

  • At http://jackpot.netbeans.org/index.html, the "Install" and "Read the tutorial" links points to collab.netbeans.org.

    Posted by: claudio on March 14, 2006 at 01:20 PM

  • Doh! The links have been fixed -- thanks for the report.

    Posted by: tball on March 14, 2006 at 01:34 PM

  • Right, code has to be valid (compilable), since Jackpot relies upon a semantic model of your project which is created by the compiler. Jackpot couldn't verify that its changes result in compilable code unless the code was compilable to begin with. I wanted to avoid "garbage in, garbage out" issues. :-)

    I find it useful to compare rules to regular expressions, with meta-variables as wildcards. Rules work on abstact syntax trees instead of text, but conceptually they are similar. Although rules have limits on the types of transformations they can perform (unlike Java transformations), they are a lot easier to write and (most importantly) code review. Three people correctly reported an incorrect rule in the tutorial already, and I doubt any of them had any rule authoring experience!

    Posted by: tball on March 14, 2006 at 01:45 PM

  • So what's the difference between Jackpot and AOP? What are the advantages of using Jackpot rather than AspectJ?

    I've used AspectJ but don't know much about Jackpot, and I'm having trouble understanding what you could do in Jackpot that you can't do with AspectJ.

    More info on the advantages/disadvantages vs AOP would be appreciated.

    Posted by: dave_clark on March 14, 2006 at 04:41 PM

  • @dave_clark:
    There's no relation between AOP and Jackpot. Jackpot is two things:
    language to define code patterns; this allows you to do static analysis of code, not on a text base, but with the sources AST (which is, I assume, annotated with types) and on a whole source base (ie. class names are resolved, ...);
    after you've found code that matches these patterns, you the option to transform them into something different;.


    The analysis part has long been available in tools like PMD (which uses XPath for it); the transformation part basically takes the captured AST nodes and arranges them in the way you specify, then serializes them to source code again.

    Posted by: murphee on March 15, 2006 at 04:12 AM

  • OK - So Jackpot and AOP have a different approach to implementation - but is there any difference in the things that I can do with Jackpot vs AOP?
    AOP also lets you define code patterns (point cuts), and then apply transformations to that code (advice). What can you actually *do* with Jackpot that you can't do with AOP? And what can you *do* with AOP that you can't do with Jackpot?
    i.e. when would I use one rather than the other?

    Posted by: dave_clark on March 15, 2006 at 10:40 AM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds