Using Truffle for the blz programming language
Alex Gravenor
caalex101 at gmail.com
Wed Apr 18 20:17:30 UTC 2018
Hi all,
I am the creator of blz <https://github.com/blazingkin/blz-ospl/tree/v2.6>,
an interpreted programming language written in Java.
I've been looking to transition blz onto Truffle for a while, but I have a
few questions before I can do so.
I'd also appreciate any advice about working with Truffle, as I am only an
undergrad and I'm mostly making it up as I go.
My first question is about the truffle-dsl processor.
Both simple language
<https://github.com/graalvm/simplelanguage/blob/master/language/src/main/java/com/oracle/truffle/sl/nodes/expression/SLDivNode.java>
and graal.js
<https://github.com/graalvm/graaljs/blob/master/graal-js/src/com.oracle.truffle.js.nodes/src/com/oracle/truffle/js/nodes/binary/JSDivideNode.java>
use abstract (in the Java sense) expression nodes, supposedly relying on
the truffle-dsl processor to create the NodeNameGen concrete classes.
I've been trying to transition the blz nodes
<https://github.com/blazingkin/blz-ospl/blob/v2.6/language/src/com/blazingkin/interpreter/executor/astnodes/DivisionNode.java>
to a similar system.
However, I cannot seem to get truffle to generate these classes (when I add
annotations like @NodeInfo and run a mvn package), is there something else
I need to run?
Next, I was wondering about the convention of boxed / unboxed values.
For blz, I have a Value
<https://github.com/blazingkin/blz-ospl/blob/v2.6/language/src/com/blazingkin/interpreter/variables/Value.java>
class that essentially boxes values with a datatype.
It seems like the convention with Truffle is to make specializations for
unboxed values.
Is it possible to keep these boxed values, and if so will it be at the cost
of performance?
Finally, I have some concerns about portability.
The only versions of Graal available from OTN
<http://www.oracle.com/technetwork/oracle-labs/program-languages/downloads/index.html>
are for UNIX systems.
I've tried building Graal on a windows machine, but I ran into several
issues with the python script in mx not being compatible with the windows
filesystem. (I have some fixes that I may put in a PR)
How viable is it to use the version of Graal in JDK 9/10? Is it even
available on windows?
I would like to not exclude users for the sake of speed.
Y'all are doing super exciting work. Congrats on the 1.0 release!
Thanks,
Alex Gravenor
More information about the graal-dev
mailing list