Mun

A programming language empowering creation through iteration.

image/svg+xmlOpenclipartwarning icon2010-03-03T13:31:08A very simple warning icon that can be scaled down fairly small and still be recognizable.https://openclipart.org/detail/29833/warning-icon-by-matthewgarysmithmatthewgarysmith
  • icon
  • sign
  • warning
  • yellow
  •  Work in Progress image/svg+xmlOpenclipartwarning icon2010-03-03T13:31:08A very simple warning icon that can be scaled down fairly small and still be recognizable.https://openclipart.org/detail/29833/warning-icon-by-matthewgarysmithmatthewgarysmith
  • icon
  • sign
  • warning
  • yellow
  • We appreciate your interest in Mun, but you are a little early to the party. The Mun language and toolchain are still in the early stages of development and nowhere near production-ready. If that doesn't scare you, then please continue reading.

    Make It or Break It

    Pong (est. 1972)
    Mun v0.2, "The Mun Team"

    Mission

    The idea to create Mun originated out of frustration with the Lua dynamic scripting language that is extensively used for game development at Abbey Games.

    Lua's hot reloading capabilities and LuaJIT's performance make it a great language for rapid prototyping of real-time applications - such as games - on PC. However, the language has performance issues on some mobile and console platforms - to which LuaJIT cannot deploy, the language lacks refactoring functionality, and does not scale well with modern technology.

    Mun tries to take the best of both worlds to create a more robust, highly iterative, productive, and performant programming language.

    Pillars

    Hot Reloading

    Mun natively supports hot reloading - the process of changing code and resources while an app is running - on all target platforms and consoles with marginal runtime overhead. Its runtime has useful error messages, and can easily be embedded into other languages.

    Static Typing

    Mun's type system eliminates an entire class of runtime errors and provides powerful IDE integration with auto-completion and refactoring tools allowing developers to focus on writing code.

    Performance

    Mun uses LLVM to compile to machine code that can be natively executed on any target platform, guaranteeing the best possible runtime performance.

    Made for Creators

    Games

    Quickly iterate designs using Mun's hot reloading capabilities, without compromising performance.

    Mobile & Console

    Leverage Mun's cross compilation to unlock hot reloading for console and mobile development.

    Robotics

    Use Mun's toolchain to build, tweak, and deploy applications to your robot with zero downtime.

    WebAssembly

    Use the same Mun toolchain to build, test, and deploy content to the web using WebAssembly modules.

    XR

    Embed Mun into AR / MR / VR apps to unleash the power of creation in an immersive environment.

    Syntax

    The driving force behind the development of Mun is natively supported hot reloading for functions and data. As such, the language and its syntax will keep growing at the rate in which we add hot reloading-supported semantics.

    We take inspiration from a range of application, scripting, and systems programming languages, but we also want the community's input in defining a syntax that you find comfortable to use. We will regularly tweet proposals for new syntax, so make sure to follow us.

    fn fibonacci(n: i32) -> i32 {
        if n <= 1 {
            n
        } else {
            fibonacci(n - 1) + fibonacci(n - 2)
        }
    }
    
    // Comments: functions marked as `pub` can be called outside the module
    pub fn main() {
        // Native support for bool, f32, f64, i8, u8, u128, i128, usize, isize, etc
        let is_true = true;
        let var = 0.5;
    
        // Type annotations are not required when a variable's type can be deduced
        let n = 3;
    
        let result = fibonacci(n);
    
        // Adding a suffix to a literal restricts its type
        let lit = 15u128;
    
        let foo = record();
        let bar = tuple();
        let baz = on_heap();
    }
    
    // Both record structs and tuple structs are supported
    struct Record {
        n: i32,
    }
    
    // Struct definitions include whether they are allocated by a garbage collector
    // (`gc`) and passed by reference, or passed by `value`. By default, a struct
    // is garbage collected.
    struct(value) Tuple(f32, f32);
    
    struct(gc) GC(i32);
    
    // The order of function definitions doesn't matter
    fn record() -> Record {
        // Mun allows implicit returns
        Record { n: 7 }
    }
    
    fn tuple() -> Tuple {
        // Mun allows explicit returns
        return Tuple(3.14, -6.28);
    }
    
    fn on_heap() -> GC {
        GC(0)
    }

    Recent blog posts

    Release - Mun v0.4.0
    December 12, 2022, The Mun Team

    Guess who's back?! The previous Mun release dates back over one and a half years. Since then - slowly but steadily - we've been working towards Mun v0.4.0 and it's finally here!

    This Month in Mun - May 2021
    June 08, 2021, The Mun Team

    The core team is working on new features for Mun v0.4. The biggest feature will be dynamically sized arrays.

    All posts   subscribe

    Support us

    The Mun programming language is developed by a group of volunteers. To further advance the project, we welcome any and all:

      Contribute Donate   Engage   Follow   Sponsor

    Thanks

    Mun would not exist without the hard work, time, and resources generously contributed by individuals and companies. We would like to thank everyone for making Mun a reality!

    Individuals

    Mun is developed by a community. We are very thankful to the community for all of its contributions.

      Contributors   Sponsors

    Corporate sponsors

    Mun is supported by companies through the use of infrastructure or by (facilitating) donations