Trying to run code in IOKE shell results in error?

31 views Asked by At

When I try to execute code in the IOKE shell it crashes.

 >ioke
 iik> "Hello World" println
Exception in thread "main" java.lang.NullPointerException
            at ioke.lang.IokeIO$2.activate(IokeIO.java:129)
            at ioke.lang.TypeCheckingNativeMethod.activate(TypeCheckingNativeMethod.java:50)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:999)
            at ioke.lang.Message.evaluateCompleteWithoutExplicitReceiver(Message.java:1145)
            at ioke.lang.Message.getEvaluatedArgument(Message.java:979)
            at ioke.lang.Message.getEvaluatedArgument(Message.java:983)
            at ioke.lang.FlowControlBehavior$9.activate(FlowControlBehavior.java:379)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Locals$1.activate(Locals.java:63)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:999)
            at ioke.lang.Message.evaluateCompleteWith(Message.java:1093)
            at ioke.lang.LexicalBlock.activate(LexicalBlock.java:198)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.LexicalBlock$2.activate(LexicalBlock.java:86)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:1011)
            at ioke.lang.FileSystem$7.activate(FileSystem.java:308)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:999)
            at ioke.lang.Message.evaluateCompleteWithoutExplicitReceiver(Message.java:1145)
            at ioke.lang.ConditionsBehavior$4.activate(ConditionsBehavior.java:342)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Locals$1.activate(Locals.java:63)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:999)
            at ioke.lang.Message.evaluateCompleteWithoutExplicitReceiver(Message.java:1145)
            at ioke.lang.Message.getEvaluatedArgument(Message.java:979)
            at ioke.lang.Message.getEvaluatedArgument(Message.java:983)
            at ioke.lang.FlowControlBehavior$7.activate(FlowControlBehavior.java:298)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Locals$1.activate(Locals.java:63)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:999)
            at ioke.lang.Message.evaluateCompleteWithoutExplicitReceiver(Message.java:1145)
            at ioke.lang.ConditionsBehavior$4.activate(ConditionsBehavior.java:342)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Locals$1.activate(Locals.java:63)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:999)
            at ioke.lang.Message.evaluateCompleteWith(Message.java:1093)
            at ioke.lang.DefaultMethod.activate(DefaultMethod.java:283)
            at ioke.lang.IokeObject.activate(IokeObject.java:1053)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:1038)
            at ioke.lang.IokeObject.getOrActivate(IokeObject.java:514)
            at ioke.lang.IokeObject.perform(IokeObject.java:659)
            at ioke.lang.IokeObject.perform(IokeObject.java:592)
            at ioke.lang.IokeObject.perform(IokeObject.java:522)
            at ioke.lang.Message.sendTo(Message.java:999)
            at ioke.lang.Message.evaluateComplete(Message.java:1066)
            at ioke.lang.Runtime.evaluateString(Runtime.java:525)
            at ioke.lang.Main.main(M

ain.java:149)

What is causing this to error? I'm using Windows 10, my IOKE_HOME and JAVA_HOME env variables are set (Otherwise the REPL wouldn't be invoked in the first place). Any help will be appreciated.

1

There are 1 answers

0
Resigned June 2023 On

I suspect that this has to do with Ioke attempting to use some Java API to retrieve the user's home directory. I found that the problem reproduced on Linux when running Ioke as any user who did not have a home directory, despite the HOME environment variable being set. I was able to work around the problem by setting the JAVA_OPTS environment variable:

$ JAVA_OPTS="-Duser.home=$PWD" ioke

Note that similar problems occur with other Java-based programming languages such Kotlin, and the same workaround can sometimes be applied. Clearly, somebody made a very poor design decision deep down in the Java APIs.

Note that Ioke has been completely abandoned since 2011, and is unlikely to receive any updates or support in the future.