Git Product home page Git Product logo

simplelanguage's Introduction

SimpleLanguage

A simple demonstration language built using Truffle for GraalVM.

SimpleLanguage is heavily documented to explain the how and why of writing a Truffle language. A good way to find out more is to read the source with comments. Start reading here. We also like to encourage people to clone the repository and start hacking.

This repository is licensed under the permissive UPL licence. Fork it to begin your own Truffle language.

For instructions on how to get started please refer to our website

Building for a JVM

Build the project with mvn package. To run simple language using a JDK from JAVA_HOME run ./sl.

Building a Native Image

Build the project with mvn package -Pnative. To run simple language natively run ./standalone/target/slnative.

simplelanguage's People

Contributors

ansalond avatar boris-spas avatar chrisseaton avatar christianwimmer avatar chumer avatar dougxc avatar mbrantner avatar pstutz avatar thomaswue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplelanguage's Issues

Fails to build with graalvm-ce 21.2.0

Running mvn package results in:

[INFO] --- maven-surefire-plugin:2.9:test (default-test) @ simplelanguage ---
[INFO] Surefire report directory: /mnt/c/Users/micro/Documents/dev/simplelanguage/language/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.oracle.truffle.sl.test.PassItselfBackViaContextTest
Tests run: 8, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 0.3 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLCodeSharingTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.01 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLDebugDirectTest
Tests run: 10, Failures: 0, Errors: 10, Skipped: 0, Time elapsed: 0.012 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLDebugTest
Tests run: 50, Failures: 25, Errors: 25, Skipped: 0, Time elapsed: 0.14 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLExceptionTest
Tests run: 14, Failures: 0, Errors: 14, Skipped: 0, Time elapsed: 0.014 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLExecutionListenerTest
Tests run: 12, Failures: 0, Errors: 12, Skipped: 0, Time elapsed: 0.011 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLFactorialTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLInstrumentLegacyTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.035 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLInstrumentTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLInteropControlFlowTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.025 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLInteropObjectTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.009 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLInteropOperatorTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLInteropPrimitiveTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.008 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLJavaInteropConversionTest
Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.008 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLJavaInteropDebugTest
Tests run: 4, Failures: 2, Errors: 2, Skipped: 0, Time elapsed: 0.009 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLJavaInteropExceptionTest
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLJavaInteropTest
Tests run: 28, Failures: 0, Errors: 28, Skipped: 0, Time elapsed: 0.013 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLLoggerTest
Tests run: 8, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 0.009 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLParseErrorTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLParseInContextTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.006 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLReadPropertyTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.008 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLSeparatedClassLoadersTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.006 sec
Running com.oracle.truffle.sl.test.SLSharedCodeSeparatedEnvTest
Tests run: 4, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.006 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLSimpleTestSuite
Tests run: 56, Failures: 0, Errors: 56, Skipped: 0, Time elapsed: 0.413 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.SLValueSharingTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.ToStringOfEvalTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!

Results :

Failed tests:   testExceptions(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testUnwindAndReenter(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testValuesScope(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testStack(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testNull(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testStatementAndExpressionStepOver(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testSourceLocation(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testBreakpointEverywhereBreaks(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testGuestFunctionBreakpoints(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testMisplacedLineBreakpoints(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testStepFromSuspendHere(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testMisplacedColumnBreakpoints(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testTimeboxing(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testBreakpoint(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testArgumentsAndValues(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testMetaObjects(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testDebugger(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testStackInterop(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testSuspendHereFromHost(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testBuiltInFunctionBreakpoints(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testStepInOver(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testDebugValue(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testExpressionStepInto(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testExpressionStepOver(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testExpressionStepOut(com.oracle.truffle.sl.test.SLDebugTest): Engine initialization failed
  testStackAtGuest(com.oracle.truffle.sl.test.SLJavaInteropDebugTest): Engine initialization failed
  testInteropStackAtGuest(com.oracle.truffle.sl.test.SLJavaInteropDebugTest): Engine initialization failed

Tests in error:
  callbackWithValueTruffleObject(com.oracle.truffle.sl.test.PassItselfBackViaContextTest): org.graalvm.polyglot.impl.AbstractPolyglotImpl: Unable to get public provider() method
  callbackWithValueTruffleObject(com.oracle.truffle.sl.test.PassItselfBackViaContextTest)
  callbackWithParamTen(com.oracle.truffle.sl.test.PassItselfBackViaContextTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  callbackWithParamTen(com.oracle.truffle.sl.test.PassItselfBackViaContextTest)
  callbackWithValueTen(com.oracle.truffle.sl.test.PassItselfBackViaContextTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  callbackWithValueTen(com.oracle.truffle.sl.test.PassItselfBackViaContextTest)
  callbackWithParamTruffleObject(com.oracle.truffle.sl.test.PassItselfBackViaContextTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder 
  callbackWithParamTruffleObject(com.oracle.truffle.sl.test.PassItselfBackViaContextTest)
  testFibSharing(com.oracle.truffle.sl.test.SLCodeSharingTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testDebuggerBreakpoint(com.oracle.truffle.sl.test.SLDebugDirectTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testDebuggerBreakpoint(com.oracle.truffle.sl.test.SLDebugDirectTest)
  testPause(com.oracle.truffle.sl.test.SLDebugDirectTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testPause(com.oracle.truffle.sl.test.SLDebugDirectTest)
  testNull(com.oracle.truffle.sl.test.SLDebugDirectTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testNull(com.oracle.truffle.sl.test.SLDebugDirectTest)
  testBreakpoint(com.oracle.truffle.sl.test.SLDebugDirectTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testBreakpoint(com.oracle.truffle.sl.test.SLDebugDirectTest)
  stepInStepOver(com.oracle.truffle.sl.test.SLDebugDirectTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  stepInStepOver(com.oracle.truffle.sl.test.SLDebugDirectTest)
  testExceptions(com.oracle.truffle.sl.test.SLDebugTest)
  testUnwindAndReenter(com.oracle.truffle.sl.test.SLDebugTest)
  testValuesScope(com.oracle.truffle.sl.test.SLDebugTest)
  testStack(com.oracle.truffle.sl.test.SLDebugTest)
  testNull(com.oracle.truffle.sl.test.SLDebugTest)
  testStatementAndExpressionStepOver(com.oracle.truffle.sl.test.SLDebugTest)
  testSourceLocation(com.oracle.truffle.sl.test.SLDebugTest)
  testBreakpointEverywhereBreaks(com.oracle.truffle.sl.test.SLDebugTest)
  testGuestFunctionBreakpoints(com.oracle.truffle.sl.test.SLDebugTest)
  testMisplacedLineBreakpoints(com.oracle.truffle.sl.test.SLDebugTest)
  testStepFromSuspendHere(com.oracle.truffle.sl.test.SLDebugTest)
  testMisplacedColumnBreakpoints(com.oracle.truffle.sl.test.SLDebugTest)
  testTimeboxing(com.oracle.truffle.sl.test.SLDebugTest)
  testBreakpoint(com.oracle.truffle.sl.test.SLDebugTest)
  testArgumentsAndValues(com.oracle.truffle.sl.test.SLDebugTest)
  testMetaObjects(com.oracle.truffle.sl.test.SLDebugTest)
  testDebugger(com.oracle.truffle.sl.test.SLDebugTest)
  testStackInterop(com.oracle.truffle.sl.test.SLDebugTest)
  testSuspendHereFromHost(com.oracle.truffle.sl.test.SLDebugTest)
  testBuiltInFunctionBreakpoints(com.oracle.truffle.sl.test.SLDebugTest)
  testStepInOver(com.oracle.truffle.sl.test.SLDebugTest)
  testDebugValue(com.oracle.truffle.sl.test.SLDebugTest)
  testExpressionStepInto(com.oracle.truffle.sl.test.SLDebugTest)
  testExpressionStepOver(com.oracle.truffle.sl.test.SLDebugTest)
  testExpressionStepOut(com.oracle.truffle.sl.test.SLDebugTest)
  testExceptions(com.oracle.truffle.sl.test.SLExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testExceptions(com.oracle.truffle.sl.test.SLExceptionTest)
  testThroughProxy(com.oracle.truffle.sl.test.SLExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testThroughProxy(com.oracle.truffle.sl.test.SLExceptionTest)
  testProxyGuestLanguageStack(com.oracle.truffle.sl.test.SLExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testProxyGuestLanguageStack(com.oracle.truffle.sl.test.SLExceptionTest)
  testGuestOverHostPropagation(com.oracle.truffle.sl.test.SLExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testGuestOverHostPropagation(com.oracle.truffle.sl.test.SLExceptionTest)
  testHostException(com.oracle.truffle.sl.test.SLExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testHostException(com.oracle.truffle.sl.test.SLExceptionTest)
  testGuestLanguageError(com.oracle.truffle.sl.test.SLExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testGuestLanguageError(com.oracle.truffle.sl.test.SLExceptionTest)
  testNonMain(com.oracle.truffle.sl.test.SLExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testNonMain(com.oracle.truffle.sl.test.SLExceptionTest)
  testRootsAndStatements(com.oracle.truffle.sl.test.SLExecutionListenerTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testRootsAndStatements(com.oracle.truffle.sl.test.SLExecutionListenerTest)
  testRoots(com.oracle.truffle.sl.test.SLExecutionListenerTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testRoots(com.oracle.truffle.sl.test.SLExecutionListenerTest)
  testStatements(com.oracle.truffle.sl.test.SLExecutionListenerTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testStatements(com.oracle.truffle.sl.test.SLExecutionListenerTest)
  testExpressionsStatementsAndRoots(com.oracle.truffle.sl.test.SLExecutionListenerTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder   
  testExpressionsStatementsAndRoots(com.oracle.truffle.sl.test.SLExecutionListenerTest)
  testFactorial(com.oracle.truffle.sl.test.SLExecutionListenerTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testFactorial(com.oracle.truffle.sl.test.SLExecutionListenerTest)
  testExpressions(com.oracle.truffle.sl.test.SLExecutionListenerTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testExpressions(com.oracle.truffle.sl.test.SLExecutionListenerTest)
  factorialOf1(com.oracle.truffle.sl.test.SLFactorialTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  factorialOf1(com.oracle.truffle.sl.test.SLFactorialTest)
  factorialOf3(com.oracle.truffle.sl.test.SLFactorialTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  factorialOf3(com.oracle.truffle.sl.test.SLFactorialTest)
  factorialOf5(com.oracle.truffle.sl.test.SLFactorialTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  factorialOf5(com.oracle.truffle.sl.test.SLFactorialTest)
  testEarlyReturn(com.oracle.truffle.sl.test.SLInstrumentLegacyTest): org/graalvm/polyglot/impl/AbstractPolyglotImpl$AbstractContextImpl
  testLexicalScopes(com.oracle.truffle.sl.test.SLInstrumentLegacyTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentLegacyTest
  testChangeArgumentsOnReenter(com.oracle.truffle.sl.test.SLInstrumentLegacyTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentLegacyTest
  testReplaceNodeReturnValue(com.oracle.truffle.sl.test.SLInstrumentLegacyTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentLegacyTest  testOutput(com.oracle.truffle.sl.test.SLInstrumentLegacyTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentLegacyTest
  testRedoIO(com.oracle.truffle.sl.test.SLInstrumentLegacyTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentLegacyTest
  testEarlyReturn(com.oracle.truffle.sl.test.SLInstrumentTest): Could not initialize class com.oracle.truffle.api.interop.InteropLibraryGen
  testLexicalScopes(com.oracle.truffle.sl.test.SLInstrumentTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentTest
  testChangeArgumentsOnReenter(com.oracle.truffle.sl.test.SLInstrumentTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentTest
  testReplaceNodeReturnValue(com.oracle.truffle.sl.test.SLInstrumentTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentTest
  testOutput(com.oracle.truffle.sl.test.SLInstrumentTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentTest
  testRedoIO(com.oracle.truffle.sl.test.SLInstrumentTest): Could not initialize class com.oracle.truffle.sl.test.SLInstrumentTest
  testWhile(com.oracle.truffle.sl.test.SLInteropControlFlowTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testIf(com.oracle.truffle.sl.test.SLInteropControlFlowTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testNewForeign(com.oracle.truffle.sl.test.SLInteropObjectTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testNewForeign(com.oracle.truffle.sl.test.SLInteropObjectTest)
  testObject(com.oracle.truffle.sl.test.SLInteropObjectTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testObject(com.oracle.truffle.sl.test.SLInteropObjectTest)
  testAdd(com.oracle.truffle.sl.test.SLInteropOperatorTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testSub(com.oracle.truffle.sl.test.SLInteropOperatorTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testChar(com.oracle.truffle.sl.test.SLInteropPrimitiveTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testBoolean(com.oracle.truffle.sl.test.SLInteropPrimitiveTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testGR7318Map(com.oracle.truffle.sl.test.SLJavaInteropConversionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testGR7318List(com.oracle.truffle.sl.test.SLJavaInteropConversionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testGR7318Object(com.oracle.truffle.sl.test.SLJavaInteropConversionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testStackAtGuest(com.oracle.truffle.sl.test.SLJavaInteropDebugTest)
  testInteropStackAtGuest(com.oracle.truffle.sl.test.SLJavaInteropDebugTest)
  testGuestHostCallbackHostError(com.oracle.truffle.sl.test.SLJavaInteropExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder   
  testTruffleMap(com.oracle.truffle.sl.test.SLJavaInteropExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testGuestHostCallbackGuestError(com.oracle.truffle.sl.test.SLJavaInteropExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder  
  testFunctionProxy(com.oracle.truffle.sl.test.SLJavaInteropExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testGR7284GuestHostGuestHost(com.oracle.truffle.sl.test.SLJavaInteropExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder     
  testGR7284(com.oracle.truffle.sl.test.SLJavaInteropExceptionTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairsFunctionalRawInterface(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairsFunctionalRawInterface(com.oracle.truffle.sl.test.SLJavaInteropTest)
  asFunction(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  asFunction(com.oracle.truffle.sl.test.SLJavaInteropTest)
  sumPairsIndirect(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairsIndirect(com.oracle.truffle.sl.test.SLJavaInteropTest)
  accessJavaMap(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  accessJavaMap(com.oracle.truffle.sl.test.SLJavaInteropTest)
  sumPairs(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairs(com.oracle.truffle.sl.test.SLJavaInteropTest)
  sumPairsFunctionalInterface(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairsFunctionalInterface(com.oracle.truffle.sl.test.SLJavaInteropTest)
  sumPairsInArray(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairsInArray(com.oracle.truffle.sl.test.SLJavaInteropTest)
  sumPairsInArrayOfArray(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairsInArrayOfArray(com.oracle.truffle.sl.test.SLJavaInteropTest)
  asFunctionWithArgVarArgs(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  asFunctionWithArgVarArgs(com.oracle.truffle.sl.test.SLJavaInteropTest)
  sumMapInArrayOfArray(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumMapInArrayOfArray(com.oracle.truffle.sl.test.SLJavaInteropTest)
  sumPairInMapOfArray(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  sumPairInMapOfArray(com.oracle.truffle.sl.test.SLJavaInteropTest)
  asFunctionWithArg(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  asFunctionWithArg(com.oracle.truffle.sl.test.SLJavaInteropTest)
  asFunctionWithArr(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  asFunctionWithArr(com.oracle.truffle.sl.test.SLJavaInteropTest)
  asFunctionWithVarArgs(com.oracle.truffle.sl.test.SLJavaInteropTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  asFunctionWithVarArgs(com.oracle.truffle.sl.test.SLJavaInteropTest)
  testLoggerSlFunctionParentLevelFine(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testMultipleContextsNestedFineLevel(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class com.oracle.truffle.sl.test.SLLoggerTest
  testLoggerNoConfig(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class com.oracle.truffle.sl.test.SLLoggerTest
  testMultipleContextsExclusiveFineLevel(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class com.oracle.truffle.sl.test.SLLoggerTest        
  testMultipleContextsNestedDifferentLogLevel(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class com.oracle.truffle.sl.test.SLLoggerTest   
  testLoggerSlFunctionSiblingLevelFine(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class com.oracle.truffle.sl.test.SLLoggerTest
  testMultipleContextsExclusiveDifferentLogLevel(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class com.oracle.truffle.sl.test.SLLoggerTest  testLoggerSlFunctionLevelFine(com.oracle.truffle.sl.test.SLLoggerTest): Could not initialize class com.oracle.truffle.sl.test.SLLoggerTest
  testParseError(com.oracle.truffle.sl.test.SLParseErrorTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testParseErrorEmpty(com.oracle.truffle.sl.test.SLParseErrorTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testParseErrorEOF1(com.oracle.truffle.sl.test.SLParseErrorTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testParseErrorEOF2(com.oracle.truffle.sl.test.SLParseErrorTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  parseAPlusB(com.oracle.truffle.sl.test.SLParseInContextTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  parseAPlusB(com.oracle.truffle.sl.test.SLParseInContextTest)
  testRead(com.oracle.truffle.sl.test.SLReadPropertyTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testRead(com.oracle.truffle.sl.test.SLReadPropertyTest)
  shareCodeUseDifferentOutputStreams(com.oracle.truffle.sl.test.SLSharedCodeSeparatedEnvTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  shareCodeUseDifferentOutputStreams(com.oracle.truffle.sl.test.SLSharedCodeSeparatedEnvTest)
  instrumentsSeeOutputOfBoth(com.oracle.truffle.sl.test.SLSharedCodeSeparatedEnvTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder     
  instrumentsSeeOutputOfBoth(com.oracle.truffle.sl.test.SLSharedCodeSeparatedEnvTest)
  Add(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Arithmetic(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Break(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Builtins(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Call(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Comparison(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  ControlFlow(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  DefineFunction(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Div(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Equal(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  InvalidAssignmentInAssignment(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  InvalidAssignmentInBinOp(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  InvalidAssignmentInBlock(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  InvalidAssignmentInIfCond(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  InvalidAssignmentInWhileCond(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  InvalidBreak(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  InvalidContinue(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  ParseError01(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  ParseError02(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeError01(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeError02(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeError03(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeError04(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeError05(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeError06(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeError07(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  UndefinedFunction01(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  UndefinedFunction02(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  UndefinedFunction03(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Eval(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Fibonacci(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  FunctionLiteral(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  HelloEqualsWorld(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  HelloWorld(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Inlining(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  IsMetaInstance(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  LocalTypeChange(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Logical(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Loop(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  LoopCall(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  LoopInvalidate(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  LoopObject(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  LoopObjectDyn(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  LoopPolymorphic(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  LoopPrint(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Mul(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Null(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Object(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  ObjectDyn(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  String(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Sub(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  Sum(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  SumCall(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  SumObject(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  SumPrint(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  TypeOf(com.oracle.truffle.sl.test.SLSimpleTestSuite): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  testImplicitValueSharing(com.oracle.truffle.sl.test.SLValueSharingTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  checkToStringOnAFunction(com.oracle.truffle.sl.test.ToStringOfEvalTest): Could not initialize class org.graalvm.polyglot.Engine$ImplHolder
  checkToStringOnAFunction(com.oracle.truffle.sl.test.ToStringOfEvalTest)

Tests run: 244, Failures: 27, Errors: 216, Skipped: 1

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for simplelanguage-parent 21.1.0:
[INFO]
[INFO] simplelanguage-parent .............................. SUCCESS [  0.011 s]
[INFO] simplelanguage ..................................... FAILURE [ 29.142 s]
[INFO] launcher ........................................... SKIPPED
[INFO] simplelanguage-graalvm-native ...................... SKIPPED
[INFO] simplelanguage-graalvm-component ................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  29.587 s
[INFO] Finished at: 2021-07-27T07:36:55+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project simplelanguage: There are test failures.    
[ERROR]
[ERROR] Please refer to /mnt/c/Users/micro/Documents/dev/simplelanguage/language/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :simplelanguage

With 21.1.0 the command completes succesfully.

Support for in-IDE builds, runs, and tests

I'm trying to build my own language on Graal, therefore I checked out this repo and built it. I can get the examples to run on the Maven built Jars, e.g. sl HelloWorld.sl, but not from within Eclipse.

To run SLMain I use the same JVM arguments as in the POM for tests:

-XX:-UseJVMCIClassLoader
-Xbootclasspath/a:../graalvm/jre/lib/truffle/truffle-api.jar:../graalvm/jre/lib/truffle/locator.jar:../graalvm/jre/lib/truffle/truffle-nfi.jar:../graalvm/Contents/Home/jre/lib/truffle/truffle-api.jar:../graalvm/Contents/Home/jre/lib/truffle/locator.jar:../graalvm/Contents/Home/jre/lib/truffle/truffle-nfi.jar

When I run SLMain with HelloWorld.sl I get:

== running on org.graalvm.polyglot.Engine@34a245ab
Exception in thread "main" java.lang.IllegalStateException: A language with id 'sl' is not installed. Installed languages are: [R, js, python, llvm, ruby].
	at com.oracle.truffle.api.vm.PolyglotEngineImpl.requirePublicLanguage(PolyglotEngineImpl.java:556)
	at com.oracle.truffle.api.vm.PolyglotContextImpl.requirePublicLanguage(PolyglotContextImpl.java:781)
	at com.oracle.truffle.api.vm.PolyglotContextImpl.eval(PolyglotContextImpl.java:757)
	at org.graalvm.polyglot.Context.eval(Context.java:162)
	at com.oracle.truffle.sl.launcher.SLMain.executeSource(SLMain.java:99)
	at com.oracle.truffle.sl.launcher.SLMain.main(SLMain.java:85)

When I run the tests, not a single one passes, I get errors like:

java.lang.AssertionError: Error in eval
	at com.oracle.truffle.tck.DebuggerTester.expectSuspended(DebuggerTester.java:246)
	at com.oracle.truffle.sl.test.SLDebugTest.expectSuspended(SLDebugTest.java:111)
	at com.oracle.truffle.sl.test.SLDebugTest.testMetaObjects(SLDebugTest.java:530)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.lang.IllegalStateException: A language with id 'sl' is not installed. Installed languages are: [R, js, meat, python, llvm, ruby, tck, truffletestinvoker].
	at com.oracle.truffle.api.vm.PolyglotEngineImpl.requirePublicLanguage(PolyglotEngineImpl.java:556)
	at com.oracle.truffle.api.vm.PolyglotContextImpl.requirePublicLanguage(PolyglotContextImpl.java:781)
	at com.oracle.truffle.api.vm.PolyglotContextImpl.eval(PolyglotContextImpl.java:757)
	at org.graalvm.polyglot.Context.eval(Context.java:162)
	at com.oracle.truffle.tck.DebuggerTester$ExecutingLoop.run(DebuggerTester.java:544)
	at java.lang.Thread.run(Thread.java:748)

So, how can I run examples and tests from within Eclipse for a Truffle language project?

Did I miss something in the documentation that would tell me how to set this up, or is a Maven build always required? If that is the case, then what is magic happening in the build?
I assumed that the Maven build merely applies an annotation processor to generate the missing classes, but it would not require witch craft to do this for the Eclipse build.
I do not want to debug my languages by building with Maven, starting a JVM with remote debugging enabled, and then connect the remote debugger. Building with Maven is fine for CI, but I want to use the features of my IDE, requiring a Maven build for every execution harms the user experience a lot.

Lack of usability

After opening this about 3d time, I feel sad about such wonderful work and effort put on GraalVM.

If it is about making GraalVM or Truffle popular then good documentation is essential for a growing community. Specially a quick start like doc.

This repo is like learning Hibernate from example (it's possible by digging in source code, just wonder if it makes it rational).

I believe there could be little more attraction for this example as well if there would be a review of the code style for S.O.L.I.D. like principles and/or things described in Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin.

The sl shell script doesn't work when installed using gu

Steps to reproduce
Inside a fresh checkout of the project:

  1. Build the GraalVM component with mvn package --am --pl ./component.
  2. Install the component in a GraalVM installation with gu install -L component/sl-component.jar.
  3. Run sl language/tests/HelloWorld.sl

Expected situation
Output is something like "Hello World!"

Actual behaviour
Output is

Could not find language on /usr/bin/language/target/simplelanguage.jar. Did you run mvn package?

Analysis
I believe this is due to the fact that the sl script in the project root fails to detect it is invoked from an installed GraalVM component and so it follows the path for "local" invocations, i.e. from the project checkout.

The sl binary from the component is symlinked into /usr/bin, so extracting the GraalVM version by inspecting "$SCRIPT_HOME/../release" fails.

`mvn package` test error

The console log as below:

/Users/xxx/Downloads/simplelanguage >> mvn package
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.oracle:simplelanguage:jar:0.28-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-eclipse-plugin is missing. @ line 48, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building simplelanguage 0.28-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.graalvm:graal-sdk:jar:0.28-SNAPSHOT is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ simplelanguage ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ simplelanguage ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ simplelanguage ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/zhengxiaolin/Downloads/simplelanguage/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ simplelanguage ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.9:test (default-test) @ simplelanguage ---
[INFO] Surefire report directory: /Users/zhengxiaolin/Downloads/simplelanguage/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.oracle.truffle.sl.test.SLFactorialTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.253 sec
Running com.oracle.truffle.sl.test.SLParseErrorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.033 sec
Running com.oracle.truffle.sl.test.SLJavaInteropTest
Tests run: 14, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.114 sec
Running com.oracle.truffle.sl.test.SLSharedCodeSeparatedEnvTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
Running com.oracle.truffle.sl.test.SLDebugTest
Tests run: 11, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.111 sec
Running com.oracle.truffle.sl.test.SLInteropPrimitiveTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running com.oracle.truffle.sl.test.SLSimpleTestSuite
Tests run: 54, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.731 sec
Running com.oracle.truffle.sl.test.SLTckTest
Tests run: 98, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.532 sec <<< FAILURE!
Running com.oracle.truffle.sl.test.PassItselfBackViaPolyglotEngineTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running com.oracle.truffle.sl.test.SLInteropControlFlowTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
Running com.oracle.truffle.sl.test.SLSharedCodeSeparatedEnvLegacyTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Running com.oracle.truffle.sl.test.SLInstrumentTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.061 sec
Running com.oracle.truffle.sl.test.SLDebugDirectTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.029 sec
Running com.oracle.truffle.sl.test.SLPolyglotTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running com.oracle.truffle.sl.test.SLParseInContextTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running com.oracle.truffle.sl.test.ToStringOfEvalTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec

Results :

Tests in error:
  testWriteToObjectWithValueProperty(com.oracle.truffle.sl.test.SLTckTest): Language environment is already disposed.

Tests run: 203, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.237 s
[INFO] Finished at: 2018-02-12T22:45:43+08:00
[INFO] Final Memory: 11M/37M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project simplelanguage: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/xxx/Downloads/simplelanguage/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Besides, graal version is 0.31 and,

>> java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

But running ./sl tests/HelloWorld.sl has no problems.

Can the antlr grammar be cleaned of all the Java code?

Right now I'd say it is a pretty non-standard ANTLR 4 grammar and detracts from the idea that this is a "SimpleLanguage". Most people that use Antlr use the generated visitor for compilation. For example, even a complicated grammar like for Java8 has very little (almost none except for checking character classes) Java code in the specification:

https://github.com/antlr/grammars-v4/blob/master/java8/Java8.g4

Is it a peculiarity of Truffle that requires it?

not work with GraalVM22

4 user-specific feature(s):

  • com.oracle.svm.thirdparty.gson.GsonFeature
  • com.oracle.svm.truffle.TruffleBaseFeature: Provides support for Truffle languages
  • com.oracle.svm.truffle.TruffleFeature: Provides support for Truffle runtime compilation
  • org.graalvm.home.HomeFinderFeature: Finds GraalVM paths and its version number

com.oracle.svm.core.util.VMError$HostedError: InternalFeature defined by com.oracle.svm.truffle.TruffleFeature unexpectedly failed with a(n) java.lang.NoSuchMethodError

"column out of range" when calling getSourceLocation() on SLParseError

Calling Context.create("sl").eval(org.graalvm.polyglot.Source.create("sl", "function")); causes:

java.lang.IllegalArgumentException: column out of range
	at com.oracle.truffle.api.source.Source.createSection(Source.java:599)
	at com.oracle.truffle.sl.parser.SLParseError.getSourceLocation(SLParseError.java:67)
	at com.oracle.truffle.api.vm.PolyglotExceptionImpl.<init>(PolyglotExceptionImpl.java:105)
	at com.oracle.truffle.api.vm.PolyglotExceptionImpl.<init>(PolyglotExceptionImpl.java:80)
	at com.oracle.truffle.api.vm.PolyglotImpl.wrapGuestException(PolyglotImpl.java:259)
	at com.oracle.truffle.api.vm.PolyglotContextImpl.eval(PolyglotContextImpl.java:744)
	at org.graalvm.polyglot.Context.eval(Context.java:311)
	at com.oracle.truffle.api.source.Source.createSection(Source.java:599)
	at com.oracle.truffle.sl.parser.SLParseError.getSourceLocation(SLParseError.java:67)

in com.oracle.truffle.api.source.Source.createSection(int, int, int)

if (startColumn > getTextMap().lineLength(startLine)) {
    throw new IllegalArgumentException("column out of range");
}

because startColumn is 9 and getTextMap().lineLength(startLine) is 8

SLInvokeNode uses createDispatched() manually

Hi,
contrary to the documentation of LibraryFactory.createDispatched(), the implementation of SLInvokeNode makes a manual call to that method.
Is there a cleaner, more "official" way to create an inline cache?

Greetings

how do i make those annotation processor work for eclipse?

I tried this on IntelliJ IDEA Ultimate edition first, but could not get the annotation processor to generate those classes.

I saw a few videos wherein I saw the people building graal used eclipse but did not help,
errors shown in screenshot, any help is appreciated

Screenshot 2019-10-19 at 22 36 01

Screenshot 2019-10-19 at 22 44 04

Screenshot 2019-10-19 at 22 51 27

Question on option parsing

When studying the implementation of Simple Language, I noticed something odd in SLMain.java.

In line 142, if the option name contains a dot, everything up until the dot is removed, but nothing is done with the result of that. The group variable is basically unused.

Is this on purpose, and if so, what is the purpose of it?

Guidance for implementing the launcher and REPL/Shell for a new language

Hello, I'm looking for some guidance for how best to implement the launcher and shell REPL for a new language using Truffle.

So far, I've looked at the following projects:

  1. simplelanguage
  2. mumbler
  3. graalphp

Looks like these projects all took the code in simplelanguage as a base, and added some local changes to adopt to their own language.

But looking at the GraalVM codebase, I noticed that there's a org.graalvm.launcher project, should that be used instead of wiring our own shell and REPL?

NFI - sample

Could you please add some nfi- native function interface sample for this simple language, There are few examples here, and the content in Graalpy is too complicated

Error setting up native image on Windows

Setting up the SL native image on Windows is throwing error.

Here's the steps I followed;
downloaded graalvm for java 21 and added the path to JAVA_HOME
added the bin path to the path variable
downloaded the simple language repo and ran mvn package -Pnative
I received this error
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for simplelanguage-parent 23.1.0:
[INFO]
[INFO] simplelanguage-parent .............................. SUCCESS [ 0.009 s]
[INFO] simplelanguage ..................................... SUCCESS [ 14.600 s]
[INFO] sl-tck ............................................. SUCCESS [ 19.629 s]
[INFO] launcher ........................................... SUCCESS [ 0.220 s]
[INFO] standalone ......................................... FAILURE [ 10.340 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.040 s
[INFO] Finished at: 2023-10-12T18:19:27+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:exec (make_native) on project standalone: Command execution failed.: Cannot run program "C:\sdks\graalvm-jdk-21+35.1\bin\native-image" (in directory "C:\Users\risharan\Documents\Dev\java\simplelanguage-master\standalone"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]

This isfixed if I change the native-image to native-image.cmd in the standalone/pom.xml

                                <configuration>
                                    <executable>
                                        ${env.JAVA_HOME}/bin/native-image.cmd</executable>
                                    <commandlineArgs>
                                        -p %classpath
                                        -H:+ReportExceptionStackTraces
                                        -m ${launcherClass}
                                        -o ${project.build.directory}/slnative
                                    </commandlineArgs>
                                </configuration>

Add TruffleNFI example

It'd be great if an example could be added to SimpleLanguage that demonstrates how to use TruffleNFI for implementing a FFI.

`generate_parser` still uses Coco

In current master SimpleLanguage.atg is gone and there is only an ANTLR grammar, so I assume that generate_parser should be changed to use ANTLR instead.

SLParseError.getSourceLocation() raises IllegalArgumentException

Parsing the erroneous code snippet
function main
in SL causes an internal error when calling SLParseError.getSourceLocation().

java.lang.IllegalArgumentException: column out of range
	at com.oracle.truffle.api.source.Source.createSection(Source.java:592)
	at com.oracle.truffle.sl.parser.SLParseError.getSourceLocation(SLParseError.java:67)
        ...

Caused because offending symbol is EOF and charPositionInLine + 1 is 14:

throw new SLParseError(source, line, charPositionInLine + 1, offendingSymbol == null ? 1 : ((Token) offendingSymbol).getText().length(), "Error(s) parsing script:\n" + location + msg);

The maven-eclipse-plugin has no version in the POM.

I know that this is really not a big deal, but fixing should help people using NetBeans.
Error message thrown is:

'build.plugins.plugin.version' for org.apache.maven.plugins:maven-eclipse-plugin is missing. @ line 48, column 12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.