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

New timer functions with lambdas #2843

Closed
wants to merge 14 commits into from
Closed

New timer functions with lambdas #2843

wants to merge 14 commits into from

Commits on Nov 9, 2023

  1. Initial lambda implementation

    Vurv78 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    01103d8 View commit details
    Browse the repository at this point in the history
  2. Add ops on creation

    Vurv78 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    12cfb26 View commit details
    Browse the repository at this point in the history
  3. New implementation

    * Functions are now tables, containing parameter signature, return type and inner function
    * function:getParameterTypes()
    * function:getReturnType()
    * Don't reset global variables on `@strict`, fixing issue with top level locals not working as upvalues since they'd be reset by the runtime. I don't think this would actually affect anyone since you shouldn't be able to use variables before they're assigned, but it's `@strict` only behavior anyway.
    Vurv78 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    7e9913d View commit details
    Browse the repository at this point in the history
  4. Fix missing parity change

    I'd already fixed this bug with functions that have return values but this was not fixed for functions without return values. Also added a test case for this.
    Vurv78 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    641a8f2 View commit details
    Browse the repository at this point in the history
  5. More tests, enforce returns at compile time

    * Add tests to ensure variadic parameters, void parameters and implicit parameters aren't allowed
    
    * Fix lambdas potentially not returning at all codepaths like functions now are expected to do. Added a test for that.
    Vurv78 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    6aebc04 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2023

  1. Configuration menu
    Copy the full SHA
    631b801 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2023

  1. Configuration menu
    Copy the full SHA
    168a2a4 View commit details
    Browse the repository at this point in the history
  2. Add timers via callbacks

    Vurv78 committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    db32af2 View commit details
    Browse the repository at this point in the history
  3. Execute timer with chip entity, move ops

    * Ops will increase inside of the actual lambda's body instead of in ExprDynCall, which means it won't cost 0 ops to call them outside of an E2 chip.
    
    * Lambdas outside of E2 will now need to be called with ENT:Execute, which now optionally takes a "script" and "args" corresponding to what you'd pass to the lambda. It will handle perf and everything for you.
    
    * Remove Lambda:Call, UnsafeCall still exists in case someone wants to handle perf on their own in some extension.
    Vurv78 committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    342f156 View commit details
    Browse the repository at this point in the history
  4. Add timer(snf)

    Vurv78 committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    1a78d0d View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2024

  1. Configuration menu
    Copy the full SHA
    064fbaf View commit details
    Browse the repository at this point in the history
  2. Refactor, add per-chip limit

    * Fix error when chip quotas with timers active
    * Make getTimers nodiscard, change deprecation message
    * Optimize code to not create / remove timers needlessly
    * Auto-remove timer with reps properly
    Vurv78 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    274325d View commit details
    Browse the repository at this point in the history
  3. Decrease prf cost, clarify change

    15 ops to call lambda -> 10 ops
    Vurv78 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    8d31764 View commit details
    Browse the repository at this point in the history
  4. Remove outdated comment

    Vurv78 committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    0b2c88e View commit details
    Browse the repository at this point in the history