Skip to content

HyperMatrix v1.0.3 ( Archetype Refactoring )

Compare
Choose a tag to compare
@HyperMatrixDev HyperMatrixDev released this 20 Jan 18:10
· 28 commits to main since this release
b2e3b0d

HyperMatrix v1.0.3 Release Notes

Welcome to HyperMatrix v1.0.3! This release introduces major improvements, fixes critical issues, and refines the functionality of archetypes for enhanced performance and usability.


Fixes and Improvements

Class Instance Properties

  • Resolved an issue where all instances of a class shared the same properties. Instances now maintain independent properties.

Function Display in Console

  • Fixed a bug where functions were incorrectly displayed as strings in the console.

this Scope Binding

  • Corrected a problem where the this object unintentionally referenced the parent scope. It now correctly binds to local variables.

Instance Variables in -continue Mode

  • Addressed issues accessing instance variables in interactive -continue mode.

Instance Representation

  • Improved instance handling: instances now display their stringify method if defined; otherwise, they default to showing the object representation.

Compiler and Lexer Enhancements

  • Enhanced compiler performance for faster stringification of values and function calls.
  • Improved multi-line comment handling: the lexer now ignores any */ sequences without a valid start delimiter. Once a proper delimiter is detected, it behaves as expected.

Archetype Refactoring

Memory Optimization

  • Refactored archetypes to better optimize memory usage.
    • Unique archetypes (uniquearche) are created only when accessed.
    • Global archetypes (archetype) are optimized for shared functionality.

Enhanced Functionality

  • View Archetypes:

    • Use the identity unary operator or the __arche__ property to inspect a value's archetype.
      println(identity "Matrix");  // Outputs the value's identity, including archetype details.
      println("Matrix".__arche__); // Outputs the string archetype object.
      
  • Custom Archetypes:

    • Define custom methods for built-in or user-defined types.
      string.archetype.reverse = () -> {
          return this.split('').reverse().join('');
      };
      
      number.archetype.double = () -> {
          return this * 2;
      };
      
      println("Hyper".reverse()); // Output: repyH
      println((5).double());      // Output: 10
      

New Features

Improved Imports

  • Added support for importing native modules and aliasing them with as. Examples:
    import os as OS
    import "file.hm" as file
    import {newFile, delFile} as file from "file.hm"
    import * as file from "file.hm"
    

New printf Function

  • Introduced the printf(string, ...args) function for formatted output.

Thank you for supporting HyperMatrix! Your feedback drives our progress, and we’re excited to see how you use this release.