This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: blog entry - Kawa in Computer Languages "shootout"


On Oct 22, 2010, at 12:00 AM, Per Bothner wrote:

On 10/20/2010 03:01 PM, Jamison Hope wrote:
Here's a chameneos-redux implementation.

I checked it in. I made a modest change - see the attached patch. The problem was the 'main' function by default compiles as non-public, so it didn't get recognized as a proper Java main method. Instead, I changed the "top-level action" to be actually top-level.

That's interesting. When I compiled it with "java kawa.repl -C chameneosredux.scm" it worked for me.


$ javap chameneosredux | grep "public static void"
    public static void main(java.lang.String[]);
    public static void printAllColors();
    public static void printColors(Color, Color);

I didn't try compiling with --main, though. Your changes probably make the program more Scheme-ish anyway.

I also updated the "shootout" blog entry:
http://per.bothner.com/blog/2010/Kawa-in-shootout/

Running the program with --full-tailcalls uncovered a compiler
bug that caused a VerifyError.  I fixed that.  (The problem was
the array #!rest parameter in run - I had made some recent
changes to support this, but neglected -full-tailcalls.)

Again, thanks!

Later, when define-enum is working, we can update it to use define- enum.


Yeah. When there's a better way to iterate over an array, too. Which reminds me, a while back I wrote map and for-each functions which worked on arrays and java.util.Collection instances (attached). They may be of general interest.

--
Jamison Hope
The PTR Group
www.theptrgroup.com


Attachment: collections_utils.scm
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]