Giter Site home page Giter Site logo

unnamed / mocha Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 1.0 707 KB

A lightweight, fast and efficient Molang lexer, parser, interpreter and compiler for Java 8+

Home Page: https://unnamed.team/docs/mocha

License: MIT License

Java 93.70% JavaScript 6.30%
bytecode compiler interpreter java jvm lexer minecraft minecraft-bedrock molang parser

mocha's Introduction

unnamed

Unnamed Team's archive. Assets, conventions and contributing guidelines.

mocha's People

Contributors

yusshu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mocha's Issues

Compile to JVM bytecode

Feature request: Add a way to compile Molang scripts/code to JVM bytecode, it would make execution a lot faster.

This could be implemented using the visitors API, making a compiler visitor that will return an executable script.
For example:

interface MolangCompiler extends ExpressionVisitor<MolangScript> {
    // ...
}

interface MolangScript {
    Object execute();
}

And then:

final var expression = MolangParser.parseAll("1 + 1");
final var compiled = expression.visit(MolangCompiler.compiler());
// we can cache "compiled"
final var result = compiled.execute();

We may want to make parser return a ExecutionScopeExpression instead of a List of expressions.

Also, use javassist

Rename project

(Suggestion) Rename the project, molang is the name of the language, specified by Minecraft developers, this project should have a different name.

The name should be a single word.

We are accepting ideas!

Implement the arrow operator (`->`)

This may require some changes on the interpreter and bindings, since it seems like an entity can be attached to the scripts as part of the context.

More information about it here

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.