Skip to content

Conversation

@Ze7111
Copy link
Collaborator

@Ze7111 Ze7111 commented Sep 1, 2025

Title: Compliance: migrate compiler-v0.0.1 to new standard

Description:
This PR merges new-standerd into compiler-v0.0.1, updating the compiler and core libraries to align with the latest Helix language standard.

Language Changes

  • Operator Declarations: switched to fn op...()[alias] syntax.

  • Requires Clauses: now written as fn <params> name() requires <bounds> (old syntax still supported).

  • Impl + Derives Shorthand:

    • Example: fn <T impl Eq> name() {}
    • Supports multiple parameters (currently up to 2).

Core Library Additions

  • Added std::process with Subprocess and ProcessOutput.
  • Added std::system for command execution.
  • Added std::print as an alias for print.
  • Added std::Stacktrace for runtime backtraces.
  • Added std::ABI::{mangle, demangle, mangle_partial} for symbol handling.

Runtime & Compiler Changes

  • Refactored parsing, error handling, and declaration handling to match the new syntax.

  • Improved mangling/demangling functions and code readability.

  • Added TypeBound refinements and support for where keyword.

  • Function declarations no longer require ? return type for panic cases:

    • Panics now default to a warning and throw at the panic location.

Misc Improvements

  • Enhanced build system with Helix integration and runtime support.
  • Refactored test suite (test.hlx) to comply with the new standard.
  • Added Helix backtrace support for better debugging.

Breaking Changes

  • Operator declarations:

    • Old: op <symbol> fn <name>(...) -> <ret> {}
    • New: fn op <symbol>(...)[<alias>] -> <ret> {}
  • Requires clause change is not breaking — both old and new syntax are supported.

Ze7111 and others added 24 commits July 27, 2025 15:33
- Introduced a new build.hlx file to define build targets and configurations.
- Created api.hlx to encapsulate the build API, including functions for setting targets, sources, includes, and build directories.
- Implemented runtime.hlx to manage the execution of the build process and handle compiler configurations.
- Enhanced vial.hlx to integrate the new build system, including functions for setting up the build environment, compiling sources, and linking artifacts.
- Added error handling for missing compilers and runtime files.
- Established a logging mechanism to track the build process and errors.
…constraints also change generic syntax to the new standard
- Updated CX_Class, CX_Extend, CX_Function, CX_Interface, CX_Operator, CX_Struct to unify handling of function and operator declarations.
- Changed references from OpDecl to FuncDecl where appropriate to streamline code and improve clarity.
- Added checks for operator functions to ensure they are processed correctly, including validation for missing names.
- Enhanced error handling for function declarations in interfaces and structs to enforce forward declaration rules.
- Adjusted code generation logic to accommodate the new structure of function and operator declarations.
@Ze7111 Ze7111 merged commit fa28c44 into compiler-v0.0.1 Sep 1, 2025
0 of 3 checks passed
@Ze7111 Ze7111 deleted the compliance/current-to-new-standard branch September 1, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants