Coder Social home page Coder Social logo

mun's Introduction

Mun

Build Status codecov docs page MIT/Apache Join us on Discord Lines of Code

Mun is a programming language empowering creation through iteration.

Features

  • Ahead of time compilation - Mun is compiled ahead of time (AOT), as opposed to being interpreted or compiled just in time (JIT). By detecting errors in the code during AOT compilation, an entire class of runtime errors is eliminated. This allows developers to stay within the comfort of their IDE instead of having to switch between the IDE and target application to debug runtime errors.

  • Statically typed - Mun resolves types at compilation time instead of at runtime, resulting in immediate feedback when writing code and opening the door for powerful refactoring tools.

  • First class hot-reloading - Every aspect of Mun is designed with hot reloading in mind. Hot reloading is the process of changing code and resources of a live application, removing the need to start, stop and recompile an application whenever a function or value is changed.

  • Performance - AOT compilation combined with static typing ensure that Mun is compiled to machine code that can be natively executed on any target platform. LLVM is used for compilation and optimization, guaranteeing the best possible performance. Hot reloading does introduce a slight runtime overhead, but it can be disabled for production builds to ensure the best possible runtime performance.

  • Cross compilation - The Mun compiler is able to compile to all supported target platforms from any supported compiler platform.

  • Powerful IDE integration not implemented yet - The Mun language and compiler framework are designed to support source code queries, allowing for powerful IDE integrations such as code completion and refactoring tools.

Examples

fn main() {
    let sum = add(a, b);

    // Comments: Mun natively supports bool, float, and int
    let is_true = true;
    let var: float = 0.5;
    
}

// The order of function definitions doesn't matter
fn add(a: int, b: int): int {
    a + b
}

Documentation

The Mun Programming Language Book

Pre-Built Binaries

[NOTE] We do not provide support for milestone releases

Download pre-built binaries of milestone releases for macOS, Linux, and Windows (64-bit only).

Building from Source

Installing dependencies

Make sure you have the following dependencies installed on you machine:

Rust

Install the latest stable version of Rust, e.g. using rustup.

LLVM

Mun targets LLVM 7.1.0. Installing LLVM is platform dependant and as such can be a pain. The following steps are how we install LLVM on our CI runners:

  • *nix: Package managers of recent *nix distros can install binary versions of LLVM, e.g.:
    # Ubuntu 18.04
    sudo apt install llvm-7 llvm-7-* liblld-7*
  • Arch Linux As its package manager doesn't have lld7, it's easier to download all binaries manually.
    # Download binaries for Ubuntu 14.04 (works across distros)
    wget https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/clang+llvm-7.1.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz
    # Unpack to /usr/ directory
    tar -xf clang+llvm-7.1.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz -C /usr/
    When running llvm-config, an error can occur signalling that /usr/lib/libtinfo.so.5 is missing. If a newer version is present, create a symlink; e.g. ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5), otherwise download the library.
  • macOS: Brew contains a binary distribution of LLVM 7.1.0. However, as it's not the latest version, it won't be added to the path. We are using llvm-sys to manage version, but another option is to export the LLVM_SYS_70_PREFIX variable, which will not clutter your PATH. To install:
    brew install llvm@7
    # Export LLVM_SYS_PREFIX to not clubber PATH
    export LLVM_SYS_PREFIX=$(brew --prefix llvm@7)
  • windows: Binary distrubutions are available for Windows on the LLVM website, but they do not contain a number of libraries that are required by Mun. To avoid having to go to the trouble of compiling LLVM yourself, we created a repository that automatically compiles the required binaries. It also contains a release that you can download and extract to your machine. Once downloaded and extracted, add the <extract_dir>/bin folder to the PATH environment variable.

Compiling

cargo build --release

License

The Mun Runtime is licensed under either of

at your option.

mun's People

Contributors

baszalmstra avatar wodann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.