Skip to content

Releases: 6over3/hako

v1.0.4

07 Nov 04:53
7c6fc6a

Choose a tag to compare

Hako v1.0.4

.NET Packages

Install via NuGet:

dotnet add package Hako --version v1.0.4
dotnet add package Hako.Backend.Wasmtime --version v1.0.4

Packages Included

  • Hako - Core JavaScript engine
  • Hako.Backend - Backend abstraction
  • Hako.Backend.Wasmtime - wasmtime backend
  • Hako.Backend.WACS - WACS backend
  • Hako.Analyzers - Roslyn analyzers
  • Hako.SourceGenerator - Source generators for bindings

Checksums

See checksums.txt for SHA-256 checksums of all packages.

What's Changed

Full Changelog: v1.0.3...v1.0.4

v1.0.3

06 Nov 07:50

Choose a tag to compare

Hako v1.0.3

.NET Packages

Install via NuGet:

dotnet add package Hako --version v1.0.3
dotnet add package Hako.Backend.Wasmtime --version v1.0.3

Packages Included

  • Hako - Core JavaScript engine
  • Hako.Backend - Backend abstraction
  • Hako.Backend.Wasmtime - wasmtime backend
  • Hako.Backend.WACS - WACS backend
  • Hako.Analyzers - Roslyn analyzers
  • Hako.SourceGenerator - Source generators for bindings

Checksums

See checksums.txt for SHA-256 checksums of all packages.

Hako v1.0.2

15 Jul 13:01
084a089

Choose a tag to compare

Changelog

Binary JSON (BJSON) Improvements

  • Optimized BJSON Functions: Improved performance and memory usage for bjsonEncode() and bjsonDecode() operations
  • Direct Memory Access: BJSON functions now work with raw buffers for better efficiency instead of going through ArrayBuffer wrappers

Crypto API Support

  • crypto.getRandomValues(): Generate cryptographically strong random values for Uint8Array, Uint16Array, Uint32Array, and other typed arrays
  • crypto.randomUUID(): Generate RFC 4122 compliant UUID v4 strings
  • crypto.randomUUIDv7(): Generate UUID v7 with timestamp-based ordering
    • Supports custom timestamp parameter for deterministic generation
    • Maintains lexicographic sort order based on creation time

Enhanced Intrinsics

  • Crypto Intrinsic: New Crypto: true option in context intrinsics to enable the Crypto API

Improvements

Type System

  • Reduced Bundle Size: Replaced tree-shakable enums with constants to improve bundle size and loading performance
  • Cleaner Type Definitions: Simplified type definitions while maintaining full type safety

🐛 Bug Fixes

Module Evaluation

  • Fixed Module Evaluation: Reverted two-pass code evaluation that slowed down code
  • Promise Handling: Improved promise state handling in module evaluation to properly return module namespaces

Error Handling

  • Better Error Messages: Enhanced error reporting for BJSON operations and crypto functions
  • Exception Cleanup: Improved exception handling and memory cleanup in various scenarios

🔄 Breaking Changes

API Changes

  • BJSON Method Signatures: bjsonEncode() and bjsonDecode() now work with raw Uint8Array instead of ArrayBuffer
  • Enum to Constants: Some enums have been replaced with constants - existing code should continue to work but may need type updates

Hako v1.0.1

07 Jul 11:18
f7cf189

Choose a tag to compare

Changelog

Features

  • Binary Bytecode Evaluation: Implemented the ability to compile JavaScript source code into a portable bytecode format, which can then be evaluated. This works for both scripts and ES modules. It also includes automatic ES module detection during compilation and the option to load bytecode without immediate execution.
  • ECMAScript Module (ESM) Enhancements:
    • Added import.meta support, including import.meta.resolve() and properties like url, dir, file, and path.
    • Now supports import attributes (e.g., import json from './data.json' with { type: 'json' }), enabling loading of module types like JSON modules.
    • Improved module loading and resolution callbacks for better control over module import behavior.
  • Host Environment Module and Class Binding: Introduced a new interface allowing the WebAssembly host (which can be any language; "C module" is just an internal term for these bindings) to expose its own modules and classes directly to the JavaScript runtime.
    • Module Builder: Provides functions to define modules with explicit exports, host-backed functions, and private values, and to register them with the runtime.
    • Class Exports: Enables exporting JavaScript classes from the host, with support for custom constructors, instance methods, static methods, and finalizers for resource management.
    • Static Class Initializers: Added support for ES6 static class initialization blocks.
  • Optimized Type Checking: Implemented a spec-compliant integer mapping for optimized JavaScript type checking.
  • Error.isError() Method: Added the static isError() method to the global Error object for directly checking if a value is an Error instance.

Fixes and Improvements

  • Memory Management & Leak Fixes:
    • Resolved several memory leaks during runtime cleanup and function source handling.
    • Fixed issues with value type allocations for JavaScript values in the WebAssembly environment.
    • Improved WebAssembly instance memory import and management.
  • Optional Chaining: Enhanced optional chaining implementation for better stability.
  • Parsing: Corrected peek_token functionality and addressed identifier parsing edge cases.

Hako v1.0.0

24 Jun 13:29

Choose a tag to compare

Updated Changelog

🐛 Bug Fixes

JavaScript Engine Core

  • Fixed Array.from() and TypedArray.from() - Improved iterator handling and proper construction behavior
  • Fixed Array prototype operations - Corrected operation order in Object.prototype.propertyIsEnumerable()
  • Fixed constructor behavior - The %TypedArray% Intrinsic Object is now properly a constructor
  • Fixed string memory leak - Resolved memory leak in String constructor
  • Fixed generator function prototype - Corrected GeneratorFunction prototype setup
  • Fixed operation order - Corrected operation order in js_obj_to_desc()
  • Fixed detached buffer handling - Properly handle detached TypedArray in Atomics operations
  • Fixed Proxy checks - Improved checks in Proxy defineProperty operations
  • Fixed global variable deletion - Corrected the delete operator behavior with global variables
  • Fixed setter validation - Setters cannot have rest arguments
  • Fixed Proxy getOwnPropertyDescriptor - Better handling with getters and setters
  • Fixed prototype comparison - Corrected Proxy prototype comparison logic

Parsing & Compilation

  • Fixed destructuring parsing - Only perform destructuring in assignment expressions
  • Fixed function definition parsing - Improved parsing of function definitions
  • Fixed optional chaining - New keyword cannot be used with an optional chain

Memory & Performance

  • Fixed buffer overflow in BSON - Prevented overflow in String and BigInt reader
  • Fixed unsafe map iteration - Improved safety during map operations
  • Fixed string cache - Resolved string cache issues
  • Fixed memory usage tracking - Better memory accounting for various object types

TypedArrays & Binary Data

  • Fixed TypedArray byte offset reading - Read byteOffset even for detached buffers
  • Fixed TypedArray constructor behavior - Improved validation and construction
  • Fixed atomic operations - Better detached buffer handling in Atomics

Regular Expressions

  • Fixed RegExp Symbol.match - Corrected Regexp.prototype[Symbol.match] implementation

Error Handling

  • Fixed error constructor conversion - Resolved conversion errors in error constructors

⚡ Performance Optimizations

Parsing & Compilation

  • Optimized constructor parsing - Faster js_parse_class_default_ctor() implementation
  • Optimized array element access - Added get_array_el3 opcode, removed redundant to_propkey2 opcode
  • Optimized numeric index handling - Improved JS_AtomIsNumericIndex1() with NaN handling

Memory Management

  • Improved string operations - Better string handling and caching

✨ New Features

Web APIs

  • Performance API - Added complete Performance intrinsic with:
    • performance.now() - High-resolution timer using WASI monotonic clock
    • performance.timeOrigin - Time origin relative to Unix epoch
    • Proper WASI clock integration for precise timing

JavaScript Language Support

  • Float16Array support - Complete implementation of Float16 typed arrays including:
    • Float16Array constructor and methods
    • DataView Float16 support
    • Math.f16round() function
  • Promise.try - Added Promise.try() method for better promise handling
  • RegExp.escape - Added RegExp.escape() for safe string escaping in regular expressions

Array Methods

  • Added 'at' to unscopables - Array.prototype[Symbol.unscopables] now includes 'at'

Object Model

  • Immutable Object.prototype - Object.prototype now has an immutable prototype

🔧 Infrastructure & Build

WebAssembly/WASI

  • Disabled thread requirements - Removed threading dependencies for WASI compatibility
  • Updated build configuration - Disabled atomics and shared memory features
  • Fixed CI integration - Improved GitHub Actions configuration for patch script
  • Disabled shared memory - Removed shared memory requirements for better compatibility

Patch Management

  • Improved patch workflow - Patch script now commits changes automatically
  • Simplified patch naming - Streamlined patch file naming convention

TypeScript Embedder

  • Fixed async deadlock - Resolved deadlock in async synchronization operations
  • Improved promise handling - Better detection and handling of already-settled promises

🔄 Internal Changes

Code Organization

  • Improved error handling patterns - More consistent error handling across modules
  • Better type safety - Improved type checking and conversion functions
  • Enhanced debugging support - Better property inspection for debugger

Runtime Improvements

  • Optimized property operations - Faster property access and modification
  • Improved iterator handling - Better support for various iterator types
  • Enhanced proxy operations - More spec-compliant proxy behavior