luau/rfcs
Petri Häkkinen 0d6aacf407
RFC: Floor division operator (#832)
[Rendered](https://github.com/petrihakkinen/luau/blob/rfc-floor-division/rfcs/syntax-floor-division-operator.md)
2023-03-20 15:12:48 -07:00
..
README.md Spell out RFC considerations for library functions more explicitly (#603) 2022-07-19 08:37:56 -07:00
STATUS.md Update STATUS.md 2023-02-14 12:25:58 -08:00
TEMPLATE.md Update TEMPLATE.md 2021-05-06 19:29:16 -07:00
behavior-eq-metamethod.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
change-global-version.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
config-luaurc.md Mark RFCs that were implemented as such. 2021-11-03 21:35:25 -07:00
deprecate-getfenv-setfenv.md RFC: Deprecate getfenv/setfenv (#51) 2021-06-24 23:02:57 -07:00
deprecate-table-getn-foreach.md Correct table.getn/foreach deprecation RFC (#848) 2023-02-27 12:30:33 -08:00
disallow-proposals-leading-to-ambiguity-in-grammar.md RFC: Disallow `name T` and `name(T)` in future syntactic extensions for type annotations (#589) 2022-07-28 14:48:17 -07:00
function-bit32-countlz-countrz.md Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
function-coroutine-close.md Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
function-debug-info.md Spelling (#119) 2021-11-04 09:50:46 -05:00
function-string-pack-unpack.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
function-table-clear.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
function-table-clone.md Mark table.clone as implemented 2022-03-24 09:29:20 -07:00
function-table-create-find.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
function-table-freeze.md Spelling (#119) 2021-11-04 09:50:46 -05:00
generalized-iteration.md Update generalized-iteration.md (#640) 2022-08-17 10:02:08 -07:00
generic-function-subtyping.md RFC: Expanded Subtyping for Generic Function Types (#641) 2022-09-19 13:42:20 -07:00
generic-functions.md Add turbofish discussion to generic function RFC (#300) 2022-01-07 11:07:36 -08:00
len-metamethod-rawlen.md Mark __len RFC as implemented 2022-08-03 15:38:45 -07:00
lower-bounds-calculation.md Update lower-bounds-calculation.md 2023-02-14 12:23:54 -08:00
never-and-unknown-types.md Mark never/unknown types RFC as implemented 2022-08-03 15:40:24 -07:00
property-readonly.md RFC: Read-only properties (#77) 2021-10-11 09:58:01 -05:00
property-writeonly.md RFC: Write-only properties (#79) 2021-10-27 11:42:17 -07:00
recursive-type-restriction.md Mark RFCs that were implemented as such. 2021-11-03 21:35:25 -07:00
sealed-table-subtyping.md Mark sealed table subtyping RFC as implemented 2022-03-24 13:10:30 -07:00
syntax-array-like-table-types.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
syntax-compound-assignment.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
syntax-continue-statement.md Spelling (#119) 2021-11-04 09:50:46 -05:00
syntax-default-type-alias-type-parameters.md Mark default type parameters RFC as implemented (#369) 2022-02-17 16:14:35 -08:00
syntax-floor-division-operator.md RFC: Floor division operator (#832) 2023-03-20 15:12:48 -07:00
syntax-if-expression.md Fold in rationale for making `else` branch mandatory in if-then-else expressions. (#426) 2022-03-23 16:53:52 -07:00
syntax-named-function-type-args.md Mark 'Named Function Type Arguments' status as implemented (#41) 2021-05-31 21:07:37 +03:00
syntax-number-literals.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
syntax-singleton-types.md Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
syntax-string-interpolation.md RFC: Prohibit use of interpolated strings in function calls without parentheses (#648) 2022-08-25 14:54:02 -07:00
syntax-type-alias-type-packs.md Mark 'Type alias type packs' RFC as implemented (#237) 2021-11-23 10:03:20 -08:00
syntax-type-ascription-bidi.md Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
syntax-type-ascription.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
syntax-typed-variadics.md Add RFC status fields (#39) 2021-05-17 18:19:49 -07:00
type-error-suppression.md Add RFC for type error suppression (#835) 2023-03-13 19:33:27 -05:00
unsealed-table-assign-optional-property.md Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
unsealed-table-literals.md Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
unsealed-table-subtyping-strips-optional-properties.md Mark last table subtyping RFC as implemented 2022-05-12 10:08:10 -07:00

README.md

Background

Whenever Luau language changes its syntax or semantics (including behavior of builtin libraries), we need to consider many implications of the changes.

Whenever new syntax is introduced, we need to ask:

  • Is it backwards compatible?
  • Is it easy for machines and humans to parse?
  • Does it create grammar ambiguities for current and future syntax?
  • Is it stylistically coherent with the rest of the language?
  • Does it present challenges with editor integration like autocomplete?

For changes in semantics, we should be asking:

  • Is behavior easy to understand and non-surprising?
  • Can it be implemented performantly today?
  • Can it be sandboxed assuming malicious usage?
  • Is it compatible with type checking and other forms of static analysis?

For new standard library functions, we should be asking:

  • Is the new functionality used/useful often enough in existing code?
  • Does the standard library implementation carry important performance benefits that can't be achieved in user code?
  • Is the behavior general and unambiguous, as opposed to solving a problem / providing an interface that's too specific?
  • Is the function interface amenable to type checking / linting?

In addition to these questions, we also need to consider that every addition carries a cost, and too many features will result in a language that is harder to learn, harder to implement and ensure consistent implementation quality throughout, slower, etc. In addition, any language is greater than the sum of its parts and features often have non-intuitive interactions with each other.

Since reversing these decisions is incredibly costly and can be impossible due to backwards compatibility implications, all user facing changes to Luau language and core libraries must go through an RFC process.

Process

To open an RFC, a Pull Request must be opened which creates a new Markdown file in rfcs/ folder. The RFCs should follow the template rfcs/TEMPLATE.md, and should have a file name that is a short human readable description of the feature (using lowercase alphanumeric characters and dashes only). Try using the general area of the RFC as a prefix, e.g. syntax-generic-functions.md or function-debug-info.md.

Please make sure to add rfc label to PRs before creating them! This makes sure that our automatic notifications work correctly.

Every open RFC will be open for at least two calendar weeks. This is to make sure that there is sufficient time to review the proposal and raise concerns or suggest improvements. The discussion points should be reflected on the PR comments; when discussion happens outside of the comment stream, the points salient to the RFC should be summarized as a followup.

When the initial comment period expires, the RFC can be merged if there's consensus that the change is important and that the details of the syntax/semantics presented are workable. The decision to merge the RFC is made by the Luau team.

When revisions on the RFC text that affect syntax/semantics are suggested, they need to be incorporated before a RFC is merged; a merged RFC represents a maximally accurate version of the language change that is going to be implemented.

In some cases RFCs may contain conditional compatibility clauses. E.g. there are cases where a change is potentially not backwards compatible, but is believed to be substantially beneficial that it can be implemented if, in practice, the backwards compatibility implications are minimal. As a strawman example, if we wanted to introduce a non-context-specific keyword globallycoherent, we would be able to do so if our analysis of Luau code (based on the Roblox platform at the moment) informs us that no script in existence uses this keyword. In cases like this an RFC may need to be revised after the initial implementation attempt based on the data that we gather.

In general, RFCs can also be updated after merging to make the language of the RFC more clear, but should not change their meaning. When a new feature is built on top of an existing feature that has an RFC, a new RFC should be created instead of editing an existing RFC.

When there's no consensus that the feature is broadly beneficial and can be implemented, an RFC will be closed. The decision to close the RFC is made by the Luau team.

Note that in some cases an RFC may be closed because we don't have sufficient data or believe that at this point in time, the stars do not line up sufficiently for this change to be worthwhile, but this doesn't mean that it may never be considered again; an RFC PR may be reopened if new data is available since the original discussion, or if the PR has changed substantially to address the core problems raised in the prior round.

Implementation

When an RFC gets merged, the feature can be implemented; however, there's no set timeline for that implementation. In some cases implementation may land in a matter of days after an RFC is merged, in some it may take months.

To avoid having permanently stale RFCs, in rare cases Luau team can remove a previously merged RFC when the landscape is believed to change enough for a feature like this to warrant further discussion.

When an RFC is implemented and the implementation is enabled via feature flags, RFC should be updated to include "Status: Implemented" at the top level (before Summary section).