congratulations on the release!!!! Alex On Feb 2, 2005, at 2:56 AM, Ryan Davis wrote: > Actual announcements are on http://blog.zenspider.com/ > > Copy/paste job below: > > ===== > > I am releasing ParseTree 1.3.3 today in preparation of our ruby2c > release (also today). Changes in ParseTree are minor, but necessary > for ruby2c. > > ParseTree is a C extension (using RubyInline) that extracts the parse > tree for an entire class or a specific method and returns it as a > s-expression (aka sexp) using ruby's arrays, strings, symbols, and > integers. > > As an example: > def conditional1(arg1) > if arg1 == 0 then > return 1 > end > return 0 > end > > becomes: > [:defn, > :conditional1, > [:scope, > [:block, > [:args, :arg1], > [:if, > [:call, [:lvar, :arg1], :==, [:array, [:lit, 0]]], > [:return, [:lit, 1]], > nil], > [:return, [:lit, 0]]]]] > > Features/Problems: > + Uses RubyInline, so it just drops in. > + Includes SexpProcessor and CompositeSexpProcessor. > + Allows you to write very clean filters. > + Includes show.rb, which lets you quickly snoop code. > + Includes abc.rb, which lets you get abc metrics on code. > + abc metrics = numbers of assignments, branches, and calls. > + whitespace independent metric for method complexity. > + Only works on methods in classes/modules, not arbitrary code. > + Does not work on the core classes, as they are not ruby (yet). > > Changes: > + 3 minor enhancement > + Cleaned up parse_tree_abc output > + Patched up null class names (delegate classes are weird!) > + Added UnknownNodeError and switched SyntaxError over to it. > + 2 bug fixes > + Fixed BEGIN node handling to recurse instead of going flat. > + FINALLY fixed the weird compiler errors seen on some versions of > gcc 3 .4.x related to type punned pointers. > > ===== > > Releasing ruby2c 1.0.0 beta 1 > > After far too long, I finally have the dubious honor of releasing > ruby2c 1.0.0 beta 1 today. I'm itching to do it, we really need to get > it out there so people can get their eyes on it and give us feedback. > I'm also nervous as hell... the thing is a mess! > > Understand what we mean by beta. It means we need eyes on it, it > means it was ready enough to put out in the wild, but it also means > that it isn't ready for any real use. > > What can it do? > > Well, currently it can pass all of its unit tests (325 tests with 512 > assertions) and it can translate nice simple static algorithmic code > into C without much problem. For example: > & cat x.rb > class Something > def blah; return 2+2; end > def main; return blah; end > end > & ./translate.rb x.rb > x.c > & gcc -I /usr/local/lib/ruby/1.8/powerpc-darwin x.c > x.c: In function `main': > x.c:17: warning: return type of `main' is not `int' > & ./a.out > & echo $? > 4 > > What can it not do? > > More than it can. > > It can't (and won't) translate dynamic code. Period. That is simply > not the intent. > > It probably can't translate a lot of static code that we simply > haven't come across or anticipated yet. Our tests cover a fair amount, > our validation runs cover a lot more than that, but it is still fairly > idiomatic ruby and that puts us at being better at certain styles of > coding and much worse at others. > > It is also simply rough around the edges. We've rounded out the rdoc > but haven't done a thing for general documentation yet. These are on > our list, and rather high on our priority list, but we just haven't > had the time yet. For now, check out the rdoc and the PDF presentation > that we've had up for a while. > > PLEASE: file bugs! We need feedback and we'd like to be able to track > it. The ruby2c project is on rubyforge and I'm getting the trackers > set up today as well. >