esolang

mLang (Mihai Popa)

A calculator with six buttons, run by a Windows Batch file.

Mihai Popa, 2024 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: "Hello, world!"

The idea

Mihai Popa made mLang in 2024. It can print and it can do sums, and nothing else. It has no input. The specification gives every command next to the line of Batch it stands for, and the interpreter is a Batch file that takes the program as its arguments, as in mlang.bat print "Hello, world!".

Read the story

So a program is one command. The Batch file reads its first three words and ignores the rest.

The machine

CommandDoes
print xShow x
add x y sub x yShow x + y, x − y
mul x y div x y mod x yShow x × y, x ÷ y, the remainder

The sums are done by set /a, so numbers are whole and 32 bits, div rounds toward 0, and a name such as x is a variable that is not set and counts as 0. print shows its word the way echo does, double quotes included.

Example

The Batch file has no exit after the part for sub, so it runs straight on into the part for mul.
Expected: 11

The Batch file has no exit after the part for sub, so it runs straight on into the part for mul. A subtraction shows its difference and then the product of the same two numbers.

Expected: 3 28

Further

Also in Jokes

Write your own in Run Convert a program from mLang (Mihai Popa)

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: mlang-mihai-popa.

Command line

shib run mlang-mihai-popa -e 'print 4'
shib manual mlang-mihai-popa

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/mlang-mihai-popa.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org