Thursday, May 28, 2009

Working again after parrot 1.0

Partcl once again builds against parrot (tested against r39220), and passes everything in 'make test'!

While there haven't been any functional changes since the last post, we are now building against an installed parrot; that involved quite a few changes to partcl's build process.

There have also been some incompatible parrot changes since last we built; we're now tracking all of those changes.

Once parrot 1.3 is released, we can switch to just building against an installed monthly release of parrot!

Thanks to allison, Infinoid, NotFound, pmichaud, and cotto from #parrot for their fixes to both partcl and parrot to get us afloat again.

Thursday, March 12, 2009

Distracted, but still here.

I've been working with the core parrot team trying to get as much in order as possible for the upcoming 1.0 release.

Once that release is out the door, I'll come back and make sure that we have a version of partcl that runs against parrot 1.0.

-Coke

Monday, January 26, 2009

partcl progress, January 2009

Keeping up with parrot

Lots of commits this month to keep up with changes in parrot trunk; a recent push in that project to finally remove some items marked as deprecated forced me to finally update our code. This should make things go more smoothly once parrot declares a 1.0 release.

There is one regression in our core tests at the moment due to a recent change in how parrot handles attributes on PMCs. (C-level data structures resembling objects). 

[Trace]? Not yet

I added a basic version of trace that allowed us to parse several specification tests that we previously were unable to; However, the simple version of [trace] involved invoking the tcl compiler with an [uplevel] command (which in turn, invokes the tcl compiler...) on every read access of a traced array; this resulted in about a 4x slowdown in the test suite, so I had to back it out. As we see speedups in other areas, it should be possible to re-enable this.

Run init.tcl

Grabbed a copy of init.tcl from the tcl repository (updating to target 8.5.6 while I was at it.). We are now running this on interpreter startup, and getting a few things for free that we had to roll our own for in the past. The biggest remaining thing is to get [unknown] dispatch working to use the unknown defined here. [auto_load] and friends are now working; unknown support is the last stop to getting several builtins written in tcl automatically loadable.

[array startsearch]

Parrot has had iterators for quite some time, and I finally got around to making them accessible to tcl. The implementation for here involved converting the C-based TclArray data structure (which was a simple extension of a parrot Hash) into a PIR-based version. The PIR based code makes it much easier to add per-instance attributes, include information to track open iterators. 

The only remaining bit to fix is how we reuse the named iterators: start 2 searches; kill the last one; start a new search - the name for that in partcl is off by one from the expected name in Tcl.

Convert TclList?

The relative ease of converting TclArray (combined with a suspicion that this would speed up partcl), led me to try to convert the C code for managing lists to PIR as well. The resulting code is much cleaner (PIR doing a lot of the lifting for us).

However, the conversion didn't go smoothly. PIR subclasses of C-based PMCs are not fully equivalent; I never did get all tests passing after the conversion even with some workarounds in place, and one of the tests that did pass did not run appreciably faster. So that work in progress was discarded.

I was somewhat disappointed to find that there were issues with the PIR subclasses, but was sure to report them back to the parrot project as issues to be tracked.

Note to self: Seriously, stop trying to make things go faster if you don't have a profiler. It's not going to be worth it.

Fix stringification of (some) lists

The Tcl spec test "list.test" was aborting before printing out the results, meaning we couldn't count several passing tests. Tracked this down to two edge cases of stringification of lists elements that we got wrong. There are more, but these two prevented successful execution of the tests. Added them to partcl's core tests to avoid regressions; that's another 64 passing spec tests that we can now count.

$ ./tclsh
% list "{ab}xy" "{ab}\\"
{{ab}xy} \{ab\}\\


Review Tests

Went through the list of skipped tests and found a few that were able to be re-instated. As always, our spec test progress is visible, along with current stats on various .test files. Since last month's posting, we're passing another few hundred tests.


Sunday, December 21, 2008

some headway

After spending some time just treading water with parrot updates, we've made some headway against the spec tests, which is nice. ^_^

Thanks to dgp on #tcl on freenode for his suggestion for a stub for [interp alias] that let us run basic.test to completion!

We regressed on  compile.test with the recent updates, but added five more spec test files that run to completion. That's 320 more passing tests, include a few extras in already completing files.

I also tracked down the expected boolean value but got "" error that is blocking many of the spec tests from running any tests; turns out that the constraint framework in tcltest.tcl (which helps determine if a given test in the file should be run or not) requires a minimal version of [trace] in order to work. Pulling at this thread, the trace refers to [namespace code], which means we also need [namespace inscope] ; I have a work in progress on each of these, but it's not quite ready for checkin. Thanks to pmichaud on #parrot for some thoughts on how trace (or tie in p5) might work on parrot.

Thursday, December 18, 2008

Speedups since parrot 0.8.1

I got partcl's trunk working with parrot's trunk again, catching up with some changes in parrot that we couldn't deal with because of segfaults we were seeing.

With the updates, 'make test' now passes again in trunk, and 'make spectest' completes, giving the same results it did against 0.8.1; Here's a snippet from our progress tracker:

"date","revision","parrot revision","files","test","pass","fail","skip","time in seconds"
"2008-11-19 12:51",159,"v0.8.1",57,4001,2341,1059,601,12550
"2008-12-18 12:15",195,"r34059",57,4001,2341,1059,601,9232

So, with no functional changes, we've gone from 3.5 hours to run the tests to 2.6 hours. Which is still terribly slow, but down from horrifically slow.

I've also identified a parrot segfault that is blocking completion of the spec test "expr-old.test"; which would get us at least 254 more passing tests. This particular segfault is also impacting rakudo perl, so hopefully between the two of us we can get a small test case for core parrot developers to resolve the issue.

Wednesday, December 17, 2008

Not just for developers anymore?

When we moved partcl out of parrot's svn repository, one of the goals was to target a stable version of parrot so that we could work without having things break underneath us. (One of the reasons I'm looking forward to parrot 1.0.); I've ended up turning this requirement sideways a bit: I want a stable version for users of partcl (All 1.2 of you.)

I've now created a "stable" branch of the partcl svn repository that tracks a released version of parrot (currently 0.8.1). The download instructions for partcl now show you how to get a combination of parrot & partcl that work together.

Hopefully after every parrot release, we'll be able to update our stable branch to track it. Unfortunately, due to some issues that cropped up near the end of the 0.8.2 development lifecycle, we missed that release.

I'd definitely be interested in feedback, especially from folks that use tcl on a regular basis.

Monday, November 10, 2008

October 2008 roundup

Just a brief update…

Done a bit of work since the last post, fixing up as many blockers as possible running the spec test; Current status is available on the wiki. Short version: 2182 passing tests.

Eliminated some unused code, added minor cleanups and a bit of new functionality still hidden by the aforementioned blockers. Got partcl working with parrot 0.8.0, and then rapidly depending on a newer svn revision. Convinced Matt Diephouse to write some code (yay!), got a patch from julian notfound to fix the build using C++, and some documentation updates from Jerry Gay.

partcl, while not taking advantage of the Parrot Compiler Toolkit (PCT), still uses the Parser Grammar Engine (PGE) heavily† - looks like a recent Hague grant to Patrick Michaud from The Perl Foundation will provide some speedups to PGE, which in turn can only make us go faster. 


† You can see this by using the -t4 option to parrot (trace subroutines) and running any small tcl program, even ../../parrot -t4 tcl.pbc -e "puts hi"  and sorting through the output.