Exception compiling Main class

45 views
Skip to first unread message

Alan Dipert

unread,
Dec 22, 2014, 11:14:59 PM12/22/14
to yeti...@googlegroups.com
Hello,
I am trying to compile the Main class from the tutorial, but get an exception from the compiler.  I am using yeti 0.9.9 on OS X with JDK 1.8.0_25.  I have installed the yeti jar to my local Maven repo.  What I am seeing follows.  Thanks in advance for any help!
Alan

alandipert@alanputer:~ cat test.yeti
module fac.test;

fac x = fold (*) 1 [1 .. x];

class Main
    static void main(String[] argv)
        println (fac 5)
end
alandipert@alanputer:~ java -jar ~/.m2/repository/yeti/yeti/0.9.9/yeti-0.9.9.jar -d target test.yeti
java.lang.ArrayIndexOutOfBoundsException: 5747
at yeti.renamed.asm3.ClassReader.readClass(Unknown Source)
at yeti.renamed.asm3.ClassReader.accept(Unknown Source)
at yeti.lang.compiler.ClassFinder.readClass(ClassFinder.java:205)
at yeti.lang.compiler.JavaType.resolve(JavaType.java:520)
at yeti.lang.compiler.JavaType.resolve(JavaType.java:534)
at yeti.lang.compiler.JavaType.resolve(JavaType.java:525)
at yeti.lang.compiler.JavaType.resolve(JavaType.java:890)
at yeti.lang.compiler.MethodDesc.check(DefineClass.java:78)
at yeti.lang.compiler.MethodDesc.check(DefineClass.java:84)
at yeti.lang.compiler.MethodDesc.defineClass(DefineClass.java:252)
at yeti.lang.compiler.YetiAnalyzer.analSeq(YetiAnalyzer.java:1106)
at yeti.lang.compiler.YetiAnalyzer.analyze(YetiAnalyzer.java:92)
at yeti.lang.compiler.YetiAnalyzer.toCode(YetiAnalyzer.java:1869)
at yeti.lang.compiler.Compiler.compile(Compiler.java:473)
at yeti.lang.compiler.Compiler.compileAll(Compiler.java:199)
at yeti.lang.compiler.eval$compileYetiFiles$._0(eval.yeti:335)
at yeti.lang.compiler.eval$compileYetiFiles$.apply(eval.yeti:326)
at yeti.lang.compiler.yeti._3(yeti.yeti:231)
at yeti.lang.compiler.yeti.main(yeti.yeti:224)

ma...@cyber.ee

unread,
Dec 28, 2014, 11:56:35 AM12/28/14
to yeti...@googlegroups.com



On Mon, 22 Dec 2014, Alan Dipert wrote:

> Hello,
> I am trying to compile the Main class from the tutorial, but get an
> exception from the compiler. I am using yeti 0.9.9 on OS X with JDK
> 1.8.0_25. I have installed the yeti jar to my local Maven repo. What I am
> seeing follows. Thanks in advance for any help!

I suspect it is something JDK 1.8 specific, probably Yeti hasn't been
tested with it. Maybe the (quite old) asm library version used by
Yeti cannot handle JDK 1.8 class files. I'll investigate it.
> --
> You received this message because you are subscribed to the Google Groups "yeti-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yeti-lang+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Madis

unread,
Jan 23, 2015, 6:39:53 PM1/23/15
to yeti...@googlegroups.com

On Sun, 28 Dec 2014, ma...@cyber.ee wrote:

> On Mon, 22 Dec 2014, Alan Dipert wrote:
>
>> Hello,
>> I am trying to compile the Main class from the tutorial, but get an
>> exception from the compiler. I am using yeti 0.9.9 on OS X with JDK
>> 1.8.0_25. I have installed the yeti jar to my local Maven repo. What I am
>> seeing follows. Thanks in advance for any help!
>
> I suspect it is something JDK 1.8 specific, probably Yeti hasn't been tested
> with it. Maybe the (quite old) asm library version used by Yeti cannot handle
> JDK 1.8 class files. I'll investigate it.

Some investigation after upgrading my debian to jessie and getting OpenJDK
1.8 confirmed this. Unfortunately it's not minor fix - I hoped to locate
the fix in ASM library and backport it to the 3.1 version used by Yeti,
but it seems that the .class file string table format has changed, which
means that a new ASM version has to be used. Since the ASM library major
versions APIs are not backwards compatible, it takes a bit longer to fix
this. Shouldn't be nothing catastrophic though, especially considering
that most ASM library accesses in the compiler are done through thin
wrapper (that does some bytecode optimisations).

Alan Dipert

unread,
Jan 23, 2015, 7:55:18 PM1/23/15
to yeti...@googlegroups.com, ma...@cyber.ee
Thank you for investigating.  I remain a Yeti noob but I'm happy to help, if only with testing.
Alan

Madis

unread,
Jan 23, 2015, 8:27:21 PM1/23/15
to yeti...@googlegroups.com


Seems that the porting ASM 5.0.3 was actually easier than I expected. It
is done, the JDK8 bug should be fixed now and hopefully nothing else got
broken. The compiler might be even slightly faster now.
Reply all
Reply to author
Forward
0 new messages