Skip to main content

The Mys (/maɪs/) programming language.

Project description

discord docstatus

WARNING

Mys is still in the very early stages of development. API:s will change, so now is the time to make suggestions! Join the Mys Discord server to get in touch with the developers!

🐁 Mys

The Mys (/maɪs/) programming language - an attempt to create a statically typed Python-like language that produces fast binaries.

Mys is heavily inspired by Python’s syntax and Rust’s packaging.

Source code:

from random.pseudo import random

def main():
    print(random())

Package configuration:

[package]
name = "robot"
version = "0.1.0"
authors = ["Mys Lang <mys.lang@example.com>"]

[dependencies]
random = "*"

Mys is mainly targeting resource constrained single and multi core embedded systems, but is just as useful in desktop environments.

Notable differences to Python:

  • Traits instead of classic inheritence.

  • Statically typed.

  • Bytes and strings are mutable.

  • Integers are bound (i32, u32, i64, …).

  • Iterators/generators do not (yet?) exist.

  • Rust-like generic functions and classes.

  • Only packages. No stand alone modules.

  • Compiled to machine code. No interpreter.

  • Data races and memory corruption possible, but unlikely.

  • No async.

  • Only from ... import ... is allowed. import ... is not.

  • Only functions, enums, traits, classes and variables can be imported, not modules.

Build process

mys build, mys run and mys test does the following:

  1. Use Python’s parser to transform the source code to an Abstract Syntax Tree (AST).

  2. Generate C++ code from the AST.

  3. Compile the C++ code with g++.

  4. Link the application with g++.

Calling mys from GNU Make recipe

mys uses make internally. Always prepend the command with + to share jobserver.

Mocking

from random.pseudo import random

def add(value: f64) -> f64:
    return value + random()

def test_add():
    random_mock_once(5.3)
    assert add(1.0) == 6.3

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mys-0.153.0.tar.gz (274.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page