Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Ovid (2709)

  (email not shown publicly)
AOL IM: ovidperl (Add Buddy, Send Message)

Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.

Journal of Ovid (2709)

Monday February 07, 2005
12:24 AM

Java Hell

[ #23057 ]

I am convinced porting code from Java to Perl is generally easier than the other way around. I pity the Java programmer who is forced to go from Perl's richness of expression to a carefully constructed language that smacks your hand if you even look at it funny.

And I should add that I finally got the Java code to compile. I feel like an idiot at my silly brain cramp. My utility script was doing javac instead of javac *java. Talk about a newbie error. However, this now means that I'll be able to modify the Java to my heart's content and trace its execution. This should put me back on track. In fact, it might even allow me to do a proper port without the compiler compiler. Hmm ...

I'm also better appreciating the XProlog internals. WProlog doesn't quite follow the WAM standard (as I understand it) of using $functor/$arity for keys identifying predicates. Instead, it uses $functor/$arity-$clausenum. This is wasteful of memory in the database hash because we now have separate entries foreach clause:

owns(merlyn,gold). % owns/2-1
owns(ovid,rubies). % owns/2-2

If the functor owns is reused many times, that's a lot of hash entries. In XProlog, those each get entered as a clause in the database under the owns/2 key. Unfortunately, making that conversion in the code caused a deep recursion error on even simple predicates. I'll figure it out, but tomorrow work calls. I probably won't be able to touch it again until next weekend.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.