Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions
url: https://github.com/luau-lang/luau/discussions
about: Please use GitHub Discussions if you have questions or need help.
url: https://discord.gg/3MJ37CFNWh
about: Please join the Luwu Discord server if you have questions or need help.
24 changes: 12 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
Thanks for deciding to contribute to Luau! These guidelines will try to help make the process painless and efficient.
Thanks for deciding to contribute to Luwu! These guidelines will help make the process painless and efficient.

## Questions

If you have a question regarding the language usage/implementation, please [use GitHub discussions](https://github.com/luau-lang/luau/discussions).
If you have a question about using or implementing the language, please join the [Luwu Discord server](https://discord.gg/3MJ37CFNWh).
Some questions just need answers, but it's nice to keep them for future reference in case other people want to know the same thing.
Some questions help improve the language, implementation or documentation by inspiring future changes.

## Documentation

A [separate site repository](https://github.com/luau-lang/site) hosts the language documentation, which is accessible on https://luau.org.
Changes to this documentation that improve clarity, fix grammatical issues, explain aspects that haven't been explained before and the like are warmly welcomed.
Luwu is based on Luau, so the [upstream Luau documentation](https://luau.org) remains a useful reference for compatible behavior. Luwu-specific proposals and changes are documented in the [extra RFCs folder](/rfcx/).
Changes that improve clarity, fix grammatical issues, or explain Luwu-specific behavior are warmly welcomed.

Please feel free to [create a pull request](https://help.github.com/articles/about-pull-requests/) to improve our documentation. Note that at this point the documentation is English-only.

## Bugs

If the language implementation doesn't compile on your system, compiles with warnings, doesn't seem to run correctly for your code or if anything else is amiss, please [open a GitHub issue](https://github.com/luau-lang/luau/issues/new).
If the language implementation doesn't compile on your system, compiles with warnings, doesn't seem to run correctly for your code or if anything else is amiss, please [open a GitHub issue](https://github.com/mluau/luwu/issues/new).
It helps if you note the Git revision issue happens in, the version of your compiler for compilation issues, and a reproduction case for runtime bugs.

Of course, feel free to [create a pull request](https://help.github.com/articles/about-pull-requests/) to fix the bug yourself.

## Features

If you're thinking of adding a new feature to the language, library, analysis tools, etc., please *don't* start by submitting a pull request.
The Luau team has internal priorities and a roadmap that may or may not align with specific features, so before starting to work on a feature, please submit an issue describing the missing feature that you'd like to add.
Discuss the idea in the `#features` channel on the [Luwu Discord server](https://discord.gg/3MJ37CFNWh) before starting implementation so the community can refine the proposal and identify potential conflicts.

For features that result in an observable change to the language's syntax or semantics, you'll need to [create an RFC](https://github.com/luau-lang/rfcs/blob/master/README.md) to make sure that the feature is needed and well-designed.
For features that result in an observable change to the language's syntax or semantics, create an RFC in the [extra RFCs folder](/rfcx/) using the provided [template](/rfcx/TEMPLATE.md). Follow the process in the [extra RFC guidelines](/rfcx/README.md), including the implementation, feature flag, and maintainer requirements.

Finally, please note that Luau tries to carry a minimal feature set. All features must be evaluated not just for the benefits that they provide, but also for the downsides/costs in terms of language simplicity, maintainability, cross-feature interaction, etc.
As such, feature requests may not be accepted even if a comprehensive RFC is written - don't expect Luau to gain a feature just because another programming language has it.
Luwu is willing to evolve independently from upstream Luau, but every feature must still be evaluated for language simplicity, maintainability, performance, and cross-feature interactions.
Feature requests may not be accepted even if a comprehensive RFC is written; the benefits need to justify the costs to the language and its community.
We generally apply a standard similar to the C\# team's famous [Minus 100 Points](https://learn.microsoft.com/en-us/archive/blogs/ericgu/minus-100-points).

## Code style

Contributions to this project are expected to follow the existing code style.
`.clang-format` file mostly defines syntactic styling rules (you can run `make format` to format the code accordingly).

As for naming conventions, most Luau components use `lowerCamelCase` for variables and functions, `UpperCamelCase` for types and enums, `kCamelCase` for global constants and `SCARY_CASE` for macros.
As for naming conventions, most Luwu components use `lowerCamelCase` for variables and functions, `UpperCamelCase` for types and enums, `kCamelCase` for global constants and `SCARY_CASE` for macros.

Within the VM component, the code style is different - we expect `lua_` or `luaX_` prefix for functions that are public or used across different VM files, camel case isn't used and macros are often using lowercase.

Expand All @@ -49,13 +49,13 @@ When making code changes please try to make sure they are covered by an existing

## Performance

One of the central features of Luau is performance; our runtime in particular is heavily optimized for high performance and low memory consumption, and code is generally carefully tuned to result in close-to-optimal assembly for x64 and AArch64 architectures. The analysis code is not optimized to the same level of detail, but performance is still very important to make sure that we can support interactive IDE features.
One of the central features of Luwu is performance; our runtime in particular is heavily optimized for high performance and low memory consumption, and code is generally carefully tuned to result in close-to-optimal assembly for x64 and AArch64 architectures. The analysis code is not optimized to the same level of detail, but performance is still very important to make sure that we can support interactive IDE features.

As such, it's important to make sure that the changes, including bug fixes, improve (or at least do not regress) performance. For the VM, this can be validated by running `bench/bench.py` on two binaries built in Release mode, before and after the changes. Note that our benchmark coverage is not complete, and in some cases, additional performance testing will be necessary to determine if the change can be merged.

## Feature flags

For large bug fixes or features that apply to the Luau components and not just the CLI tools, we may ask that you introduce a feature flag to gate your changes. The feature flags use `LUAU_FASTFLAG` macro family defined in `Luau/Common.h` and allow us to ensure that the change can be safely shipped, enabled, and rolled back on the Roblox platform when the change makes it into our production codebase. The tests run the code with flags in their default state and enabled state as well to ensure correctness.
For large bug fixes or features that apply to the Luwu components and not just the CLI tools, we may ask that you introduce a feature flag to gate your changes. The feature flags use the `LUAU_FASTFLAG` macro family defined in `Luau/Common.h` and allow changes to be enabled and rolled back safely. The tests run the code with flags in their default and enabled states to ensure correctness.

## Licensing

Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- LuauFatCClosure: @cheesycod
- LuauManagedReferences2: @cheesycod
- LuauFunctionUnusedRecursiveLinting, LuauBetterPackAndVariadicMismatchErrors, LuauIndexerModifierMismatchErrors, LuauPropertyModifierMismatchErrors: @MabMabMabMabMab (undercols) authored by @PhoenixWhitefire (merged from upstream)
- LuauBetterMissingPropertiesTypeError, LuauFunctionUnusedRecursiveLinting: @MabMabMabMabMab and @deviaze (authored by nnullcolumn, who is not an mluau/luau maintainer; merged from upstream)
- LuauBetterMissingPropertiesTypeError, LuauFunctionUnusedRecursiveLinting: @MabMabMabMabMab and @deviaze (authored by nnullcolumn, who is not an mluau/luwu maintainer; merged from upstream)

## Other

Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
Luau ![CI](https://github.com/mluau/luau/actions/workflows/build.yml/badge.svg) [![codecov](https://codecov.io/gh/mluau/luau/branch/master/graph/badge.svg)](https://codecov.io/gh/mluau/luau)
Luwu ![CI](https://github.com/mluau/luwu/actions/workflows/build.yml/badge.svg) [![codecov](https://codecov.io/gh/mluau/luwu/branch/master/graph/badge.svg)](https://codecov.io/gh/mluau/luwu)
====

Luau (lowercase u, /ˈlu.aʊ/) is a fast, small, safe, gradually typed embeddable scripting language derived from [Lua](https://lua.org).
Luwu is a fast, small, safe, gradually typed embeddable scripting language based on [Luau](https://luau.org).

This is a community fork of Luau intended to provide a more featureful, helpful, and community-driven experience for general purpose, open source development of the language.
Luwu is a community-led fork intended to provide a more featureful and helpful experience for general-purpose, open-source language development. It will evolve with features, syntax, and semantics that may not align with upstream Luau.

For more information about this fork, how to contribute, and help us name our new language based off of Luau (but different!), please join our discord server [hina & ferris](https://discord.gg/3MJ37CFNWh).
Luwu is backwards compatible with Luau up to and including version 0.730, with possible exceptions for `export local` and Luau's unreleased integer feature as those areas are improved in Luwu.

For more information about Luwu and how to contribute, please join our Discord server [hina & ferris](https://discord.gg/3MJ37CFNWh). Credit for the name goes to @Crazyblox!

For RFCs and changes to the language, please see the [RFCs folder](/rfcx/). To propose new features, discuss them in our `#features` channel on Discord.

# Usage

Luau is an embeddable programming language, but it also comes with two command-line tools by default, `luau` and `luau-analyze`.
Luwu is an embeddable programming language, but it also comes with two command-line tools by default, `luau` and `luau-analyze`.

`luau` is a command-line REPL and can also run input files. Note that REPL runs in a sandboxed environment and as such doesn't have access to the underlying file system except for ability to `require` modules.

`luau-analyze` is a command-line type checker and linter; given a set of input files, it produces errors/warnings according to the file configuration, which can be customized by using `--!` comments in the files or [`.luaurc`](https://rfcs.luau.org/config-luaurc) files. For details, please refer to our [type checking](https://luau.org/typecheck) and [linting](https://luau.org/lint) documentation. Our community maintains a language server frontend for `luau-analyze` called [luau-lsp](https://github.com/JohnnyMorganz/luau-lsp) for use with text editors.

# Installation

You can install and run Luau by downloading the compiled binaries from [a recent release](https://github.com/luau-lang/luau/releases); note that `luau` and `luau-analyze` binaries from the archives will need to be added to PATH or copied to a directory like `/usr/local/bin` on Linux/macOS.
You can install and run Luwu by downloading the compiled binaries from [a recent release](https://github.com/mluau/luwu/releases); note that `luau` and `luau-analyze` binaries from the archives will need to be added to PATH or copied to a directory like `/usr/local/bin` on Linux/macOS.

Alternatively, you can use one of the packaged distributions (note that these are not maintained by Luau development team):
Alternatively, upstream Luau is available from the packaged distributions below. These packages are not maintained by the Luwu development team and may not match Luwu's Luau 0.730 compatibility baseline:

- macOS: [Install Homebrew](https://docs.brew.sh/Installation) and run `brew install luau`
- Arch Linux: Luau has been added to the official Arch Linux packages repository under the extras repository (see [``luau``](https://archlinux.org/packages/extra/x86_64/luau/)), simply install using ``pacman``: ``pacman -Syu luau``
Expand All @@ -32,7 +34,7 @@ After installing, you will want to validate the installation was successful by r

## Building

On all platforms, you can use CMake to run the following commands to build Luau binaries from source:
On all platforms, you can use CMake to run the following commands to build Luwu binaries from source:

```sh
mkdir cmake && cd cmake
Expand All @@ -47,7 +49,7 @@ Alternatively, on Linux and macOS, you can also use `make`:
make config=release luau luau-analyze
```

To integrate Luau into your CMake application projects as a library, at the minimum, you'll need to depend on `Luau.Compiler` and `Luau.VM` projects. From there you need to create a new Luau state (using Lua 5.x API such as `lua_newstate`), compile source to bytecode and load it into the VM like this:
To integrate Luwu into your CMake application projects as a library, at the minimum, you'll need to depend on the `Luau.Compiler` and `Luau.VM` projects. From there you need to create a new state (using a Lua 5.x API such as `lua_newstate`), compile source to bytecode, and load it into the VM like this:

```cpp
// needs lua.h and luacode.h
Expand All @@ -60,24 +62,24 @@ if (result == 0)
return 1; /* return chunk main function */
```

For more details about the use of the host API, you currently need to consult [Lua 5.x API](https://www.lua.org/manual/5.1/manual.html#3). Luau closely tracks that API but has a few deviations, such as the need to compile source separately (which is important to be able to deploy VM without a compiler), and the lack of `__gc` support (use `lua_newuserdatadtor` instead).
For more details about the use of the host API, you currently need to consult the [Lua 5.x API](https://www.lua.org/manual/5.1/manual.html#3). Luwu inherits Luau's close alignment with that API, including a few deviations such as the need to compile source separately (which is important for deploying the VM without a compiler) and the lack of `__gc` support (use `lua_newuserdatadtor` instead).

To gain advantage of many performance improvements, it's highly recommended to use the `safeenv` feature, which sandboxes individual scripts' global tables from each other, and protects builtin libraries from monkey-patching. For this to work, you must call `luaL_sandbox` on the global state and `luaL_sandboxthread` for each new script's execution thread.

# Testing

Luau has an internal test suite; in CMake builds, it is split into two targets, `Luau.UnitTest` (for the bytecode compiler and type checker/linter tests) and `Luau.Conformance` (for the VM tests). The unit tests are written in C++, whereas the conformance tests are largely written in Luau (see `tests/conformance`).
Luwu has an internal test suite; in CMake builds, it is split into two targets, `Luau.UnitTest` (for the bytecode compiler and type checker/linter tests) and `Luau.Conformance` (for the VM tests). The unit tests are written in C++, whereas the conformance tests are largely written in Luwu (see `tests/conformance`).

Makefile builds combine both into a single target that can be run via `make test`.

# Dependencies

Luau uses C++ as its implementation language. The runtime requires C++11, while the compiler and analysis components require C++17. It should build without issues using Microsoft Visual Studio 2017 or later, or gcc-7 or clang-7 or later.
Luwu uses C++ as its implementation language. The runtime requires C++11, while the compiler and analysis components require C++17. It should build without issues using Microsoft Visual Studio 2017 or later, or gcc-7 or clang-7 or later.

Other than the STL/CRT, Luau library components don't have external dependencies. The test suite depends on the [doctest](https://github.com/onqtam/doctest) testing framework, and the REPL command-line depends on [isocline](https://github.com/daanx/isocline).
Other than the STL/CRT, Luwu library components don't have external dependencies. The test suite depends on the [doctest](https://github.com/onqtam/doctest) testing framework, and the REPL command-line depends on [isocline](https://github.com/daanx/isocline).

# License

Luau implementation is distributed under the terms of [MIT License](https://github.com/luau-lang/luau/blob/master/LICENSE.txt). It is based on the Lua 5.x implementation, also under the MIT License.
The Luwu implementation is distributed under the terms of the [MIT License](LICENSE.txt). It is based on [Luau](https://github.com/luau-lang/luau), which is based on the Lua 5.x implementation; both are also distributed under the MIT License.

When Luau is integrated into external projects, we ask that you honor the license agreement and include Luau attribution into the user-facing product documentation. Attribution making use of the [Luau logo](https://github.com/luau-lang/site/blob/master/logo.svg) is also encouraged when reasonable.
When Luwu is integrated into external projects, please honor the included license notices and preserve attribution to Luwu, Luau, and Lua.
8 changes: 4 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Security Guarantees

Luau provides a safe sandbox that scripts can not escape from, short of vulnerabilities in custom C functions exposed by the host. This includes the virtual machine, builtin libraries and native code generation facilities.
Luwu provides a safe sandbox that scripts can not escape from, short of vulnerabilities in custom C functions exposed by the host. This includes the virtual machine, builtin libraries and native code generation facilities.

Any source code can not result in memory safety errors or crashes during its compilation or execution. Violations of memory safety are considered vulnerabilities.

Note that Luau does not provide termination guarantees - some code may exhaust CPU or RAM resources on the system during compilation or execution.
Note that Luwu does not provide termination guarantees - some code may exhaust CPU or RAM resources on the system during compilation or execution.
Comment on lines +3 to +7

The runtime expects valid bytecode as an input. Feeding bytecode that was not produced by Luau compiler into the VM is not supported, and
The runtime expects valid bytecode as an input. Feeding bytecode that was not produced by the Luwu compiler into the VM is not supported, and
doesn't come with any security guarantees; make sure to sign and/or encrypt the bytecode when it crosses a network or file system boundary to avoid tampering.

# Reporting a Vulnerability

Please DM a language maintainer on [our Discord](https://discord.gg/3MJ37CFNWh) or email deviaze at `dev@deviaze.com` to report a security vulnerability in `mluau/luau`.
Please DM a language maintainer on [our Discord](https://discord.gg/3MJ37CFNWh) or email deviaze at `dev@deviaze.com` to report a security vulnerability in `mluau/luwu`.
Loading
Loading