mirror of
https://github.com/luau-lang/rfcs.git
synced 2025-05-04 10:43:48 +01:00
Improve motivation and fix markdownlint errors.
This commit is contained in:
parent
7746bba173
commit
fab08ab834
1 changed files with 5 additions and 5 deletions
|
@ -6,7 +6,7 @@ This RFC proposes a function-level `@native` attribute to request native compila
|
|||
|
||||
## Motivation
|
||||
|
||||
Luau's native compiler currently compiles whole scripts annotated with `--!native` comment directive. However, this provides very coarse-grained control. Since all functions in the script may not benefit from native compilation, developers might be forced to move unrelated functions together to natively compiled scripts. In this RFC, we propose a function-level `@native` attribute to facilitate developers to pick and choose individual functions for native compilation.
|
||||
Luau's native compiler currently compiles whole scripts annotated with `--!native` comment directive. The compiler imposes an upper limit on the memory consumed by the generated native code which makes it important to target native compilation for functions that will benefit from it the most. This might force creators to break their code organization and move unrelated functions together to scripts marked `--!native`. In this RFC, we propose a function-level `@native` attribute to facilitate developers to request native compilation for individual functions. In the future, we want Luau's native compiler to automatically pick functions for native compilation, making the `--!native` comment directive redundant. Since compiler heuristics can be suboptimal, the proposed `@native` attribute would still remain useful by providing creators with a way to force native compilation of functions that were not automatically chosen by the compiler but would benefit significantly from native execution.
|
||||
|
||||
## Design
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue