User:Marc Gurevitx/MiniScript



MiniScript is a high-level programming language intended to be small and easy to learn for beginner programmers. It supports structured, procedural and object-oriented paradigms (the latter via prototypes). Its development and features are inspired by Python, Lua, REALbasic and C#..

The first stable version was released at 2017 and it became open-source at 2019.

The official interpreter can be embedded in other programs (written in C++ or C#) but one can also use it as an interactive shell (REPL) or standalone script executor. The official file extension of MiniScript's programs is.

There are some unofficial ports of MiniScript to other languages which allow embedding it in programs written in Kotlin, Java and TypeScript

Data types
MiniScript has a small number of intrinsic data types: numbers, strings, lists and maps.

There are also functions that organize code in a procedural way. As in many modern languages, the functions are “first-class citizens”.

There is a special  value that represents the absence of any useful value. It belongs to its own distinguished data type.

It's possible to create new types using maps as “prototypes”. The namespaces of functions and modules are also maps.

Control structures
MiniScript provides a few simple control structures:


 * for conditional branching
 * for conditional repetition
 * for iterating over collections

Programming examples
Hello world program:

Program to calculate the factorial:

Working with objects:

Extending the built-in types:

Host programs
Some environments that embed or expose MiniScript:


 * Mini Micro – a fantasy retro computer where MiniScript is both a programming language and the language of the command shell.
 * Farmtronics – a game mod for Stardew Valley that lets the player obtain a home computer and farming robots and program them in MiniScript.
 * Grey Hack – a hacking simulator game in which the MiniScript (rebranded as GreyScript) is used as a scripting language for the in-game computers.
 * Robo Reindeer Rumble – a competitive multiplayer programming game where players program battle robots (that look like reindeer) with MiniScript.

Projects
Some projects that were written in MiniScript:


 * Inversion Institute – a puzzle/visual novel about logic and magic.
 * Mini Micro Sokoban – a version of the classic japanese video game.
 * World Conquest – a mini turn-based strategy game.
 * µ-hack – a roguelike retro game.