diff --git a/docs/index.html b/docs/index.html index dd2c6960..748ffebc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,7 +9,7 @@
{% include logo.svg %}

Nelua Programming Language

-

Minimal, simple, efficient, statically typed, compiled, meta programmable, safe and extensible systems programming language with a Lua flavor.

+

Minimal, simple, efficient, statically typed, compiled, metaprogrammable, safe, and extensible systems programming language with a Lua flavor.

Overview Download @@ -27,11 +27,11 @@

Nelua Progra

What is Nelua?

Nelua is a systems programming language for performance sensitive applications, like real-time applications and game engines. -It has syntax and semantics similar to Lua, -but is designed to be able to work with optional garbage collection, type notations -and free from an interpreter. -It uses ahead of time compilation to compile to optimized native binaries, -is meta programmable at compile-time using Lua and is simple to use.

+Its syntax and semantics are similar to Lua, +but its garbage collection is optional, it provides optional type notations, +and it is free from an interpreter. +Nelua uses ahead-of-time compilation to generate optimized native binaries. +It is metaprogrammable at compile-time using Lua and it is simple and easy to use.

Read language overview
@@ -113,7 +113,7 @@

What is Nelua?

Statically typed

Nelua takes advantage of type notations to do type checks at compile time and - to generate efficient specialized code, most of the type notations are optional + to generate efficient specialized code. Most of the type notations are optional and the compiler can infer them at compile time.

@@ -126,7 +126,7 @@

What is Nelua?

Efficient

- Nelua should be efficient as C when programming with manual memory management + Nelua should be as efficient as C when programming with manual memory management, and more efficient than Lua when using the optional garbage collector.

@@ -141,9 +141,9 @@

What is Nelua?

Simple

- Nelua is simple and intuitive as Lua. Just some additions like - type notations, efficient data structures and meta programming - utilities are incremented over Lua but all those are optional. + Nelua is as simple and intuitive as Lua. Some additions like + type notations, efficient data structures, and metaprogramming + utilities are available, unlike Lua, but all of them are optional.

@@ -159,7 +159,7 @@

What is Nelua?

If you know how to code in Lua then you probably know - how to code in Nelua already because it tries to have the same syntax, semantics, features and APIs. + how to code in Nelua. It tries to have the same syntax, semantics, features, and APIs.

@@ -174,9 +174,9 @@

What is Nelua?

Compiled

- Nelua takes advantage of ahead of time compilation - using powerful optimized C compilers such as GCC or Clang thus generating very - efficient native code, it doesn't use an interpreter at runtime. + Nelua takes advantage of ahead-of-time compilation + using powerful, optimized C compilers such as GCC or Clang, and thus generates very + efficient native code. No interpreter is needed at runtime.

@@ -189,9 +189,9 @@

What is Nelua?

Minimal

- Nelua is provide mechanisms for implementing features, instead of providing a host of features directly in the language. + Nelua provides mechanisms for implementing features instead of providing a host of features directly in the language. For example, although Nelua is not an object-oriented language, - it does provide mechanisms for implementing classes and inheritance efficiently at compile time with meta programming. + it does provide mechanisms for implementing classes and inheritance efficiently at compile time via metaprogramming.

@@ -205,7 +205,7 @@

What is Nelua?

Safe

Nelua tries to be safe by default for the user by - minimizing undefined behavior, doing compile time checks and runtime checks. + minimizing undefined behavior and doing both compile-time checks and runtime checks.

@@ -218,7 +218,7 @@

What is Nelua?

Low level
-

Nelua has C like features to work at low level to allow micro optimizing parts +

Nelua has C-like low level features to allow micro-optimizing parts of the code when needed.

@@ -229,11 +229,12 @@

What is Nelua?

- Meta programmable + Metaprogrammable

- Nelua keeps its host features minimal and provides meta programming - mechanisms to bring new features, allowing the semantics to be extended in unconventional ways at compile time. For example Nelua allows to create generics, polymorphic functions and specialize code at compile time using Lua and using its concepts system. + Nelua keeps its host features minimal and provides metaprogramming + mechanisms, allowing the semantics to be extended in unconventional ways at compile time. + For example, Nelua allows you to create generics, polymorphic functions, and specialized code at compile time using Lua and using the concepts system.

@@ -248,9 +249,9 @@

What is Nelua?

Nelua's compiler is written in Lua and is completely modifiable on the fly via the preprocessor, - thus you can make unconventional techniques on the compiler - at compile time, allowing for example to manipulate the AST, extend the language - syntax, semantics or code generator. + thus you can change the behavior of the compiler + at compile time, allowing, for example, direct manipulation of the AST, + or even extensions to the language syntax, semantics, or the code generator.

@@ -259,9 +260,9 @@

What is Nelua?

Compiles to C

- Nelua compiles to C first then to native, thus you can read and debug the generated C code, - mix other C code without costs, create or use C libraries, use C tools and reuse the generated C code. - You can think of Nelua being a "better C" heavily inspired by Lua. + Nelua compiles to C first then to native code, thus you can read and debug the generated C code, + mix in other C code without costs, create or use C libraries, use C tools, and reuse the generated C code. + You can think of Nelua like a "better C" heavily inspired by Lua.

@@ -277,8 +278,8 @@

What is Nelua?

Run anywhere

- Nelua uses minimal dependencies - this means you can use it for any system that C is available, + Nelua has minimal dependencies. + This means you can use it for any system where C is available, including the web.

@@ -293,10 +294,9 @@

What is Nelua?

Optional GC

- Nelua uses a garbage collector by default but it's completely optional and - can be replaced by manual memory management to have predictable runtime performance - to use in real-time applications - such as game engines and operational systems. + Nelua uses a garbage collector by default, but it is completely optional and + can be replaced by manual memory management for predictable runtime performance + and for use in real-time applications, such as game engines and operational systems.

@@ -308,8 +308,8 @@

What is Nelua?

Self contained
-

Nelua doesn't use external dependencies, - its standard library is written in Nelua +

Nelua does not use external dependencies. + Its standard library is written in Nelua and you only need a C compiler to use it.

@@ -369,7 +369,7 @@

What is Nelua?

- Lua 5.4, LuaJIT 2.1, GCC 10.1 were used in the benchmarks. + Lua 5.4, LuaJIT 2.1, and GCC 10.1 were used in the benchmarks.

@@ -380,11 +380,11 @@

Benchmarks

- Nelua is very efficient, these are some benchmarks for equivalent code run in Nelua, Lua, LuaJIT and C. + Nelua is very efficient. These are some benchmarks for equivalent code run in Nelua, Lua, LuaJIT and C.

- * Nelua can match C performance when using optimized structures and doing manual memory management, - however to do justice with Lua in the comparisons the benchmarks were coded in the same style, i.e. - using the garbage collector and table like structures. + * Nelua can match C performance when using optimized structures and doing manual memory management. + However, to do justice to Lua in the comparisons, the benchmarks were coded in the same style, i.e. + using the garbage collector and table-like structures.

@@ -403,9 +403,9 @@

Installing

Use your terminal to install Nelua

-

Requires git, build tools and a C compiler. +

Requires git, build tools, and a C compiler. On Windows you should use MSYS2 with mingw-w64, - on Linux you can use GCC and + on Linux you can use GCC, and on MacOS you can use Clang.

Read installation docs @@ -431,9 +431,9 @@

Why Nelua?

-

Nelua is being created by a Lua lover who after years working with - Lua in game projects wished a Lua flavored, efficient, simple and powerful at compile time language - to replace C/C++ codes of game projects. If you have more questions +

Nelua is being developed by a Lua lover who, after years of using + Lua in game projects, wished for a Lua-flavored, efficient, simple language that was powerful at compile time + and could replace C/C++ code in game projects. For more information, read the frequently asked questions.

@@ -444,7 +444,7 @@

Learn more

-

Go to the documentation to learn more about what Nelua can do and how to use it.

+

Go to the documentation to learn more about Nelua's capabilites and how to use the language.

Read documentation
@@ -461,7 +461,7 @@

Nelua is currently under development and in alpha status, nevertheless there are projects already using it on GitHub, including games! - To know which features is planned to be implemented yet check the roadmap on GitHub. + To know which features are planned to be implemented, check the roadmap on GitHub. @@ -479,7 +479,7 @@

The Nelua compiler is open source and licensed under the MIT license, with most development taking place on GitHub. Be sure to watch the repository to get updates on Nelua's development - and star it to incentive the project.

+ and star it to show support for the project.

@@ -491,15 +491,15 @@

Support Nelua

-

If you like Nelua please consider contributing in some way, - the simplest would be giving a star on GitHub - or you could also try out Nelua and share your experience, +

If you like Nelua, consider contributing in some way! + The simplest way would be to give a star on GitHub. + You can also try out Nelua and share your experience, report bugs, - join the discord chat, + join the Discord server, spread it to the world, share something created with it, - make blog post about it - or make a donation.

+ make blog post about it, + or even make a donation.

diff --git a/docs/pages/documentation.md b/docs/pages/documentation.md index 9ab7dc8b..7e68936c 100644 --- a/docs/pages/documentation.md +++ b/docs/pages/documentation.md @@ -16,12 +16,12 @@ Read this page after installing the Nelua compiler. ### [Overview](/overview/) Overview of Nelua's features, -the **most interesting page** to learn about the syntax and all of the features. +the **most useful page** for learning about the syntax and features. ### [Manual](/manual/) -Technical specification of Nelua, this page is more technical -and thus can be dense to read. For a quick understanding of Nelua, first read the overview. +Technical specification of Nelua. This page is more technical +and dense to read. For a quick understanding of Nelua, first read the overview. ### [Libraries](/libraries/) @@ -34,4 +34,4 @@ Direct comparison between the standard libraries of Lua and Nelua. ### [FAQ](/faq/) Answers to frequently asked questions about Nelua. -Look on this page for answers to doubts, or try the search bar. \ No newline at end of file +Look on this page for answers to general questions you may have, or try the search bar. diff --git a/docs/pages/overview.md b/docs/pages/overview.md index f5df4f32..dfc08103 100644 --- a/docs/pages/overview.md +++ b/docs/pages/overview.md @@ -18,41 +18,41 @@ features not yet implemented see the [draft](/draft/). ## A note for Lua users Most of Nelua's syntax and semantics -are similar to Lua, thus, if you know Lua, you probably know Nelua as well. However, Nelua has many -additions, such as code with type notations, to make code more efficient and to allow metaprogramming. -This overview will try to focus on those features. +are similar to Lua, so if you know Lua, you probably know Nelua. However, Nelua has many +additions, such as type notations, to make code more efficient and to allow metaprogramming. +This overview will try to focus on those additions. -There is no interpreter or VM, all of the code is converted directly into native machine code, -so expect better efficiency than Lua. However, this means that Nelua **cannot load -code generated at runtime**, the user is encouraged to generate code at compile-time +There is no interpreter or VM, all of the code is converted directly into native machine code. +This means you can expect better efficiency than Lua. However, this also means that Nelua **cannot load +code generated at runtime**. The user is encouraged to generate code at compile-time using the preprocessor. Although copying Lua syntax and semantics with minor changes is a goal of Nelua, not all Lua -features are implemented yet. Most of the dynamic parts such as tables and handling dynamic types -at runtime are not implemented yet, so at the moment, using -records instead of tables and type notations in function definitions are recommended. +features are implemented yet. Most of the dynamic parts, such as tables and handling dynamic types +at runtime, are not implemented yet. So at the moment, using +records instead of tables and using type notations in function definitions are recommended. Visit [this](/diffs/) page for the full list of available features. {: .callout.callout-warning} ## A note for C users Nelua tries to expose most of C's features without overhead, so expect -to get near C performance when coding in the C style; that is, using -type notations, manual memory management, pointers and records (structs). +to get near-C performance when coding in the C style; that is, using +type notations, manual memory management, pointers, and records (structs). The semantics are not exactly the same as C semantics, but they are close. There are slight differences -to minimize undefined behaviors (like initializing to zero by default) and -others to maintain consistency with Lua semantics (like integer division rounding towards negative infinity). +(like initializing to zero by default) to minimize undefined behaviors and +other differences to maintain consistency with Lua semantics (like integer division rounding towards negative infinity). However, there are ways to use C semantics when needed. -The preprocessor is much more powerful than C's preprocessor, -because it is actually the compiler running in Lua, -so you can interact with the compiler during parsing. The preprocessor should -be used for making generic code, code specialization, and avoiding code duplication. +The preprocessor is much more powerful than C's preprocessor +because it is part of the compiler which runs in Lua. +This means you can interact with the compiler during parsing. The preprocessor should +be used for code specialization, making generic code, and avoiding code duplication. Nelua compiles everything into a single readable C file. If you know C, it is recommended that you read the generated C code -to learn more about what exactly the compiler outputs. +to learn more about exactly how the compiler works and what code it outputs. ## Hello world @@ -72,16 +72,16 @@ Comments are just like Lua: multi-line comment ]] --[=[ - multi line comment, `=` can be placed multiple times - in case if you have `[[` `]]` tokens inside, it will - always match it's corresponding token + multi line comment. `=` can be placed multiple times + in case you have `[[` `]]` tokens inside the comment. + it will always match its corresponding token ]=] ``` ## Variables -Variables are declared or defined like in Lua, but you may optionally -specify a type when declaring: +Variables are declared and defined like in Lua, but you may optionally +specify a type: ```nelua local a = nil -- of deduced type 'any', initialized to nil @@ -92,8 +92,8 @@ local pi: number = 3.14 -- of type 'number', initialized to 1 print(a,b,s,one,pi) -- outputs: nil false test 1 3.1400000 ``` -The compiler takes advantage of types for compile-time and runtime checks -and to generate **efficient code** for the **specific type used**. +The compiler takes advantage of types for compile-time and runtime checks, +as well as to generate **efficient code** to handle the **specific type used**. {:.alert.alert-info} ### Type deduction diff --git a/docs/pages/tutorial.md b/docs/pages/tutorial.md index e6c3daa9..7efbf091 100644 --- a/docs/pages/tutorial.md +++ b/docs/pages/tutorial.md @@ -8,22 +8,21 @@ order: 2 {% raw %} -This is a basic tutorial for the Nelua Programming Language, for running -your first application. +This is a basic tutorial for writing your first application in the Nelua language. {: .lead} -**Don't have Nelua installed yet?** Read the [installing tutorial](/installing/) first. +**Don't have Nelua installed yet?** Read the [installation tutorial](/installing/) first. {: .callout.callout-info} ## Your first program -You can code in Nelua much like you would code in Lua. For example, a hello world program is written much like in Lua: +You can code in Nelua much like you would code in Lua. For example, a hello world program is written much the same: ```nelua print 'Hello world' ``` -This example is already in the repository as an example. First clone the language repository +This example is already in the examples folder in the repository. First clone the language repository if you haven't yet: ```bash @@ -48,10 +47,10 @@ hello world Note that the compiler has generated a file called `helloworld.c`. This is your program translated to C source code. -If you know how to read C then I encourage you to open it and have a look. -The compiler tries to generate efficient, compact, and readable C sources. +If you know how to read C, I encourage you to open it and have a look. +The compiler tries to generate efficient, compact, and readable C code. -After the C source file is generated, GCC is invoked to compile the C sources, +After the C source file is generated, GCC is invoked to compile it, and then the program is executed. If your machine does not have GCC, you can use another C compiler with the flag `--cc`.