Commit Graph

86 Commits

Author SHA1 Message Date
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
Alan Jeffrey 9311c0c57a
Add RFC for type error suppression (#835)
This formalizes our strategy for suppressing type errors, and fixes the
weirdness of `any` being both a top and bottom type.
2023-03-13 19:33:27 -05:00
Arseny Kapoulkine 6601c41bff
Correct table.getn/foreach deprecation RFC (#848)
It looks like all three functions actually have been deprecated in Lua
5.1, and removed in Lua 5.2.

We do not plan to remove them to retain backwards compatibility, but the
RFC should be more precise.
2023-02-27 12:30:33 -08:00
Arseny Kapoulkine 2e5f95ca58
Update STATUS.md 2023-02-14 12:25:58 -08:00
Arseny Kapoulkine 8f37fc6dfc
RFC: Deprecate table.getn/foreach/foreachi (#715)
[Rendered](https://github.com/Roblox/luau/blob/zeux-rfc-deptable/rfcs/deprecate-table-getn-foreach.md)
2023-02-14 12:25:12 -08:00
Arseny Kapoulkine 742702a17d
Update lower-bounds-calculation.md
This RFC is abandoned; for posterity we will keep this in the tree for now, as it's likely that it represents a subset of the future set of LTI rules
2023-02-14 12:23:54 -08:00
Aaron Weiss bdf7d8c185
RFC: Expanded Subtyping for Generic Function Types (#641)
[Rendered](https://github.com/aatxe/luau/blob/generic-function-subtyping/rfcs/generic-function-subtyping.md)
2022-09-19 13:42:20 -07:00
Arseny Kapoulkine e84bccc5c0
RFC: Prohibit use of interpolated strings in function calls without parentheses (#648)
We've had this restriction in the original RFC, but decided to remove it afterwards. This change puts the restriction back - we need to work through some implications of future support for string-based DSLs together with interpolated strings which may or may not change the behavior here, for example to allow something like

```
local fragment = xml `
  <img src="{self.url}" />
`
```
2022-08-25 14:54:02 -07:00
Alexander McCord 0ce4c45436
RFC: Explicitly support escape sequence in string interpolation literals (#642)
This was implicitly assumed to be supported, but we should really just say so explicitly. If we didn't, there'd be two ways to interpret it: string interpolations are raw strings and escape sequences don't exist for the most part (false), or string interpolations are like strings and escape sequences do exist (true).

Also talks about the ambiguity with `\u{` and that it is defined to take priority and does not terminate the interpolation chunk and starts a new expression, instead it must be a well-formed escape sequence `\u{...}`. It is very unlikely there'd be another escape sequence that also has this same ambiguity problem, so we don't need to worry about this.
2022-08-23 12:03:53 -07:00
Arseny Kapoulkine 0e118b54bb
Update generalized-iteration.md (#640)
Use a more precise pseudocode snippet for __iter handling which matches runtime semantics
2022-08-17 10:02:08 -07:00
Arseny Kapoulkine 2c12badb5c
Update RFC status page 2022-08-03 15:40:57 -07:00
Arseny Kapoulkine 4692c55687
Mark never/unknown types RFC as implemented 2022-08-03 15:40:24 -07:00
Arseny Kapoulkine b39fcc7e77
Mark __len RFC as implemented 2022-08-03 15:38:45 -07:00
Alexander McCord cb16555608
RFC: Disallow `name T` and `name(T)` in future syntactic extensions for type annotations (#589) 2022-07-28 14:48:17 -07:00
Alexander McCord 185370fa1d
RFC: Update the rules on string interpolation in light of feedback (#615)
We make four adjustments in this RFC:

1. `{{` is not allowed. This is likely a valid but poor attempt at escaping coming from C#, Rust, or Python.
2. We now allow `` `this` `` with zero interpolating expressions.
3. We now allow `` f `this` `` also.
4. Explicitly say that `` `this` `` and `` `this {that}` `` are not valid type annotation syntax.
2022-07-28 14:48:05 -07:00
Arseny Kapoulkine ea7a6c1260
Spell out RFC considerations for library functions more explicitly (#603)
When considering new standard library functions, we essentially need to strongly justify their existence over their implementation in Luau in user library code.

This PR attempts to provide a few axes of consideration; ideally new library functions tick many of the boxes, eg "used often + is more performant + clear unambiguous interface" is an ideal consideration for a library function, whereas if it's merely accelerating a single specific use case for a single application it's unlikely to be a good justification for inclusion.
2022-07-19 08:37:56 -07:00
Arseny Kapoulkine c29b803046
Update STATUS.md
Add __len metamethod
2022-06-28 09:08:12 -07:00
Arseny Kapoulkine fd82e92628
RFC: Support `__len` metamethod for tables and `rawlen` function (#536) 2022-06-28 09:06:59 -07:00
Arseny Kapoulkine 348ad4d417
Update STATUS.md
Add never and unknown types
2022-06-22 12:54:48 -07:00
Arseny Kapoulkine 1757234f01
Rename none-and-unknown-types.md to never-and-unknown-types.md
This makes the type names match.
2022-06-22 11:16:38 -07:00
Alan Jeffrey 778e62c8f7
RFC: never and unknown types (#434)
Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com>
2022-06-22 11:15:41 -07:00
Arseny Kapoulkine ca5fbbfc24
Mark generalized iteration RFC as implemented 2022-06-09 10:18:29 -07:00
Arseny Kapoulkine bcab792e0d
Update STATUS.md
Generalized iteration got implemented, safe indexing got dropped.
2022-06-09 10:18:03 -07:00
Arseny Kapoulkine b8ef743721
RFC: Do not implement safe navigation operator (#501)
This meta-RFC proposes removing the previously accepted RFC on safe navigation operator. This is probably going to be disappointing but is the best course of action that reflects our ideals in language evolution.

See PR thread for rationale and discussion.
2022-06-09 10:03:37 -07:00
Arseny Kapoulkine 87fe15ac51
Update STATUS.md
Mark last table subtyping RFC as implemented
2022-05-12 10:08:36 -07:00
Arseny Kapoulkine a775e6dc8e
Mark last table subtyping RFC as implemented 2022-05-12 10:08:10 -07:00
Arseny Kapoulkine 105e74c7d9
Update STATUS.md
Both generalized iteration and LBC are implemented but not fully enabled in Roblox yet.
2022-05-11 15:14:51 -07:00
Arseny Kapoulkine af64680a5e
Mark singleton types and unsealed table literals RFCs as implemented (#438) 2022-03-29 16:58:59 -07:00
Andy Friesen 75bccce3db
RFC: Lower Bounds Calculation (#388)
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-03-29 12:37:14 -07:00
Arseny Kapoulkine 5e7e462104
Update STATUS.md 2022-03-24 13:10:56 -07:00
Arseny Kapoulkine ab64a097cd
Mark sealed table subtyping RFC as implemented 2022-03-24 13:10:30 -07:00
Arseny Kapoulkine b8e025311b
Mark table.clone as implemented 2022-03-24 09:29:20 -07:00
Arseny Kapoulkine 5a21c41363
Update STATUS.md 2022-03-24 09:26:42 -07:00
Alexander McCord 7ab76e582c
RFC: Do not implement non-nil postfix `!` operator. (#420)
This is a meta-RFC. I'd like to propose to remove the postfix `!` operator from the language.

I'd like to argue that this operator will eventually become useless and can only be used incorrectly at some point in the future, and that there are likely ways for them to be sound without having to reach for the `!` hammer.

With that, I present these counterarguments:

Shortcoming <span>#</span>1: Refinements does not apply to the block after `return`/`break`/`continue`.

```lua
if not x or not y then return end
-- both x and y are truthy
```

This will be solved by implementing control flow analysis where it'd apply the inverse of the condition leading up to the control transfer statement to the rest of the scope.

Shortcoming <span>#</span>2: Type checker is not aware of the actual state of various locations.

```lua
type Foo = { x: { y: number }? }?
local foo: Foo = { x = { y = 5 } }
print(foo.x.y) -- prints 5 at runtime, type checker warns on this
```

This will be solved by implementing type states where it would inspect the initialization sites as well as assignments to know their actual states. That is, rather than trusting the type annotation `Foo` as the state which gets us far enough, we'd start seeing these type annotations as a subtype constraint for the location `foo`.

---

If there are other use cases not covered in this message, we should talk about that and see if there exists an alternative direction that can solve these use cases soundly.
2022-03-24 08:38:16 -07:00
Alexander McCord 2f15079642
Fold in rationale for making `else` branch mandatory in if-then-else expressions. (#426)
This has been discussed but just didn't get incorporated into the RFC.
2022-03-23 16:53:52 -07:00
Arseny Kapoulkine 898c0501d1
Update STATUS.md
Add table.clone
2022-02-28 14:16:35 -08:00
Arseny Kapoulkine 5e8242aeda
RFC: table.clone (#362) 2022-02-28 14:15:33 -08:00
Arseny Kapoulkine 3c42b3a013
Revert "Mark singleton types RFC as implemented (#370)" (#378)
This reverts commit 731e197757.
2022-02-19 10:57:29 -08:00
Alexander McCord 731e197757
Mark singleton types RFC as implemented (#370) 2022-02-17 16:16:31 -08:00
Arseny Kapoulkine e49a0fd4cd
Mark default type parameters RFC as implemented (#369) 2022-02-17 16:14:35 -08:00
Arseny Kapoulkine e541e19f44
Create RFC status tracking document (#363)
This tracks status of all unimplemented RFCs in one central place. Hopefully we won't forget to update this when new RFCs are added!
2022-02-15 18:37:02 -08:00
Arseny Kapoulkine 7d679b317f
RFC: Generalized iteration (#335)
Co-authored-by: dcope-rbx <91100513+dcope-rbx@users.noreply.github.com>
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-02-14 10:04:07 -08:00
Arseny Kapoulkine a23b467485
Add turbofish discussion to generic function RFC (#300) 2022-01-07 11:07:36 -08:00
Arseny Kapoulkine 287b46e6a7
Mark bidirectional ascription RFC as implemented (#305) 2022-01-07 11:07:22 -08:00
Arseny Kapoulkine b5e338325b
Mark coroutine.close RFC as implemented (#304) 2022-01-07 08:52:33 -08:00
Alan Jeffrey 82587bef29
RFC: Fix an unsoundness issue around stripping optional properties (#276)
* Fix an unsoundness issue around stripping optional properties

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2022-01-06 12:48:09 -06:00
boyned//Kampfkarren 5e7648947b
RFC: Safe navigation operator (#142)
Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com>
2021-12-20 15:38:15 -08:00
vegorov-rbx 71adace16e
RFC: Amend 'Default type alias type parameters' for type pack parameters (#238)
* Do not allow regular type assignment to a type pack as a default parameter

* With type pack support in type aliases, this second form with an empty list is now supported

* Update rfcs/syntax-default-type-alias-type-parameters.md

Co-authored-by: Alan Jeffrey <403333+asajeffrey@users.noreply.github.com>

* Update syntax-default-type-alias-type-parameters.md

Even more examples

Co-authored-by: Alan Jeffrey <403333+asajeffrey@users.noreply.github.com>
2021-12-08 04:21:47 -08:00
Arseny Kapoulkine 9488f2379d
Mark bit32.count* RFC as implemented 2021-12-03 11:10:41 -08:00
vegorov-rbx 6b2b179aa6
Mark 'Type alias type packs' RFC as implemented (#237) 2021-11-23 10:03:20 -08:00
Alexander McCord 6958716ccd
RFC: String interpolation (#165) 2021-11-22 14:59:38 -08:00
Arseny Kapoulkine 4265e58ad1
RFC: coroutine.close (#88) 2021-11-17 06:49:49 -08:00
Alan Jeffrey 59366ad7f8
Clarified parsing properties of tables in the presence of singleton types (#207) 2021-11-16 14:48:01 -06:00
Arseny Kapoulkine 70ffc8a01d
RFC: Do not allow method call on string literals (#145) 2021-11-12 06:54:00 -08:00
Arseny Kapoulkine fe1bf43b54
RFC: bit32.countlz/countrz (#89)
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-11-09 10:40:14 -08:00
Josh Soref 278e848cc2
Spelling (#119)
Fixed various spelling errors.

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-11-04 09:50:46 -05:00
Arseny Kapoulkine 1f0084daa3 Mark RFCs that were implemented as such. 2021-11-03 21:35:25 -07:00
Amber's Careware eed3c8c38f
Update config-luaurc.md (#104)
When running `luau-analyze` with a .luarc that has a "mode" key, it outputs the following:
> .luaurc: Unknown key mode
I'm assuming it was named "mode" at first and was re-named "languageMode" later on?
2021-11-03 13:15:51 -07:00
Arseny Kapoulkine 05a41d5d54
Remove team restriction from RFC process documentation
Fixes #98
2021-11-03 12:13:42 -07:00
vegorov-rbx 0fd38fd765
RFC: Type alias type packs (#83) 2021-10-27 11:53:45 -07:00
Alan Jeffrey 59c0492419
RFC: Write-only properties (#79)
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-10-27 11:42:17 -07:00
Alan Jeffrey 628d7d9fcd
RFC: Read-only properties (#77)
* Added rfcs/property-readonly.md

Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-10-11 09:58:01 -05:00
Arseny Kapoulkine d42dba9c95
RFC: Configure analysis via .luaurc (#47) 2021-10-07 22:41:56 -07:00
Arseny Kapoulkine c54a8c81f6
Update function-table-freeze.md
Fix typos and formatting
2021-10-07 17:51:08 -07:00
Alan Jeffrey f8fb1016dc
RFC: Unsealed table assignment creates an optional property (#73)
* Added rfcs/unsealed-table-assign-optional-property.md

Co-authored-by: Lily Brown <lily@lily.fyi>
2021-10-05 19:22:38 -05:00
Alan Jeffrey 43b803b267
RFC: Recursive type restriction (#68)
Co-authored-by: Alan Jeffrey <403333+asajeffrey@users.noreply.github.com>
Co-authored-by: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com>
2021-09-27 10:49:03 -07:00
Arseny Kapoulkine 08bdb5b202
Rename syntax-type-ascription-2.md to syntax-type-ascription-bidi.md 2021-09-23 11:18:02 -07:00
Arseny Kapoulkine 1788de56a0
Update syntax-if-expression.md
Add a note that only one expression is evaluated in `if-expr`.
2021-09-22 14:08:37 -07:00
Andy Friesen d35b2a65c9
RFC: Update type assertions to permit conversion between any two related types (#56)
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
2021-09-14 11:55:20 -07:00
vegorov-rbx 10a407226b
RFC: Default type alias type parameters (#61)
* RFC: Default type alias type parameters

* Update the motivating example to match actual motivating example

* Resolved review comments

* improved motivation for the feature and noted additional languages with this feature
* fixed terminology between 'argument' and 'parameter'
* brought back support for default type pack parameter values
* removed alternative syntax and described the decision between ':' and '=' in the design section
* fixed drawback text and provided an example

* Remove return type pack annotation from allowed type pack default values,type annotation syntax doesn't allow that to be stand-alone

* Generic type pack has to be referenced by generic type pack name (with ...)
2021-08-20 20:26:37 +03:00
Arseny Kapoulkine 7e71295c27
RFC: Deprecate getfenv/setfenv (#51) 2021-06-24 23:02:57 -07:00
vegorov-rbx 9a4487f3e9
RFC: nil-forgiving operator (#48)
Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com>
2021-06-23 12:58:00 -07:00
Arseny Kapoulkine e8a58ea42f
Update if-expr RFC with mid-block return interaction (#43)
We don't have mid-block return support yet and it's not clear if we will due to similar grammatical issues with this wrt function calls, but noting this for completeness (thanks @alexmccord for bringing this up)
2021-06-01 15:45:43 -07:00
vegorov-rbx 7ab5a3a2db
Mark 'Named Function Type Arguments' status as implemented (#41) 2021-05-31 21:07:37 +03:00
Lily Brown 43d606fad4
RFC: Sealed table subtyping (#38) 2021-05-31 10:39:09 -07:00
Alexander McCord cc399fa98d
RFC: Singleton types (#37)
Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
2021-05-28 09:13:44 -07:00
Arseny Kapoulkine d40107dc60
Add RFC status fields (#39)
It seems more consistent and unambiguous if we mark RFCs as being
implemented when the implementation lands instead of expecting to
cross-reference documentation. That also makes it easier for us to flag
stale RFCs.
2021-05-17 18:19:49 -07:00
Alexander McCord 8956c7448e
RFC: Allow method call on string literals (#34) 2021-05-17 16:41:55 -07:00
vegorov-rbx 0f1f6609b1
RFC: Named Function Type Arguments (#36)
Introduces syntax for optional names of function type arguments.
2021-05-13 09:02:51 -07:00
Alan Jeffrey 674846e7cf
Generic Functions RFC (#33)
* Added generic functions RFC

Co-authored-by: Tiffany Bennett <tiffany@tiffnix.com>
2021-05-12 10:48:10 -05:00
Arseny Kapoulkine 8091a330f5
Update TEMPLATE.md
Change the title to use expected Title case.
2021-05-06 19:29:16 -07:00
Arseny Kapoulkine fb67f5760c
Delete assert-return RFC
(this analysis should have been done before the RFC but the thought never crossed my mind)

There's 63K assertions in all luarocks repositories combined. Out of this, around ~600 assertions would be broken as a result of this change. This is ~1% which is pretty uncomfortable (I was hoping for a couple of odd unit tests) - as such this RFC is going to get closed. We will maintain the current behavior of assert and try to adapt type checker to be reasonably useful instead.

The common thread between all of these cases (many of them target custom APIs although some target core APIs like string.match) is that assert is used together with a function that either returns nil (for errors), or multiple arguments. Under these conditions multi-arg assert is useful.

A couple examples:

```
out_r, out_w = assert(unix.pipe())
local header, body = assert(data:match "(.-\r\n)\r\n(.*)")
local z85_secret_key, z85_public_key = assert(zmq.curve_keypair())
local _, r = assert(coroutine.resume(co, msg))
```
2021-05-04 22:15:14 -07:00
Arseny Kapoulkine 26be211e5d
Update README.md
Emphasize the rfc label even more.
2021-05-04 16:23:45 -07:00
Arseny Kapoulkine a6844a8247 Add emphasis to use of label. 2021-05-04 00:31:30 -07:00
Arseny Kapoulkine ba2138ce10
Add more accepted RFCs. (#32)
This finishes the set of fully baked/accepted RFCs; 3 more proposals have been accepted but not implemented yet and will be submitted separately as actual RFCs.
2021-05-04 00:13:57 -07:00
Arseny Kapoulkine e2176e35e1
Establish an RFC process (#29)
This is going to apply to language and core library changes and will supplant the internal Roblox API proposal process for Luau only.
2021-05-03 18:52:43 -07:00