Skip to content

Repository files navigation

go-mlog

GitHub Workflow StatusGitHub release (latest SemVer)codecovCodeFactorGitHub go.mod Go versionGo Reference

Go to MLOG transpiler.

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

In Progress

  • MLOG Runtime

Roadmap

  • Full variable block scoping
  • Nested sub-selector support

Planned Optimizations

  • Simple jump instructions

Design Limitations

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

Endgame Roadmap

  • Transpilation optimizations
  • MLOG to Go decompiler

CLI Usage

Usage:
go-mlog transpile [flags] <program>
Flags:
-h, --help help for transpile
Global Flags:
--colors Force log output with colors
--comment-offset int Comment offset from line start (default 60)
--comments Output comments
--log string The log level to output (default "info")
--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

About

Go to Mindustry (MLOG) compiler and runtime

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages