Majestik is an attempt to implement the Magik programming language1, using Magik-Tools2 and Java's Class-File API3. It is currently in the very early stages of development and lacks most features.
Components
Majestik is composed of two core components:
-
Compiler: This component translates the AST produced by Magik-Tools' Magik-Squid into JVM bytecode using the Class-File API.
Currently, only supports literal types
boolean,string,integerandfloat; as well as theinvokeand theif/then/elseexpressions. -
Runtime: provides a standard library with basic functionality to run a Magik program.
As of now, only the
writevariable in theswpackage has a barebones implementation.
Features
In the project's current state, it is possible (and pretty much limited just to) run a Magik "Hello World" example program4.
_block
world << "World!"
write("Hello")
write(world)
int << 12345
write(int)
flt << 5.4321
write(flt)
bool << _false
_if bool
_then
write("fail")
_else
write("success")
_endif
_endblock
Compiling
mvn packageRunning
java --enable-preview -jar target/majestik-0.0.0-SNAPSHOT.jar helloworld.magikFAQ
-
Q: Why does Majestik require JDK 24? A: Majestik uses the Class-File API3, which was introduced as a permanent feature in Java 24.
-
Q: Can generated class files be used in a (Smallworld) Magik session? A: Yes, they can be used in a Magik session, provided the Magik session is started with JDK 24.