All Projects → Vilsol → go-mlog

Vilsol / go-mlog

Licence: GPL-3.0 license
Go to Mindustry (MLOG) compiler, runtime and decompiler (WIP)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-mlog

jsx.js
small and extendable jsx transpiler
Stars: ✭ 19 (+0%)
Mutual labels:  transpiler
atom-ts-transpiler
A transpiler for Atom packages that processes code with TypeScript
Stars: ✭ 14 (-26.32%)
Mutual labels:  transpiler
habrlang
Step by Step guide how to make your own programming language
Stars: ✭ 20 (+5.26%)
Mutual labels:  transpiler
Jikka
an automated solver for problems of competitive programming
Stars: ✭ 143 (+652.63%)
Mutual labels:  transpiler
py2many
Transpiler of Python to many other languages
Stars: ✭ 420 (+2110.53%)
Mutual labels:  transpiler
coffee-to-ts
[NOT ACTIVELY MAINTAINED] Convert CoffeeScript to TypeScript
Stars: ✭ 34 (+78.95%)
Mutual labels:  transpiler
natsu-clr
il2cpp transpiler and runtime compatible with .Net Core
Stars: ✭ 76 (+300%)
Mutual labels:  transpiler
LunarML
A Standard ML compiler that produces Lua/JavaScript
Stars: ✭ 127 (+568.42%)
Mutual labels:  transpiler
py2v
A Python to V transpiler.
Stars: ✭ 47 (+147.37%)
Mutual labels:  transpiler
preact-codemod
🍧 Shave some bytes by using Preact.
Stars: ✭ 39 (+105.26%)
Mutual labels:  transpiler
Essentials
Mindustry plugin - Essentials
Stars: ✭ 42 (+121.05%)
Mutual labels:  mindustry
neo4j-graphql-java
Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher
Stars: ✭ 94 (+394.74%)
Mutual labels:  transpiler
Sapphirium
This mod adds a lot of additional content.
Stars: ✭ 33 (+73.68%)
Mutual labels:  mindustry
6umpukc
Тулинг для разработки сайтов и решений на Bitrix под Ubuntu/Windows
Stars: ✭ 13 (-31.58%)
Mutual labels:  transpiler
prog-mats-js
Adds a bunch of scripted stuff. The name definitely isn't synonyms of Advance Content.
Stars: ✭ 35 (+84.21%)
Mutual labels:  mindustry
coro-scratch
A Scratch to Python transpiler that makes extensive use of coroutines
Stars: ✭ 22 (+15.79%)
Mutual labels:  transpiler
testing-utilities-js
Just some small utilities for sandbox/modding
Stars: ✭ 18 (-5.26%)
Mutual labels:  mindustry
json-sql-builder2
Level Up Your SQL-Queries
Stars: ✭ 59 (+210.53%)
Mutual labels:  transpiler
War3Net
A .NET implementation of Warcraft III related libraries.
Stars: ✭ 76 (+300%)
Mutual labels:  transpiler
Ohno-Missiles
With the new ballistic missile, you can nuke the enemies with various missile silos.
Stars: ✭ 90 (+373.68%)
Mutual labels:  mindustry

go-mlog

GitHub Workflow Status GitHub release (latest SemVer) codecov CodeFactor GitHub go.mod Go version Go Reference

Web IDE

A Web IDE is available here

Examples

There are several example programs available on the wiki.

Supports

  • Functions
  • Multiple function parameters/arguments
  • Multiple function return values
  • return from functions
  • for loops
  • if/else if/else statements
  • switch statement
  • break/continue/fallthrough statements
  • Statement labeling
  • goto statements
  • Binary and Unary math
  • Function level variable scopes
  • Contextual errors
  • Tree-shaking unused functions
  • Multi-pass pre/post-processing
  • Stackless functions
  • Comment generation including source mapping
  • Sub-selector support
  • Type checking
  • Full variable block scoping

In Progress

  • MLOG Runtime
  • MLOG to Go decompiler

Roadmap

  • Nested sub-selector support
  • Merged compiler and decompiler registries
  • Constant string and number slices

Planned Optimizations

  • Simple jump instructions
  • Recursive constant propagation
  • Write directly to function return variable
  • Write directly to function parameters before jump
  • Single-reference function inlining

Design Limitations

  • Only hardcoded (translated) imports allowed
  • Single file support only
  • No recursion (more info here)

Endgame Roadmap

  • Transpilation optimizations
  • Support tail-recursion

CLI Usage

Usage:
  go-mlog [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  decompile   Decompile MLOG to Go
  execute     Execute MLOG
  help        Help about any command
  transpile   Transpile Go to MLOG
  trex        Transpile Go to MLOG and execute it
  typings     Output typings as JSON
  version     Print current go-mlog version

Flags:
      --colors               Force log output with colors
      --comment-offset int   Comment offset from line start (default 60)
      --comments             Output comments
  -h, --help                 help for go-mlog
      --log string           The log level to output (default "info")
      --metrics              Output source metrics after execution
      --numbers              Output line numbers
      --output string        Output file. Outputs to stdout if unspecified
      --source               Output source code after comment
      --stacked string       Use a provided memory cell/bank as a stack
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].