Skip to content

v0.11.0

Compare
Choose a tag to compare
@Rohansi Rohansi released this 13 Feb 22:14
· 6 commits to master since this release
  • Breaking: Changed (fixed) the execution order of function calls x(y, z) from y, z, x to x, y, z
  • Breaking: Replaced automatic wrapping of functions inside objects with instance calls
    • Calls in the form of x.y(z, w) will turn into x.y(x, z, w) conceptually at compile time where x will only be evaluated once
    • If x is global or Capitalized then it will not transform into an instance call
    • Caching an object's method will no longer automatically bind the method to the object
    person.greet(); // ✔️ 
    const greet = person.greet;
    greet(person); // ✔️ 
    greet(); // ✖️ will not pass the instance to the method
    
  • Breaking: Writing values to objects will no longer attempt to write to something in the prototype chain when the key doesn't exist
  • Breaking: __get and __set metamethods have been replaced by proxy objects
  • Breaking: Replaced params MondValue[] with params Span<MondValue> everywhere
  • Made .mnd file extensions optional in require()
  • Added an export modifier to make creating modules easier
    // Math.mnd
    export fun add(x, y) -> x + y;
    export const pi = 3.14159;
    export * from MoreMath; // merge another module's exports into this one
    
  • Added an import statement to make it easier to use modules
    import Math;
    // or...
    from Math import { add };
    // or...
    from 'Math.mnd' import { add };
    
  • Added support for function syntax inside of object literals
    const obj = {
      method() {
        // ...
      },
      fun methodB() {
        // ...
      },
      seq methodC() {
        // ...
      },
      @decorator
      fun methodD() {
        // ...
      }
    };
    
  • Optimized increment/decrement operation when the result is not needed