Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda support in VM: Wolfgang's PR plus some simplifications (removing mask, clarifying ops) #15387

Open
wants to merge 3 commits into
base: 11-21-lambda-compiler-completion
Choose a base branch
from

Commits on Nov 27, 2024

  1. Verbatim cherry-pick of Wolfgang's draft PR 15171 = commit #d85b919

    [move-vm] Types and opcodes for closures
    
    This PR implements the extensions needed in the file format for representing closures:
    
    - The type (SignatureToken) has a new variant `Function(args, result, abilities)` to represent a function type
    - The opcodes are extendeed by operations `ClosPack`, `ClosPackGeneric`, and `ClosEval`
    
    This supports bit masks for specifyinng which arguments of a function are captured when creating a closure.
    
    Bytecode verification is extended to support the new types and opcodes. The implementation of consistency, type, and reference safety should be complete. What is missing are:
    
    - File format serialization
    - Interpreter and value representation
    - Value serialization
    - Connection of the new types with the various other type representations
    wrwg authored and brmataptos committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    c7cd374 View commit details
    Browse the repository at this point in the history
  2. Rename and rephrase Wolfgang's closure operations to match ongoing pa…

    …rser work:
    
    - `LdFunction`, `LdFunctionGeneric` = generate a closure from a defined function
    - `EarlyBind` = bind more arguments to any closure
    - `Invoke` = call a closure with final arguments
    Add some description/semantics to `file_format.rs` to better describe
    the implementation which will be needed.
    
    Get rid of complex Mask calculations in favor of simpler early bninding of
    `k` initial arguments.
    
    Hopefully keep all bytecode verifier operations working the same.
    brmataptos committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    8a6e7c5 View commit details
    Browse the repository at this point in the history
  3. rename EarlyBind and Invoke operations to EarlyBindFunction and Invok…

    …eFunction based on George's suggestion
    brmataptos committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    f49f228 View commit details
    Browse the repository at this point in the history