mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-04-19 19:34:00 +01:00
user configurable timeout added
This commit is contained in:
parent
e1005b27a6
commit
39f80fbc6a
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ type Person = {
|
||||||
type ty = rawget<Person, "name"> -- ty = string
|
type ty = rawget<Person, "name"> -- ty = string
|
||||||
```
|
```
|
||||||
|
|
||||||
Type functions operate on two stages: type analysis and runtime. They are _called_ at the type level of Luau, but _runs_ at runtime to operate on the values of types (such as the arguments of the function). For this reason, type functions are declared using parenthesis and invoked using angle brackets. Moreover, every type functions will be part of and ran within the same scope (rlly? what if they are defined in a function) to allow type functions to call other type functions. We will not (and probably never) allow type functions to call regular functions for the sake of sandboxing runtime and analysis time.
|
Type functions operate on two stages: type analysis and runtime. They are _called_ at the type level of Luau, but _runs_ at runtime to operate on the values of types (such as the arguments of the function). For this reason, type functions are declared using parenthesis and invoked using angle brackets. Moreover, every type functions will be part of and ran within the same scope to allow type functions to call other type functions. We will not (and probably never) allow type functions to call regular functions for the sake of sandboxing the runtime and analysis time. There will also be a user-configurable timeout for type functions based on the number of instructions. For Roblox, this could be done by editing the config file for RCC and Studio and for non-Roblox users, this could be done by setting a flag when running the compiler.
|
||||||
|
|
||||||
To allow Luau developers to modify the runtime values of types in type functions, this RFC proposes introducing a new userdata called `lType`. An `lType` object is a runtime representation of all types within the program and provides a basic set of library methods that can be used to modify types. As such, under the hood, each argument of a type function is serialized into a userdata called `lType`. Moreover, they are *only accessible within type functions* and are *not a runtime type for other use cases than type functions*.
|
To allow Luau developers to modify the runtime values of types in type functions, this RFC proposes introducing a new userdata called `lType`. An `lType` object is a runtime representation of all types within the program and provides a basic set of library methods that can be used to modify types. As such, under the hood, each argument of a type function is serialized into a userdata called `lType`. Moreover, they are *only accessible within type functions* and are *not a runtime type for other use cases than type functions*.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue