diff --git a/docs/_config.yml b/docs/_config.yml index c2bc6acf..ad86c9c5 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -15,3 +15,5 @@ defaults: type: "pages" values: layout: "single" + sidebar: + nav: "pages" diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index a5becb95..55234617 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -1,16 +1,21 @@ main: - - title: "Why?" + - title: Home + url: / + - title: Getting Started + url: /getting-started + +pages: + - title: Getting Started + url: /getting-started + - title: Why Luau? url: /why - - title: "Syntax" + - title: Syntax url: /syntax - - title: "Terms of Use" - url: /limited-terms-of-use - - title: "Linting" + - title: Linting url: /lint - - title: "Performance" + - title: Performance url: /performance - - title: "Sandboxing" + - title: Sandboxing url: /sandbox - - title: "Typechecking" + - title: Typechecking url: /typecheck - \ No newline at end of file diff --git a/docs/_pages/getting-started.md b/docs/_pages/getting-started.md new file mode 100644 index 00000000..0252d786 --- /dev/null +++ b/docs/_pages/getting-started.md @@ -0,0 +1,5 @@ +--- +permalink: /getting-started +title: Getting Started +--- + diff --git a/docs/_pages/lint.md b/docs/_pages/lint.md index 69d60a51..1309b23c 100644 --- a/docs/_pages/lint.md +++ b/docs/_pages/lint.md @@ -1,9 +1,8 @@ --- permalink: /lint +title: Linting --- -# Linting - Luau comes with a set of linting passes, that help make sure that the code is correct and consistent. Unlike the type checker, that models the behavior of the code thoroughly and points toward type mismatches that are likely to result in runtime errors, the linter is more opinionated and produces warnings that can often be safely ignored, although it's recommended to keep the code clean of the warnings. Linter produces many different types of warnings; many of these are enabled by default, and can be suppressed by declaring `--!nolint NAME` at the top of the file. In dire situations `--!nolint` at the top of the file can be used to completely disable all warnings (note that the type checker is still active, and requires a separate `--!nocheck` declaration). diff --git a/docs/_pages/performance.md b/docs/_pages/performance.md index 58fab3af..7ac7b197 100644 --- a/docs/_pages/performance.md +++ b/docs/_pages/performance.md @@ -1,9 +1,8 @@ --- permalink: /performance +title: Performance --- -# Performance - One of main goals of Luau is to enable high performance code, with gameplay code being the main use case. This can be viewed as two separate goals: - Make idiomatic code that wasn't tuned faster diff --git a/docs/_pages/sandbox.md b/docs/_pages/sandbox.md index 9c78236b..9162540f 100644 --- a/docs/_pages/sandbox.md +++ b/docs/_pages/sandbox.md @@ -1,7 +1,7 @@ --- permalink: /sandbox +title: Sandboxing --- -# Sandboxing Luau is safe to embed. Broadly speaking, this means that even in the face of untrusted (and in Roblox case, actively malicious) code, the language and the standard library don't allow any unsafe access to the underlying system, and don't have any bugs that allow escaping out of the sandbox (e.g. to gain native code execution through ROP gadgets et al). Additionally, the VM provides extra features to implement isolation of privileged code from unprivileged code and protect one from the other; this is important if the embedding environment (Roblox) decides to expose some APIs that may not be safe to call from untrusted code, for example because they do provide controlled access to the underlying system or risk PII exposure through fingerprinting etc. diff --git a/docs/_pages/syntax.md b/docs/_pages/syntax.md index 5be450f0..6668e272 100644 --- a/docs/_pages/syntax.md +++ b/docs/_pages/syntax.md @@ -1,9 +1,8 @@ --- permalink: /syntax +title: Syntax --- -# Syntax - Luau uses the baseline [syntax of Lua 5.1](https://www.lua.org/manual/5.1/manual.html#2). For detailed documentation, please refer to the Lua manual, this is an example: ```lua diff --git a/docs/_pages/typecheck.md b/docs/_pages/typecheck.md index cca158ba..b5276c4e 100644 --- a/docs/_pages/typecheck.md +++ b/docs/_pages/typecheck.md @@ -1,7 +1,7 @@ --- permalink: /typecheck +title: Type checking --- -# Type checking Luau supports a gradual type system through the use of type annotations and type inference. diff --git a/docs/_pages/why.md b/docs/_pages/why.md index 25da418c..88eef56b 100644 --- a/docs/_pages/why.md +++ b/docs/_pages/why.md @@ -1,7 +1,7 @@ --- permalink: /why +title: Why Luau? --- -# Why Luau? Around 2006, [Roblox](https://www.roblox.com) started using Lua 5.1 as a scripting language for games. Over the years the runtime had to be tweaked to provide a safe, secure sandboxed environment; we gradually started accumulating small library changes and tweaks. diff --git a/docs/assets/images/luau.png b/docs/assets/images/luau.png new file mode 100644 index 00000000..a125b13b Binary files /dev/null and b/docs/assets/images/luau.png differ diff --git a/docs/index.md b/docs/index.md index 1667c8c8..7b7745c4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,54 +1,84 @@ --- -title: "Luau" +title: Lua*u* layout: splash permalink: / + header: - overlay_color: "#000" - overlay_filter: "0.5" - overlay_image: /assets/images/unsplash-image-1.jpg + overlay_color: #000 + overlay_filter: 0.8 + overlay_image: /assets/images/luau.png actions: - - label: "Download" - url: "https://github.com/mmistakes/minimal-mistakes/" -excerpt: "Luau (lowercase u, /ˈlu.aʊ/) is a fast, small, safe, gradually typed embeddable scripting language derived from Lua. It is used by Roblox game developers to write game code, as well as by Roblox engineers to implement large parts of the user-facing application code as well as portions of the editor (Roblox Studio) as plugins." -feature_row: - - image_path: - title: "Motivation" + - label: Learn More + url: /why + +excerpt: > + Lua*u* (lowercase *u*, /ˈlu.aʊ/) is a fast, small, safe, gradually typed embeddable scripting language derived from Lua. It is used by Roblox game developers to write game code, as well as by Roblox engineers to implement large parts of the user-facing application code as well as portions of the editor (Roblox Studio) as plugins. + +feature_row1: + - + title: Motivation excerpt: > - Around 2006, [Roblox](https://www.roblox.com) started using Lua 5.1 as a scripting language for games. Over the years we ended up substantially evolving the implementation and the language; to support growing sophistication of games on the Roblox platform, growing team sizes and large internal teams writing a lot of code for application/editor (1+MLOC as of 2020), we had to invest in performance, ease of use and language tooling, and introduce a gradual type system to the language. [This page](why) goes into more detail about the road that got us here. - - image_path: - title: "Sandboxing" + Around 2006, [Roblox](https://www.roblox.com) started using Lua 5.1 as a scripting language for games. Over the years we ended up substantially evolving the implementation and the language; to support growing sophistication of games on the Roblox platform, growing team sizes and large internal teams writing a lot of code for application/editor (1+MLOC as of 2020), we had to invest in performance, ease of use and language tooling, and introduce a gradual type system to the language. + url: /why + btn_label: Learn More + btn_class: "btn--primary" + + - + title: Sandboxing excerpt: > - Luau limits the set of standard libraries exposed to the users and implements extra sandboxing features to be able to run unprivileged code (written by our game developers) side by side with privileged code (written by us). This results in an execution environment that is different from what is commonplace in Lua. The sandboxing [is described here](sandbox). - - image_path: - title: "Compatibility" + Luau limits the set of standard libraries exposed to the users and implements extra sandboxing features to be able to run unprivileged code (written by our game developers) side by side with privileged code (written by us). This results in an execution environment that is different from what is commonplace in Lua. + url: /sandbox + btn_label: Learn More + btn_class: "btn--primary" + + - + title: Compatibility excerpt: > Whenever possible, Luau aims to be backwards-compatible with Lua 5.1 and at the same time to incorporate features from later revisions of Lua. However, Luau is not a full superset of later versions of Lua - we do not agree with some design decisions made by the Lua authors, and have different use cases and constraints. All post-5.1 Lua features, along with their support status in Luau, [are documented here](compatibility). + url: /compatibility + btn_label: Learn More + btn_class: "btn--primary" + feature_row2: - - image_path: /assets/images/example.png - title: "Syntax" + - + title: Syntax + image_path: /assets/images/example.png excerpt: > Luau is syntactically backwards-compatible with Lua 5.1 (code that is valid Lua 5.1 is also valid Luau); however, we have extended the language with a set of syntactical features that make the language more familiar and ergonomic. The syntax [is described here](syntax). - url: "/syntax" + url: /syntax + btn:label: Learn More + btn_class: "btn--primary" + feature_row3: - - image_path: - title: "Analysis" + - + title: Analysis excerpt: > - To make it easier to write correct code, Luau comes with a set of analysis tools that can surface common mistakes. These consist of a linter and a type checker, colloquially known as "script analysis", and can be used from [Roblox Studio](https://developer.roblox.com/en-us/articles/The-Script-Analysis-Tool) or using SECRET TOOL. The linting passes are [described here](lint), and the type checking user guide can [be found here](typecheck). - - image_path: - title: "Performance" + To make it easier to write correct code, Luau comes with a set of analysis tools that can surface common mistakes. These consist of a linter and a type checker, colloquially known as script analysis, and can be used from [Roblox Studio](https://developer.roblox.com/en-us/articles/The-Script-Analysis-Tool) or using SECRET TOOL. The linting passes are [described here](lint), and the type checking user guide can [be found here](typecheck). + url: /typecheck + btn_label: Learn More + btn_class: "btn--primary" + + - + title: Performance excerpt: > In addition to a completely custom front end that implements parsing, linting and type checking, Luau runtime features new bytecode, interpreter and compiler that are heavily tuned for performance. Luau currently does not implement Just-In-Time compilation, but its interpreter is often competitive with LuaJIT interpreter on a wide set of benchmarks. We continue to optimize the runtime and rewrite portions of it to be even more efficient, including plans for a new garbage collector and further library optimizations, as well as an eventual JIT/AOT option. While our overall goal is to minimize the amount of time programmers spend tuning performance, some details about the performance characteristics are [provided for inquisitive minds](performance). - - image_path: - title: "Libraries" + url: /performance + btn_label: Learn More + btn_class: "btn--primary" + + - + title: Libraries excerpt: > As a language, Luau is a full superset of Lua 5.1. As far as standard library is concerned, some functions had to be removed from the builtin libraries, and some functions had to be added. Additionally, Luau is currently only runnable from the context of the Roblox engine, which exposes a large API surface [documented on Roblox developer portal](https://developer.roblox.com/en-us/api-reference). --- -{% include feature_row id="intro" type="center" %} +{% include feature_row id="feature_row1" %} -{% include feature_row %} - -{% include feature_row id="feature_row2" type="right" %} +{% include feature_row id="feature_row2" type="left" %} {% include feature_row id="feature_row3" %} + +### Terms of Use + +See [here](limited-terms-of-use) for all of the important legal stuff.