Skip to content

krn-robin/majestik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

123 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Majestik - a Magik implementation

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:

  1. 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, integer and float; as well as the invoke and the if/then/else expressions.

  2. Runtime: provides a standard library with basic functionality to run a Magik program.

    As of now, only the write variable in the sw package 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 package

Running


java --enable-preview -jar target/majestik-0.0.0-SNAPSHOT.jar helloworld.magik

FAQ


  • 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.

Footnotes

  1. Magik (programming language) on Wikipedia

  2. Magik-Tools

  3. Class-File API 2

  4. Magik Hello World example

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors