Scripting language written in, and, designed to communicate with, java

Overview

mi-lang

mu-360x

Scripting language designed to communicate with java, to allow for easy plugins, addons, etc in any project, all without having to create an entire programming language for it. Plugin / Addon developers don't need to create an entire java project for small things either, making life easier for both sides. Syntactically inspired by rust (pretty much only the keywords) but structure-wise it feels like simply writing java code with less code for same output.

Wiki

To see all features explained in detail: https://github.com/crxyne/mi-lang/wiki

Usage

Make sure you have java 17 or higher installed. Download the mi-lang.jar from the releases tab. To compile a .mi file, use your terminal in the directory of your code file. Alternatively, create a script that does the same for you. Command:

java -Xmx2G -Xms2G -jar mi-lang.jar compile main=yourmodule.main file='yourfile.mi'

To execute your newly generated .mib binary, type the following into your terminal (or again, your script):

java -Xmx2G -Xms2G -jar mi-lang.jar run file='yourfile.mib'

Java usage

import org.crayne.mi.bytecode.common.ByteCodeInstruction;
import org.crayne.mi.bytecode.reader.ByteCodeInterpreter;
import org.crayne.mi.log.MessageHandler;
import org.crayne.mi.stdlib.MiStandardLib;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;

public class Tests {

    public static void main(@NotNull final String... args) {
        final Mi mi = new Mi(System.out, true);
        final MessageHandler messageHandler = mi.messageHandler();

        final String code = """
module testing {
    
    fn main {
        std.println("hello world!");
    }
    
}
                """;

        final List<ByteCodeInstruction> program = mi.compile(MiStandardLib.standardLib(), code, "testing", "main");
        final ByteCodeInterpreter runtime = new ByteCodeInterpreter(program, messageHandler);
        runtime.run();

        // or, alternatively compile from and to a file, read from that file and run the binary instead
        final File inputFile = new File("path_to_input_file/file.mi");
        try {
            mi.compile(MiStandardLib.standardLib(), Files.readString(inputFile.toPath()), new File("path_to_file/file.mib"), inputFile, "testing", "main");
        } catch (final IOException e) {
            e.printStackTrace();
        }
    }


}

NOTES

Be patient

Barebones version is finished, but to have some more high level language features it will take some more time. Still in BETA, so if you find any bugs, report them. Currently working on bytecode execution, so at this state, mi is unusable. Be patient.

The language is bad but not horrible (ha)

While this language may be interpreted in java (which is generally a horrible idea), the purpose of this language is not to be fast. However, whenever possible, the code will be optimized to allow for a faster execution. As a sidenote, this compiles to bytecode, meaning anyone could, in theory, write an interpreter for it in another language to get a better performance.

helloworld

module helloworld {
    
    fn main {
        std.println("Hello, world!");
    }

}

FEATURES:

  • basic strongly typed programming language features
  • (currently one sided) communication with java for easy scripting in any java project

TODOS:

  • first and most important todo for now, fix the parser code, its absolutely horrible
  • structs and impls similar to rust
  • macros, to insert code in front of a function
  • assert, typedef and their combination for fast easy types
  • operator overloading as an option for already defined functions
  • calling mi functions from java, to allow for eventhandlers, etc
You might also like...

A list of direct references to classes and interfaces in the Java Language Specification (3d Ed.)

A list of direct references to classes and interfaces in the Java Language Specification (3d Ed.) and a program to compute the indirectly required classes and interfaces

Jun 3, 2022

The utility is designed to implement version control of APEX application pages.

The utility is designed to implement version control of APEX application pages.

Oracle APEX version control tool The utility is designed to implement version control of APEX application pages. How it works The developer exports th

Aug 25, 2022

A straight table component designed for performance

@qlik-oss/react-native-simple-grid A straight table component designed for performance Installation npm install @qlik-oss/react-native-simple-grid Usa

Apr 23, 2022

The MeterRegistryHolder class is designed to hold MeterRegistry as a static field.

MeterRegistryHolder The MeterRegistryHolder class is designed to hold MeterRegistry as a static field. Goal The goal is to simplify using MeterRegistr

Sep 20, 2022

During a machine coding round of the company, I designed the Conference Room System in a given one hour.

During a machine coding round of the company, I designed the Conference Room System in a given one hour.

DesignConferenceRoom DESIGN A CONFERENCE ROOM One of the core problems which people face at every company is the unavailability of conference rooms. S

Dec 23, 2022

PolarDB-X is a cloud native distributed SQL Database designed for high concurrency, massive storage, complex querying scenarios.

PolarDB-X is a cloud native distributed SQL Database designed for high concurrency, massive storage, complex querying scenarios.

中文文档 What is PolarDB-X ? PolarDB-X is a cloud native distributed SQL Database designed for high concurrency, massive storage and complex querying scen

Dec 31, 2022

Spawn in the nether with a set of items. Made by logwet, designed by k4yfour, idea by Fyroah.

Spawn in the nether with a set of items. Made by logwet, designed by k4yfour, idea by Fyroah.

Noverworld Noverworld About Creating your own custom inventory Support FAQ About When you create a new world, you will spawn in the nether at a portal

Nov 24, 2022

Public proof-of-concept obfuscator using the MapleIR framework designed by cts & bibl

Public proof-of-concept obfuscator using the MapleIR framework designed by cts & bibl

Skidfuscator: Obfuscation like never seen before. Join the discord: https://discord.gg/QJC9g8fBU9 🕵️ What is Skidfuscator? Skidfuscator is a proof of

Jan 5, 2023

Create different patterns and designs using your favorite programming language for this project.

Create different patterns and designs using your favorite programming language for this project.

Patterns project for Hacktoberfest Create different patterns and designs using your favourite programming language weather it be a square pattern, sta

Oct 5, 2022
Comments
  • Bump commons-text from 1.9 to 1.10.0

    Bump commons-text from 1.9 to 1.10.0

    Bumps commons-text from 1.9 to 1.10.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • Bump annotations from 23.0.0 to 23.1.0

    Bump annotations from 23.0.0 to 23.1.0

    Bumps annotations from 23.0.0 to 23.1.0.

    Release notes

    Sourced from annotations's releases.

    23.1.0

    • Added new annotation: `@ApiStatus.Obsolete
    Changelog

    Sourced from annotations's changelog.

    Version 23.1.0

    • Added new annotation: @ApiStatus.Obsolete.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
Owner
quality > quantity
null
Drone - A service via REST API that allows clients to communicate with drones

Drone - A service via REST API that allows clients to communicate with drones (i.e. **dispatch controller**). The specific communication with the drone is outside the scope of this task.

Obinna Ogbonna 1 Jan 10, 2022
Jamal is a macro language (JAmal MAcro Language)

Jamal Macro Language Jamal is a complex text processor with a wide variety of possible use. The first version of Jamal was developed 20 years ago in P

Peter Verhas 29 Dec 20, 2022
For Jack language. Most of codes were commented with their usage, which can be useful for beginner to realize the running principle of a compiler for object-oriented programming language.

Instructions: Download the Java source codes Store these codes into a local folder and open this folder Click the right key of mouse and click ‘Open i

gooooooood 1.1k Jan 5, 2023
Practice and testing with Java 11, Prometheus, and Spring-boot with MicroService Architecture. Designed to run on Kubernetes in minikube.

This application was written by Andrew Aslakson Built to run on minikube using kubernetes General race tracking system? Secure with Firebase Authentic

null 1 Feb 5, 2022
A simple live streaming mobile app with cool functionalities and time extension, and live chat. With a payment system integrated. Server is designed with socket.io to give you full flexibility.

Video Live Streaming Platform Android A simple live streaming mobile app with cool functionalities and time extension, and live chat. With a payment s

Dev-Geek 2 Dec 16, 2022
Geoponics is an E-Commerce Android Based Application Designed for Farmers As Well As Normal Users to Buy and Sell Agricultural goods!

Geoponics : E-Commerce Application Geoponics is an E-Commerce Android Based Aplication Designed for Farmers As Well As Normal Users to Buy and Sell Ag

Prasad 3 Aug 31, 2021
A boilerplate project designed to work as a template for new microservices and help you get in touch with various useful concepts.

Microservice Reference Project This project is inspired by the idea to quickly create a production ready project with all the required infrastructure

Innovation & Tech 4 Dec 17, 2022
A small companion library to Mixin, designed to help you write your Mixins in a more expressive and compatible way.

MixinExtras A small companion library to Mixin, designed to help you write your Mixins in a more expressive and compatible way. More information about

null 97 Jan 7, 2023
This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncApi and OpenAPI.

SCS MultiApi Maven Plugin This is a Maven plugin designed to help developers automatizing the creation of code classes from YML files based on AsyncAp

Corunet 0 Dec 20, 2022
Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based system

FRC 2022 Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based s

null 4 Oct 4, 2022