From 0ac237c5db3b253b6850c1112eaa4f11c60c994c Mon Sep 17 00:00:00 2001 From: Mr-Potato-l Date: Tue, 10 Feb 2026 14:20:42 +0200 Subject: [PATCH 1/6] Improved grammar in main uncategorized tabs. --- src/some-questions.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/some-questions.md b/src/some-questions.md index 7c73dcae..e1071195 100644 --- a/src/some-questions.md +++ b/src/some-questions.md @@ -148,7 +148,7 @@ Native backend may be an exception. Native backend can be added for supported pl Only time can give a definitive answer to this question. -### Why does not Jule have built-in methods? +### Why doesn't Jule have built-in methods? Jule has built-in functions for some critical operations, such as memory allocation, but not built-in methods because those are generally considered a bad design choice. Having methods for built-in types is vague and resembles functional programming, and Jule is not a functional language. @@ -181,7 +181,7 @@ In our opinion, adding function overloading will make the language more complex ### Will different memory management methods be added? -Not planned, but may be. +Not planned, but it is a possibility. Jule supports smart pointers, and they are suitable for many different memory management methods, such as Tracing GC or even ownership. @@ -276,12 +276,12 @@ In the future, a feature for assigning default values to structs may be reintrod >> > Initializing a structure by default should be a simple action. If you need a more complex initialization, you are encouraged to write a separate function for it. This way, the cost of the code that would otherwise be implicitly scattered throughout the codebase becomes more predictable. -### Why do not captured variables of closures need to be specified? +### Why don't captured variables of closures need to be specified? Because it is not simple. \ Compiler can handle it instead of developer. -### Why do not allow choose how to capture variables of closures? +### Why is choosing how to capture variables of closures not allowed? Because of safety. Jule doesn't have certain things to avoid adding too much responsibility to the runtime. One of these is to decide which variable in your runtime will be moved to the heap or not. @@ -307,11 +307,11 @@ fn main() { ``` In the above example, we know that the closure will live shorter than the scope and we want to capture by reference. A child scope is created, but this is not necessary. This is an improvement to prevent the reference variables we created for the variables we want to capture by reference from surviving in the rest of the scope. The `ri` variable is used to reference the `i` variable and is mutated with Unsafe Jule in the closure. In this way, the `i` variable is also affected. -### Why the function keyword needed for short function literals? +### Why is the function keyword needed for short function literals? When adding short literals to the language, the way to support readability as much as possible seemed to be clearly indicating that the literal is definitely a function. -### Why mutability is not handled automatically for parameters of short function literals? +### Why is mutability not handled automatically for parameters of short function literals? Due to Jule's immutable-by-default approach, this had to be the case. Developers should explicitly specify what needs to be mutable. However, this is not only a design choice based on principles, but also to preserve the flexibility provided to developers and to prevent unnecessary mutability. From 500ecd4c75d375770a3b61c57bd052f043abbd66 Mon Sep 17 00:00:00 2001 From: Mr-Potato-l Date: Tue, 10 Feb 2026 14:21:40 +0200 Subject: [PATCH 2/6] Improved grammar in the "Getting Started" section. --- src/getting-started/index.md | 2 +- .../installation/compiling-from-source/build-scripts.md | 2 +- .../installation/compiling-from-source/compile-from-ir.md | 6 +++--- .../installation/compiling-from-source/index.md | 2 +- .../compiling-from-source/manual-compilation.md | 6 +++--- src/getting-started/installation/packages.md | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/getting-started/index.md b/src/getting-started/index.md index f42a240e..2810ff42 100644 --- a/src/getting-started/index.md +++ b/src/getting-started/index.md @@ -1,2 +1,2 @@ # Getting Started -You are about to start Jule. Fasten the belts. Maybe a popcorn. +You are about to start Jule. Fasten the belts. Maybe some popcorn. diff --git a/src/getting-started/installation/compiling-from-source/build-scripts.md b/src/getting-started/installation/compiling-from-source/build-scripts.md index 1000f82b..84938a3d 100644 --- a/src/getting-started/installation/compiling-from-source/build-scripts.md +++ b/src/getting-started/installation/compiling-from-source/build-scripts.md @@ -8,7 +8,7 @@ These examples assume you are in the source code `(src/julec)` directory of the ::: ::: warning -The build scripts designed for developers. \ +The build scripts were designed for developers. \ Compiles julec with zero optimization. ::: diff --git a/src/getting-started/installation/compiling-from-source/compile-from-ir.md b/src/getting-started/installation/compiling-from-source/compile-from-ir.md index 27ca7b24..c1c6c96c 100644 --- a/src/getting-started/installation/compiling-from-source/compile-from-ir.md +++ b/src/getting-started/installation/compiling-from-source/compile-from-ir.md @@ -14,12 +14,12 @@ If this code does not allow you to get the latest julec build, you can get a lat ## How to Compile an IR -### Using Script +### Using a script A script has been designed to automate this. It automatically obtains the latest Jule@master source code, makes adjustments, selects the right IR distribution for your operating system and architecture, and creates an optimized ready-to-use julec build. ::: warning -Script will use Clang. +The script will use Clang. ::: @@ -32,7 +32,7 @@ bash <(curl -s https://raw.githubusercontent.com/julelang/julec-ir/main/compile- You need the Jule source codes to compile the IR code. IR codes have dependencies like some header files in API and standard library. Therefore, you must have obtained the Jule source code to compile the IR code. In most cases, it shouldn't be a problem for you to compile the most recent C++ headers in the main branch. However, for the most guaranteed experience, it is recommended to obtain the source tree of the commit where these IR codes were generated. The commit IR uses is mentioned above of repository. -The include directories of the IR codes are set to be in the root directory of the Jule source code of the IR code. So put your IR code inside the root directory of Jule source tree you got and build in that directory. If you want a different directory, you need to change the include directories of IR. +The include directories of the IR codes are set to be in the root directory of the Jule source code of the IR code. So put your IR code inside the root directory of the Jule source tree you got and build in that directory. If you want a different directory, you need to change the include directories of IR. Of course you need a C++ compiler to compile the IR code. At this point it is recommended to use one of the officially supported compilers. You can check [relevant manual page](/compiler/backend/) for more details. diff --git a/src/getting-started/installation/compiling-from-source/index.md b/src/getting-started/installation/compiling-from-source/index.md index 3052016a..8efda069 100644 --- a/src/getting-started/installation/compiling-from-source/index.md +++ b/src/getting-started/installation/compiling-from-source/index.md @@ -1,3 +1,3 @@ # Install from Source -This method refers to compiling julec from or from source code. This is a good way if you don't want to use release or want to get the latest development version. +This method refers to compiling julec from source code. This is a good way if you don't want to use release or want to get the latest development version. diff --git a/src/getting-started/installation/compiling-from-source/manual-compilation.md b/src/getting-started/installation/compiling-from-source/manual-compilation.md index 8cfe5140..07832fe6 100644 --- a/src/getting-started/installation/compiling-from-source/manual-compilation.md +++ b/src/getting-started/installation/compiling-from-source/manual-compilation.md @@ -2,8 +2,8 @@ julec is written in Jule! ::: warning -These example assume you are in the root directory of the julec. -This example also accepts you already have julec in global path. +These examples assume you are in the root directory of julec. +This example also assumes you already have julec in the global path variable. ::: ``` @@ -29,6 +29,6 @@ It is recommended to compile julec's C++ IR with ``O3`` to get the fastest and m #### Notice about `Ofast` Optimization Level -The `Ofast` optimization is quite an aggressive level and can break language standards. For example, it has been observed that a julec build with `Ofast` produces different numbers than expected due to probably math optimizations. +The `Ofast` optimization is quite an aggressive level and can break language standards. For example, it has been observed that a julec build with `Ofast` produces different numbers than expected, probably due to math optimizations. Therefore, we recommend using `O3` as the highest optimization level to get a more reliable build. diff --git a/src/getting-started/installation/packages.md b/src/getting-started/installation/packages.md index 28c65cc6..c64bfe42 100644 --- a/src/getting-started/installation/packages.md +++ b/src/getting-started/installation/packages.md @@ -16,5 +16,5 @@ If you see a maintainer with the `✔` mark, it means they are officially recogn | [sebaguardian](https://github.com/sebaguardian) | | Nixpkgs: `jule`, `julefmt`, `juledoc` | ::: warning -Still, keep in mind that these packages are not official packages. Jule maintainers do not accept any responsibility and does not ensure any update promises. For any issue, please contact the package maintainers. +Still, keep in mind that these packages are not official packages. Jule maintainers do not accept any responsibility and do not ensure any update promises. For any issue, please contact the package maintainers. ::: \ No newline at end of file From d56844de39207353a3108c44d99ac954d9ef3bcc Mon Sep 17 00:00:00 2001 From: Mr-Potato-l Date: Tue, 10 Feb 2026 15:39:53 +0200 Subject: [PATCH 3/6] Improved grammar in the "Project" section. --- src/project/code-style.md | 4 ++-- src/project/cycles.md | 2 +- src/project/declarations.md | 4 ++-- src/project/index.md | 2 +- src/project/project-structure.md | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/project/code-style.md b/src/project/code-style.md index 50fa7bfa..c3fc3a6a 100644 --- a/src/project/code-style.md +++ b/src/project/code-style.md @@ -9,13 +9,13 @@ These examples are the recommended style, not mandatory. Jule uses camelCase and PascalCase, with exceptions. -To choose between camelCase and PascalCase, the public modifier status must be observed. If your definition is exportable and you want it, use PascalCase, use camelCase. +To choose between camelCase and PascalCase, the public modifier status must be observed. If your definition is exportable and you want it, use camelCase. If there is no risk of your definition being exported, use PascalCase for constant variables. Use camelCase for local variables. ### Packages -Packages should use lowercase with no space. +Packages should use lowercase letters with no spaces. ## Indentions diff --git a/src/project/cycles.md b/src/project/cycles.md index 0d6ec2ee..62aec23d 100644 --- a/src/project/cycles.md +++ b/src/project/cycles.md @@ -21,4 +21,4 @@ struct A { a: A } ``` -In the example above, structure refers directly to itself. This is an illegal cycle. \ No newline at end of file +In the example above, a structure refers directly to itself. This is an illegal cycle. \ No newline at end of file diff --git a/src/project/declarations.md b/src/project/declarations.md index 5cee4131..daf5f974 100644 --- a/src/project/declarations.md +++ b/src/project/declarations.md @@ -1,5 +1,5 @@ # Declarations -Each unused statement is tried not to be included in the C++ output. This does not pose much of a problem with global declarations and should not be a hindrance to compilation. But you have to use the declarations you make in your code blocks; if you don't, the compiler will throw an error for each one. +Each unused statement is attempted to not be included in the C++ output. This does not pose much of a problem with global declarations and should not be a hindrance to compilation. But you have to use the declarations you make in your code blocks; if you don't, the compiler will throw an error for each one. For example: ```jule @@ -7,7 +7,7 @@ fn main() { let a: int = 0 } ``` -The variable `a` seen is declared but unused. This will cause you to get an error by the compiler and not be able to compile the code. +The variable `a` seen is declared but unused. This will cause you to get an error by the compiler and you will not be able to compile the code. ::: info Constant variables are not considered as "unused" in any case. diff --git a/src/project/index.md b/src/project/index.md index 4bdc6cda..f26f7093 100644 --- a/src/project/index.md +++ b/src/project/index.md @@ -1,2 +1,2 @@ # Project -In this chapter you understand the proposed project layout, their names and the purpose of the directories. Then you will be able to develop your projects by following this order. These are recommendations and are not obligatory to follow. \ No newline at end of file +In this chapter you will learn the proposed project layout, name and the purpose of the directories. Then you will be able to develop your projects by following this order. These are recommendations and are not obligatory to follow. \ No newline at end of file diff --git a/src/project/project-structure.md b/src/project/project-structure.md index 16017e47..82b0c8a8 100644 --- a/src/project/project-structure.md +++ b/src/project/project-structure.md @@ -2,15 +2,15 @@ Recommended work pattern and use of project directories for Jule: ::: info -This structure recommended for program developers, not library/package developers. Packages are uses different approach. See [3rd Party Packages](/packages/3rd-party-packages/) for more information. +This structure is recommended for program developers, not library/package developers. Packages should use a different approach. See [3rd Party Packages](/packages/3rd-party-packages/) for more information. ::: ## Source files -Nice names for source of your project: +Nice names for the source directory of your project: - `src` - `source` -The source directory is the directory where your project's source codes are located. It is recommended that you keep the source code of the language or languages you are using in this directory. If your project has more than one language, you can separate the languages in different directories in this directory. The same method can be applied if you have more than one program. +The source directory is the directory where your project's source code is located. It is recommended that you keep the source code of the language or languages you are using in this directory. If your project has more than one language, you can separate the languages in different directories in this directory. The same method can be applied if you have more than one program. You can place your source code files directly in this directory. But if there is more than one program source code from your project, you can create a new directory under this directory for each program. In addition, if you wish, you can store the source code in a directory specific to your program, even though it is your only program. @@ -21,10 +21,10 @@ Nice names for scripts of your project: It is very natural for you to write some scripts for your project. It's better to have these scripts in a directory rather than having them cluttered around. If your scripts are applied for different directories, you can create a sub-order by creating those directories inside the script directory. Or you can create a new script directory in the corresponding directory. -If you would prefer not to have your scripts in the `scripts` directory or something like that within the current directory, or if this is a more efficient approach, leave them in directory as is. +If you would prefer not to have your scripts in the `scripts` directory or a similar one within the current directory, or if this is a more efficient approach, leave them in the directory as is. ## Documentations -Nice names for documentations of your project: +Nice names for the documentation of your project: - `docs` - `documentation` - `documentations` From 78084dc8ccaeaba4e09bb8c58d1d6b7360bd8a54 Mon Sep 17 00:00:00 2001 From: Mr-Potato-l Date: Tue, 10 Feb 2026 15:56:45 +0200 Subject: [PATCH 4/6] Improved grammar in the "Runtime" section. --- src/runtime/index.md | 4 ++-- src/runtime/public-api.md | 6 +++--- src/runtime/runtime-api.md | 21 ++++++++------------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/runtime/index.md b/src/runtime/index.md index 885e5123..2c0c770d 100644 --- a/src/runtime/index.md +++ b/src/runtime/index.md @@ -1,7 +1,7 @@ # Runtime -Jule does not have a special runtime like virtual machine. However, every Jule program has a implicit use declaration for standard package that defines critical and important functions as well as some API functions by default. This package is the `std/runtime` package. +Jule does not have a special runtime like a virtual machine. However, every Jule program has an implicit use declaration for a standard package that defines critical and important functions as well as some API functions by default. This package is the `std/runtime` package. -API functions are mostly functions that can be used by the backend and require a great deal of low-level programming awareness. Called low-level because it is possible to access types that require careful handling, such as pointers, as well as behavior that can affect the behavior of the entire program. This means you also have access to critical common runtime functions of the Jule programs. +API functions are mostly functions that can be used by the backend and require a great deal of low-level programming awareness. It is called low-level because it is possible to access types that require careful handling, such as pointers, as well as behavior that can affect the behavior of the entire program. This means you also have access to critical common runtime functions of the Jule programs. In addition to providing an API for the backend, the package also contains some definitions that can be accessed directly from within Jule. These definitions grant access to some permitted functions at runtime, but typically most programs do not need this. \ No newline at end of file diff --git a/src/runtime/public-api.md b/src/runtime/public-api.md index 47d5caac..16543e0c 100644 --- a/src/runtime/public-api.md +++ b/src/runtime/public-api.md @@ -1,6 +1,6 @@ # Public API -The runtime library is not completely internal, also provides a public API. This API is mostly safe, and they may influence common runtime behavior or provide some additional opportunities. +The runtime library is not completely internal, it provides a public API. This API is mostly safe, and it may influence common runtime behavior or provide some additional opportunities. ## Index @@ -32,7 +32,7 @@ To view possible combinations of OS, run `julec tool distos` const Arch: str ``` The running program's architecture target: one of i386, amd64 and so on.\ -To view possible combinations of OS, run `julec tool distarch` +To view possible combinations of architectures, run `julec tool distarch` ```jule const RCDelta: untyped integer @@ -51,7 +51,7 @@ fn NumCPU(): int ``` Returns the number of logical CPUs usable by the current process. -The set of available CPUs is checked by querying the operating system at process startup. Changes to operating system CPU allocation after process startup are not reflected. +The set of available CPUs is checked by querying the operating system at process startup. Changes to operating system CPU allocation after process startup is not reflected. ## Yield ```jule diff --git a/src/runtime/runtime-api.md b/src/runtime/runtime-api.md index 545fcf81..e5905f18 100644 --- a/src/runtime/runtime-api.md +++ b/src/runtime/runtime-api.md @@ -64,24 +64,24 @@ Reads from stdin. Returns read byte count if success, `-1` otherwise. ```jule fn ptrEqual(a: *unsafe, b: *unsafe): bool ``` -Reports whether pointer allocations are points to same address. +Reports whether pointer allocations are pointing to same address. ```jule fn _RCNew(): _RCPtr ``` -Returns new initialized ready-to-use reference counting data allocation pointer. +Returns a new initialized ready-to-use reference counting data allocation pointer. ```jule unsafe fn _RCLoad(p: _RCPtr): _RCType ``` Reads reference counting data. Passing nil pointer is not safe. -Implemented with no concurrency-safety by default. If concurrency-safety necessary, compiler will update implementation implicitly. See memory model of concurrency. +Implemented with no concurrency-safety by default. If concurrency-safety is necessary, compiler will update implementation implicitly. See memory model of concurrency. ```jule unsafe fn _RCLoadAtomic(p: _RCPtr): _RCType ``` -Same as `_RCLoad` but have concurrency-safe implementation. +Same as `_RCLoad` but has a concurrency-safe implementation. ```jule unsafe fn _RCAdd(mut p: _RCPtr) @@ -93,7 +93,7 @@ Implemented with no concurrency-safety by default. If concurrency-safety necessa ```jule unsafe fn _RCAddAtomic(mut p: _RCPtr) ``` -Same as `_RCAdd` but have concurrency-safe implementation. +Same as `_RCAdd` but has a concurrency-safe implementation. ```jule unsafe fn _RCDrop(mut p: _RCPtr): bool @@ -105,7 +105,7 @@ Implemented with no concurrency-safety by default. If concurrency-safety necessa ```jule unsafe fn _RCDropAtomic(mut p: _RCPtr): bool ``` -Same as `_RCDrop` but have concurrency-safe implementation. +Same as `_RCDrop` but has a concurrency-safe implementation. ```jule unsafe fn _RCFree(p: _RCPtr) @@ -117,11 +117,6 @@ unsafe fn panic1(m: *byte, n: int) ``` The built-in panic call. -```jule -unsafe fn panic1(m: *byte, n: int) -``` -The built-in panic call. - ```jule fn panicStr(m: str) ``` @@ -165,7 +160,7 @@ Converts `rune` to `str`. ```jule unsafe fn runeStep(s: *byte, n: int, mut r: *rune, mut outLen: *int) ``` -Designed for `[]rune(s)` iterations. Takes pointer to string withl length and sets output pointers by first rune of string. Passing nil pointer for any parameter is not safe except `r`. +Designed for `[]rune(s)` iterations. Takes a pointer to string with length l and sets output pointers by first rune of string. Passing a nil pointer for any parameter except `r` is not safe. ```jule fn runeCount(s: str): int @@ -175,7 +170,7 @@ Returns rune count of the string. ```jule fn pseudoMalloc(n: i64, size: uint) ``` -Pseudo memory allocation, for allocation checking and documentation purposes. Any runtime allocation must be follow this implementation documentation. Pseudo allocates linear memory on the heap. The |n| is non-negative count of elements. The |size| is size in bytes of the single instance of a type which is will be allocated. Panics if |n*size > maxAlloc || n > max(int)|, also panics if allocation failed. Returns pointer to the allocation (pointer to the first cell if n>1). The allocated memory will not be initialized by default. +Pseudo memory allocation, for allocation checking and documentation purposes. Any runtime allocation must follow this implementation documentation. Pseudo allocates linear memory on the heap. The |n| is a non-negative count of elements. The |size| is the size in bytes of the single instance of a type which will be allocated. Panics if |n*size > maxAlloc || n > max(int)|, also panics if allocation failed. Returns pointer to the allocation (pointer to the first cell if n>1). The allocated memory will not be initialized by default. Calling this function, performs allocation size checking as described and panics if conditions are met. From 069af0701bd49d9f24eefa3917438b9d33c75f96 Mon Sep 17 00:00:00 2001 From: Mr-Potato-l Date: Tue, 10 Feb 2026 16:06:55 +0200 Subject: [PATCH 5/6] Improved grammar in the "Low-Level Helpers" section. --- src/low-level-helpers/index.md | 2 +- src/low-level-helpers/memory.md | 4 ++-- src/low-level-helpers/syscalls/addrcalls.md | 12 ++++++------ src/low-level-helpers/syscalls/index.md | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/low-level-helpers/index.md b/src/low-level-helpers/index.md index 44b16608..fd9ddb9f 100644 --- a/src/low-level-helpers/index.md +++ b/src/low-level-helpers/index.md @@ -1,5 +1,5 @@ # Low-Level Helpers -Low-Level Helpers are supplementary functionalities for low-level programming provided by the Jule and the standard library. They are under the terms of the Unsafe Jule. Be careful when using them. +Low-Level Helpers are supplementary functionalities for low-level programming provided by Jule and the standard library. They are under the terms of Unsafe Jule. Be careful when using them. There is no need to use an unsafe scope, as you will know that what you are doing is unsafe when using the low-level helpers. But when calling functions from any [unsafe package](/unsafe-jule/#unsafe-packages) you don't have Unsafe Jule for arguments. This means that for argument expressions that require the use of Unsafe Jule, you must use Unsafe Jule with explicit unsafe scope. \ No newline at end of file diff --git a/src/low-level-helpers/memory.md b/src/low-level-helpers/memory.md index be0b978b..8bff96b2 100644 --- a/src/low-level-helpers/memory.md +++ b/src/low-level-helpers/memory.md @@ -6,10 +6,10 @@ The [`std/mem`](/std/mem) package is a package provided by the standard library ```jule fn SizeOf(TYPE || EXPRESSION): uint ``` -Returns the size of the type in bytes. If given expression, uses type of expression. Void and function types are not supported. The expression is evaluated to determine type in compile-time and will not executed at runtime. +Returns the size of the type in bytes. If given an expression, uses the type of the expression. Void and function types are not supported. The expression is evaluated to determine the type in compile-time and it will not be executed at runtime. ## AlignOf ```jule fn AlignOf(TYPE || EXPRESSION): uint ``` -Returns the alignment, in bytes, required for any instance of the type indicated by type-id, which is either complete object type. If given expression, uses type of expression. Void and function types are not supported. The expression is evaluated to determine type in compile-time and will not executed at runtime. \ No newline at end of file +Returns the alignment, in bytes, required for any instance of the type indicated by type-id, which is a complete object type. If given an expression, uses the type of the expression. Void and function types are not supported. The expression is evaluated to determine the type in compile-time and it will not be executed at runtime. \ No newline at end of file diff --git a/src/low-level-helpers/syscalls/addrcalls.md b/src/low-level-helpers/syscalls/addrcalls.md index 52c7f718..20b6865e 100644 --- a/src/low-level-helpers/syscalls/addrcalls.md +++ b/src/low-level-helpers/syscalls/addrcalls.md @@ -8,7 +8,7 @@ Addrcalls are low-level calls to a function address. An addrcall takes the addre |--------------------------------------------------|-------------------------------------------------------------------| | Based on pointer with function type wrapper | Based on raw pointer/memory address | | Safety checks before call, like nil pointer | No safety checks, immediately jumps to function | -| May be implicit arguments like closure data | No hidden arguments, just explicit ones | +| May have implicit arguments like closure data | No hidden arguments, just explicit ones | | Explicit sign, static type analysis | Implicit sign, flexible, no static type analysis | | Suitable for Jule functions and interoperability | Suitable for syscalls, low-level calls, advanced interoperability | @@ -24,15 +24,15 @@ fn main() { sys::Addrcall(uintptr(extern.write), i32(1), &m[0], len(m)) } ``` -In the example above, the `write` function accessed with C is linked as if it were a pointer. Technically, functions are pointers. Then, its address is taken as an integer with uintptr and called with `Addrcall`. A simple `Hello, world` example. +In the example above, the `write` function accessed with C is linked as if it were a pointer (Technically, functions are pointers). Then, its address is taken as an integer with uintptr and called with `Addrcall`. A simple `Hello, world` example. The `Addrcall` function prototypes the called function according to the arguments. Remember, the types must be correct. Any type mismatch can cause various problems. ### Return Values -Any `Addrcall` is void by default. So does not return value. -If your function return value, you can specify it with the single generic type. +Any `Addrcall` is returns void by default. So it does not return a value. +If your function returns a value, you can specify it with the single generic type. For example: ```jule @@ -46,5 +46,5 @@ fn main() { println(n) } ``` -In the example above is basically same as the previous example. -But it reads return value of the `write` function. \ No newline at end of file +The example above is basically the same as the previous example. +But it reads the return value of the `write` function. \ No newline at end of file diff --git a/src/low-level-helpers/syscalls/index.md b/src/low-level-helpers/syscalls/index.md index 7f013801..a4270954 100644 --- a/src/low-level-helpers/syscalls/index.md +++ b/src/low-level-helpers/syscalls/index.md @@ -10,7 +10,7 @@ fn main() { sys::Write(1, []byte("hello world"))! } ``` -In the example above, consider this program will compile for linux. The `sys` package provides `write` function with minimal abstraction. The example code prints `hello world` to stdout. +In the example above, consider this program will compile for linux. The `sys` package provides a `write` function with minimal abstraction. The example code prints `hello world` to stdout. The equivalent C code: ```c From 9425e47acf37b41afc7520a42adbfd074b02f96b Mon Sep 17 00:00:00 2001 From: Mr-Potato-l Date: Tue, 10 Feb 2026 16:44:06 +0200 Subject: [PATCH 6/6] Improved grammar in the "Compiler" section. --- .../backend/cpp-backend-compilers/clang.md | 6 +- .../backend/cpp-backend-compilers/index.md | 12 ++-- src/compiler/basic-commands.md | 12 ++-- src/compiler/compiler-optimizations.md | 62 +++++++++---------- src/compiler/compiler-options.md | 18 +++--- src/compiler/compiling/index.md | 2 +- .../compiling/using-backend-compiler.md | 2 +- src/compiler/compiling/using-julec.md | 8 +-- src/compiler/cross-compilation.md | 6 +- src/compiler/directives.md | 24 +++---- src/compiler/specific-programming.md | 2 +- 11 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/compiler/backend/cpp-backend-compilers/clang.md b/src/compiler/backend/cpp-backend-compilers/clang.md index 5a71a66f..8dfb25b1 100644 --- a/src/compiler/backend/cpp-backend-compilers/clang.md +++ b/src/compiler/backend/cpp-backend-compilers/clang.md @@ -1,6 +1,6 @@ # Clang -Clang is a C/C++ compiler using LLVM. Jule gives priority support to Clang and is recommended to be used with Clang whenever possible. Jule and related projects use Clang as the backend compiler and are primarily tested for Clang. +Clang is a C/C++ compiler using LLVM. Jule gives priority support to Clang and it's recommended to be used with Clang whenever possible. Jule and related projects use Clang as the backend compiler and are primarily tested for Clang. ## Why Do We Recommend Clang? @@ -15,12 +15,12 @@ Clang is a C/C++ compiler using LLVM. Jule gives priority support to Clang and i Jule has a standard library implemented entirely using the Windows API on Windows. For detailed information about Jule's Windows API support, refer to the [Windows API](/compiler/backend/cpp-backend-compilers/#windows-api-compatibility) section. -By default, Jule assumes that you are using Clang (not MinGW; with GCC command-line interface, not MSVC) on Windows if you are using Clang. However, if you are using MinGW Clang, it should not require additional effort. +By default, Jule assumes that you are using Clang (not MinGW; with GCC command-line interface, not MSVC) on Windows, if you are using Clang. However, if you are using MinGW Clang, it should not require additional effort. If you want to use MinGW Clang, the [LLVM/Clang/LLD based mingw-w64 toolchain](https://github.com/mstorsjo/llvm-mingw) GitHub repository is recommended. ### Jule 0.1.3 and Before -The [Windows API](/compiler/backend/cpp-backend-compilers/#windows-api-compatibility) section mentions Jule's support for Windows API. You may want to use Clang on Windows. There is a Clang build we recommend so you can do this. It uses the MinGW toolchain. Compatible with compiling Jule IRs by default. Windows API support is not guaranteed. +The [Windows API](/compiler/backend/cpp-backend-compilers/#windows-api-compatibility) section mentions Jule's support for Windows API. You may want to use Clang on Windows. There is a Clang build we recommend so you can do this which uses the MinGW toolchain. Compatible with compiling Jule IRs by default. Windows API support is not guaranteed. Here is the recommended [LLVM/Clang/LLD based mingw-w64 toolchain](https://github.com/mstorsjo/llvm-mingw) repository on GitHub. diff --git a/src/compiler/backend/cpp-backend-compilers/index.md b/src/compiler/backend/cpp-backend-compilers/index.md index 6caed5d6..58be1f43 100644 --- a/src/compiler/backend/cpp-backend-compilers/index.md +++ b/src/compiler/backend/cpp-backend-compilers/index.md @@ -13,11 +13,11 @@ Even if you can compile code generated outside of official support compilers wit ### Primary Support -Primary support are primarily supported, most important and most recommended compilers. When a problem occurs in these compilers, priority is given to the solution and it is tried to be solved quickly. +Primary support is the primarily supported, most important and most recommended compilers. When a problem occurs in these compilers, priority is given to the solution and it is tried to be solved quickly. ### Partial Support -Partial support is compilers that are officially supported but not always guaranteed to be as accurate as primary supported compilers. Even if they can compile your code, there is also no guarantee that the executable will execute as expected. +Partial support is compilers that are officially supported but not always guaranteed to be as accurate as primary support compilers. Even if they can compile your code, there is no guarantee that the executable will run as expected. Partial support may not be available for all platforms and is broad in scope. Therefore, please read the relevant compiler's manual to find out why the associated compiler qualifies as partial support. @@ -35,7 +35,7 @@ Supports compilation for C++14, C++17, C++20 standards. As for the standard, it ### Jule 0.0.10 -It fixes compilation errors that caused by API when using C++14 standard. +It fixes compilation errors that are caused by the API when using C++14 standard. ### From Beta 0.0.7 to Jule 0.0.9 @@ -67,13 +67,13 @@ These tests were performed on Linux. When we tested GCC compilation on Windows w ### Jule 0.1.4 and Higher Versions -Jule supports Windows API. Our GitHub Action workflows use Clang (not MinGW) on Windows machines to compile Jule programs. In Jule 0.1.4, the `std/sys` package and whole standard library implemented using Windows API. +Jule supports Windows API. Our GitHub Action workflows use Clang (not MinGW) on Windows machines to compile Jule programs. In Jule 0.1.4, the `std/sys` package and standard library were implemented using Windows API. -If you encounter issues about Windows support, please report us via [Jule Issue Tracker](https://github.com/julelang/jule/issues). +If you encounter issues with Windows support, please report them to us via [Jule Issue Tracker](https://github.com/julelang/jule/issues). ### From Jule 0.0.14 to Jule 0.1.3 -Jule supports the Windows API. Our GitHub Action workflows use Clang (not MinGW) on Windows machines to compile Jule programs. However, Windows API support is not guaranteed to work as expected. When using the Windows API,, your program may be able to compile successfully, but may need to take additional actions like linking missing libraries. If you encounter issues like that, please report us via [Jule Issue Tracker](https://github.com/julelang/jule/issues). +Jule supports the Windows API. Our GitHub Action workflows use Clang (not MinGW) on Windows machines to compile Jule programs. However, Windows API support is not guaranteed to work as expected. When using the Windows API, your program may be able to compile successfully, but it may need to take additional actions like linking missing libraries. If you encounter issues like that, please report them to us via [Jule Issue Tracker](https://github.com/julelang/jule/issues). ### Jule 0.0.13 and Older Versions diff --git a/src/compiler/basic-commands.md b/src/compiler/basic-commands.md index 0b8ff4c2..eb7276bf 100644 --- a/src/compiler/basic-commands.md +++ b/src/compiler/basic-commands.md @@ -2,7 +2,7 @@ The basics of compiler commands. ## help -Shows help about of commands. +Shows help about different commands. ``` $ julec help $ julec help @@ -12,7 +12,7 @@ $ julec help The build command compiles the packages named by the import paths. The compile path must be the main package directory of the program. -When compiling packages, build ignores files that end in `_test.jule`. +When compiling packages, build ignores files that end with `_test.jule`. The main package must have the entry point `main` function. ``` $ julec build [arguments] @@ -23,8 +23,8 @@ The test command compiles the packages named by the import paths for testing. The compile path must be the package directory of the program to be tested. When compiling packages for testing, it will include files that end in `_test.jule`. -The package may have not the entry point `main` function, it will not be used. -Test compilations uses implicitly generated entry point for testing. +The package may not have the entry point `main` function, it will not be used. +Test compilations use an implicitly generated entry point for testing. Read the [writing tests](/debugging/testing/writing-tests) section for more information. ``` @@ -39,7 +39,7 @@ Module commands.\ Read the [modules](/packages/modules/) section for more information. ## version -Shows version of the julec. +Shows the version of julec. ``` $ julec version ``` @@ -52,7 +52,7 @@ $ julec tool ``` ## env -Show information about jule environment. +Show information about the jule environment. ``` $ julec env ``` \ No newline at end of file diff --git a/src/compiler/compiler-optimizations.md b/src/compiler/compiler-optimizations.md index a2bb3ea5..8a592abf 100644 --- a/src/compiler/compiler-optimizations.md +++ b/src/compiler/compiler-optimizations.md @@ -26,13 +26,13 @@ Some optimizations may not be applied for some scopes and expressions. ::: `--opt-zcopy` \ -Enabled special optimizations for the built-in copy function. +Enables special optimizations for the built-in copy function. - If the source slice is an array slicing, it avoids allocating a new slice by making the slicing mutable. This only applies to the last sliced ​​array of expression. --- `--opt-zappend` \ -Enabled special optimizations for the built-in append function. +Enables special optimizations for the built-in append function. - If the element slice is an array slicing, it avoids allocating a new slice by making the slicing mutable. This only applies to the last sliced ​​array of expression. @@ -66,17 +66,17 @@ It eliminates dead (unused / unreachable) codes from object code. --- `--opt-append` \ -Enables special optimizations for built-in `append` function. +Enables special optimizations for the built-in `append` function. -- It prevents the allocating and destruction of a new slice by adding slice literals element-by-element if append used at single assignment statement. +- It prevents the allocating and destruction of a new slice by adding slice literals element-by-element if append is used at single assignment statement. --- `--opt-len` \ -Enables special optimizations for built-in `len` function. +Enables special optimizations for the built-in `len` function. - Simplifies expressions such as `len([]byte(myStr))` to `len(myStr)`. -- Converts expressions such as `len([]rune(myStr))` to more efficient variant which is avoids making allocation. +- Converts expressions such as `len([]rune(myStr))` to a more efficient variant which avoids making allocation. --- @@ -85,9 +85,9 @@ Enables special optimizations for mathematical operations. - Skips the divide-by-zero check for division when operand is constant. - Skips the divide-by-zero check for modulo when operand is constant. -- Converts multiplications to bit shifting if possible. Good conditions for this optimization: operands are integer, multiplier is constant and power of 2. +- Converts multiplications to bit shifting if possible. Good conditions for this optimization: operands are integers, multiplier is constant and power of 2. - Converts modulo by 2 expressions to equivalent bitwise operation. -- Eliminates neutral binary expressions such as such as addition/subtraction with the constant-zero. +- Eliminates neutral binary expressions such as addition/subtraction with the constant-zero. - Eliminates runtime overflow checking for binary shifting expressions if right operand is constant. - Eliminates cost of the `x^0`, `0^x`, `x|0`, or `0|x` computations. It will be simplified to `x` expression. - Eliminates cost of the `x&0`, `0&x` computations. It will be simplified to `0` expression. @@ -99,8 +99,8 @@ Enables special optimizations for mathematical operations. `--opt-access` \ Enables special optimizations for memory accessing. -- Skips safety checks such as boundary checking if accessed to array via constant index expression. -- Removes the cost of boundary checking of expressions like `array[i&(len(array)-1)]` for arrays whose length is power of two. +- Skips safety checks such as boundary checking if accessed an array via constant index expression. +- Removes the cost of boundary checking of expressions like `array[i&(len(array)-1)]` for arrays whose length is a power of two. - If in a range iteration the iterated variable referred to by a immutable index variable is indexed, it is optimized as direct access and the cost of safety measures such as boundary checking is bypassed.
experimental
- If it can be understood that the index value used in any indexing process is within the boundaries, it removes the cost of boundary checking.
experimental
- If it can be understood that the smart pointer or reference pointer is not nil, it removes the cost of nil dereferencing.
experimental
@@ -110,7 +110,7 @@ Enables special optimizations for memory accessing. `--opt-inline` \ Enables special optimizations for inlining. -- The IR is generated includes encourage inline optimizations of the backend compiler. +- The IR-generated includes encourage inline optimizations of the backend compiler. --- @@ -125,21 +125,21 @@ Enables special optimizations for pointers. Enables special optimizations for conditional expressions and structures. - Removes unreachable if-else chain cases such as having constant false expressions. Applied for if-else chains, and match-cases. -- Remove unnecessary trailing cases that comes after constant true case. Applied for if-else chains, and match-cases. +- Removes unnecessary trailing cases that come after constant true case. Applied for if-else chains, and match-cases. - Removes condition eval overhead of constant true cases. Applied for if-else chains, and match-cases. -- Avoids using wrapper for strings if string compared with literal. -- Eliminates and simplifies predictable boolean expressions. Such as `if (x || true)` will be handled as `if (true)` or `if (x && false)` will be handled as `if (false)`. -- Eliminates predictable comparison expressions. Such as `if (x > x)` will be handles ad `if (false)` or `if (x == x)` will be handled as `if (true)`. +- Avoids using a wrapper for a string if the string is compared with a literal. +- Eliminates and simplifies predictable boolean expressions. Such as `if (x || true)` will be handled as `if (true)` and `if (x && false)` will be handled as `if (false)`. +- Eliminates predictable comparison expressions. Such as `if (x > x)` will be handled as `if (false)` and `if (x == x)` will be handled as `if (true)`. --- `--opt-str` \ Enables special optimizations for string operations. -- Converts string comparison with empty literal to `len(s) == 0` check. -- Erases relevant ranges of string's itself instead of making allocation for substring and assignment if string gets assignment with substring from itself. +- Converts string comparison with empty literal to a `len(s) == 0` check. +- Erases relevant ranges of the string itself instead of making allocation for substring and assignment, if the string gets assigned with a substring from itself. - Eliminates neutral binary expressions such as concatenation with the empty string. -- Optimizes allocations of the string concatenations if possible. +- Optimizes allocations of string concatenations if possible. - Optimizes string and bytes conversions of binary expressions such as `str([]byte) == str([]byte)`. --- @@ -147,7 +147,7 @@ Enables special optimizations for string operations. `--opt-slice` \ Enables special optimizations for slice operations. -- Erases relevant ranges of slice's itself instead of making allocation for subslice and assignment if slice gets assignment with subslice from itself. +- Erases relevant ranges of the slice itself instead of making allocation for subslice and assignment, if a slice gets assigned with a subslice from itself. --- @@ -161,10 +161,10 @@ Enables special optimizations for array operations. `--opt-assign`\ Enables special optimizations for assignments. -It's will not check deeply whether expressions are same. So if you want take advantage of this optimization, keep simple your assignments. +It will not check deeply whether expressions are same. So if you want take advantage of this optimization, keep your assignments simple. - Removes self assignments such as `a = a` or `a, b = a, b`. -- Optimize swap assignments such as `a, b = b, a`. +- Optimizes swap assignments such as `a, b = b, a`. --- @@ -181,21 +181,21 @@ Enables special optimizations for iterations. - Removes casting if non-constant string casted to byte slice for range iteration. Uses string's bytes directly. - Removes casting if non-constant string casted to rune slice for range iteration. Avoids making allocation for temporary rune slice, iterates runes of string directly. -- Makes array the slice literal expressions of the range iterations. +- Makes arrays the slice literal expressions of the range iterations. --- `--opt-dynamic`\ Enables special optimizations for dynamic programming features. -- If it can be understood that the `` is the type `x` and not nil, it removes the cost of not-nil and type compatibility checking for type assertion expressions with type `t`.
experimental
+- If it can be understood that `` is the type of `x` and it isn't nil, it removes the cost of not-nil and type compatibility checking for type assertion expressions with type `t`.
experimental
--- `--opt-std-strings`\ Enables special optimizations for the `std/strings` package. -- Removes exceptional handling cost if possible of the `Write`, `WriteByte`, `WriteRune`, and `WriteStr` methods of the `Builder` struct. +- Removes exceptional handling costs, if possible, of the `Write`, `WriteByte`, `WriteRune`, and `WriteStr` methods of the `Builder` struct. ## Optimization Levels @@ -211,8 +211,8 @@ Set optimization level to ``. The optimization levels are as follows: - `L0`: The default optimization level: no special optimizations. -- `L1`: passes all `L0` flags with `--opt-zcopy`, `--opt-zappend`, `--opt-copy`, `--opt-deadcode`, `--opt-append`, `--opt-math`, `--opt-access`, `--opt-inline`, `--opt-ptr`, `--opt-cond`, `--opt-str`, `--opt-slice`, `--opt-assign`, `--opt-iter`, `--opt-dynamic`, `--opt-array`, `--opt-len` -- `L2`: passes all `L1` flags with `--opt-std-strings` +- `L1`: passes all `L0` flags along with `--opt-zcopy`, `--opt-zappend`, `--opt-copy`, `--opt-deadcode`, `--opt-append`, `--opt-math`, `--opt-access`, `--opt-inline`, `--opt-ptr`, `--opt-cond`, `--opt-str`, `--opt-slice`, `--opt-assign`, `--opt-iter`, `--opt-dynamic`, `--opt-array`, `--opt-len` +- `L2`: passes all `L1` flags along with `--opt-std-strings` ## Production Compilation @@ -235,21 +235,21 @@ Pros of enabling production compilation: Cons of enabling production compilation: - Harder debugging. - Longer compile time. -- Some subtle bugs can only occur with optimizations enabled by production compilation and can cause the executable to behave differently than expected. It is mostly related to the codes you write or use when using C/C++ interoperability. +- Some subtle bugs can only occur with optimizations enabled by production compilation and can cause the executable to behave differently than expected. It is mostly related to the code you write or use when using C/C++ interoperability. - If the backend compiler you are using has some new optimizations or contains bugs, your code may run fast but not as expected. These types of optimization-related bugs can be difficult to track down. ## Optimization Options vs Production Compilation -Optimization options and production compilation focus on different things. Optimization options focus on achieving optimizations on the IR generated by your compiler. It doesn't interfere with anything else. Production compilation now focuses on compiling the IR you get when you want to compile software that is ready for production. Production compiler never enables the optimization flag. It focuses solely on compiling IR for production. If necessary, IR can remove things that are not required for production, but these changes are not improvements provided by optimization options. For best performance and optimization in production, optimization options and production compilation should be used together. +Optimization options and production compilation focus on different things. Optimization options focus on achieving optimizations on the IR generated by your compiler. It doesn't interfere with anything else. Production compilation focuses on compiling the IR you get when you want to compile software that is ready for production. Production compiler never enables the optimization flag. It focuses solely on compiling IR for production. If necessary, IR can remove things that are not required for production, but these changes are not improvements provided by optimization options. For best performance and optimization in production, optimization options and production compilation should be used together. ### Optimization Options -- Focus to code generation optimizations, better IR. -- Never do not touch backend compiler. +- Focus on code generation optimizations, better IR. +- Never interact with backend compiler. ### Production Compilation -- Focus to faster executables as possible. +- Focus on the fastest executable possible. - Optimize code generation for better IR if necessary. - Enable optimizations of backend compiler. - Generate production-ready IR. diff --git a/src/compiler/compiler-options.md b/src/compiler/compiler-options.md index c3c48f3a..3191259f 100644 --- a/src/compiler/compiler-options.md +++ b/src/compiler/compiler-options.md @@ -1,12 +1,12 @@ # Compiler Options -Compiler options (aka arguments) let you tell your compiler a set of preferences. Accordingly, the behavior and outputs of the compiler may differ. +Compiler options (aka arguments) allow you to make your compiler follow a set of preferences. Accordingly, the behavior and outputs of the compiler may differ. Arguments are indicated in their full form using two hyphens `--`. However, some arguments may have abbreviations (usually one letter), denoted by a single hyphen `-`. -Some options may require value. +Some options may require a value. ## Using Options -Options are written as command-line arguments when executing the compiler. Some options are only used, but an option may have to take a value. Options that receive value must see their value after it. So, after julec sees an option that should take a value, it evaluates the following command-line argument as the option's value. +Options are written as command-line arguments when executing the compiler. Some options are used on their own, but some may accept an additional value. Options that receive a value must see their value after it. So, after julec sees an option that should take a value, it evaluates the following command-line argument as the option's value. It doesn't matter if the options are in mixed order. They can be completely at the end of the command, at the beginning, in the middle, or in a complex way. The recommended order is to write the options first and then give the compiler inputs. @@ -24,26 +24,26 @@ Just transpile source code. --- `--compiler ` \ -Set the preferred compiler. Specify the compiler standard you will use for compilation from among the supported compilers. +Sets the preferred compiler. Specify the compiler standard you will use for compilation from a list of supported compilers. Values: `gcc` `clang` --- `--compiler-path ` -Set the path to the compiler to use to compile the IR. Might be useful when you have compiler name conflicts, mismatches or etc. +Sets the path to the compiler to use to compile the IR. Might be useful when you have compiler name conflicts, mismatches or etc. --- `--cppstd` \ -Set the C++ standard. +Sets the C++ standard. Values: `cpp14`, `cpp17`, `cpp20` --- `-o ` `--out ` \ -Write output to ``. If compiling for Windows, if the extension of path is not `.exe`, compiler will add it. If output file name is empty or unspecified, compiler will use `main` by default. +Write output to ``. If compiling for Windows and the extension of the path is not `.exe`, the compiler will add it. If the output file's name is empty or unspecified, the compiler will use `main` by default. --- @@ -73,12 +73,12 @@ Enable production compilation. --- `--disable-rc`\ -Disable reference counting. All reference counted types does not perform reference counting, prevents memory leaks. See [Disable Reference Counting](/memory/management/disable-reference-counting) section for more information. +Disable reference counting. All reference counted types do not perform reference counting, which prevents memory leaks. See the [Disable Reference Counting](/memory/management/disable-reference-counting) section for more information. --- `--disable-safety`\ -Disable safety. All memory safety and similar measures will be disabled. This will increase safety risks, but at the same time it might improve runtime performance. It may be helpful for debugging, see [Debugging](/debugging/) section for more information. +Disable safety. All memory safety and similar measures will be disabled. This will increase safety risks, but at the same time it might improve runtime performance. It may be helpful for debugging, see the [Debugging](/debugging/) section for more information. ### Optimization Options diff --git a/src/compiler/compiling/index.md b/src/compiler/compiling/index.md index 33453db4..252e04c0 100644 --- a/src/compiler/compiling/index.md +++ b/src/compiler/compiling/index.md @@ -1,3 +1,3 @@ # Compiling -This section covers how you can compile your Jule packages and source codes using your compiler. +This section covers how you can compile your Jule packages and source code using your compiler. diff --git a/src/compiler/compiling/using-backend-compiler.md b/src/compiler/compiling/using-backend-compiler.md index c627db27..87b2b1f5 100644 --- a/src/compiler/compiling/using-backend-compiler.md +++ b/src/compiler/compiling/using-backend-compiler.md @@ -1,5 +1,5 @@ # Using Backend Compiler -julec has multiple officially supported C++ compilers. For this reason, it does not contain a specific C++ compiler in itself to keep your download sizes small and leave the choice to you. If you're using Linux or a similar operating system, you can usually already have an officially supported C++ compiler. Once you've decided on the C++ compiler you want to use, julec can take care of the rest for you. Before that, you need to give julec a few simple instructions. +julec has multiple officially supported C++ compilers. For this reason, it does not contain a specific C++ compiler in itself to keep your download sizes small and leave the choice to you. If you're using Linux or a similar operating system, you usually already have an officially supported C++ compiler. Once you've decided on the C++ compiler you want to use, julec can take care of the rest for you. Before that, you need to give julec a few simple instructions. julec will automatically choose the recommended C++ compiler when compiling your code. If the recommended compiler is your preferred compiler, you don't need to take any action. But if not, you need to set your compiler using the related compiler option(s). diff --git a/src/compiler/compiling/using-julec.md b/src/compiler/compiling/using-julec.md index bab661b7..5e74a27b 100644 --- a/src/compiler/compiling/using-julec.md +++ b/src/compiler/compiling/using-julec.md @@ -9,7 +9,7 @@ fn main() { ``` \ -For compile Jule code, we just give current directory path to julec: +To compile Jule code, we just give the current directory path to julec: ``` julec build . ``` @@ -18,7 +18,7 @@ The compiler translates our Jule code to C++ code. In compile mode, julec will show you the build command itself on the command line, which is used during compilation. You can also set the mod to transpile and choose to compile manually, or you can write a script that compiles the code after you have it in C++ form, using the transpile mode to experience compile mode. -As result we have a executable machine code result of our program. +As a result we have an executable machine code result of our program. ## Backend Compiler Optimizations @@ -41,7 +41,7 @@ For example to enable Clang's `O3` optimizations: ### Transpile and Compile Manually -You can transpile your code and compile your IR code with your desired optimization setting by customizing the suggested compile command by compiler or with a completely custom compile command. +You can transpile your code and compile your IR code with your desired optimization setting by customizing the suggested compile command by the compiler or with a completely custom compile command. ## Transpilation @@ -54,7 +54,7 @@ For example: julec build --transpile . ``` -## Why julec Needs Directory Path Instead File Path? +## Why does julec need a Directory Path instead of a File Path? In Jule, each program is also a package. Jule source codes in the directory are accepted within the package. Accordingly, every directory is actually a potential Jule package. The directory of the program you will compile should be the main package of your program. This also eliminates the need to link individual source codes to the compiler and significantly avoids the occurrence of long compiler commands. It makes it easy to understand which of the source codes are in the main program; the answer is simple: all the Jule source codes in the directory. Because of this approach, each Jule program is kept in a separate directory as a package, causing optimistic pressure on the project organization. diff --git a/src/compiler/cross-compilation.md b/src/compiler/cross-compilation.md index ba0650f0..820ad1a6 100644 --- a/src/compiler/cross-compilation.md +++ b/src/compiler/cross-compilation.md @@ -2,11 +2,11 @@ Cross compilation allows you to compile your Jule code for different platforms. For example, if you have ARM64 architecture and macOS, you can target Windows and AMD64 architecture on this system. -To do this, you need to specifically specify the target platform in your compiler's build command. You can do this by passing the ``--target`` option to compile. Your target notation should be in a special binary format. +To do this, you need to specify the target platform in your compiler's build command. You can do this by passing the ``--target`` option to compile. Your target notation should be in a special binary format. This format is: ``-``. But what if you want to use your OS as your current OS and only change your target architecture? -You can actually do this by typing, but here you have an alternative way. The `native` value for both arguments is a valid target if you want to get the value of the system you are on. +You can do this by typing normally, but there is an alternative way. The `native` value for both arguments is a valid target if you want to get the value of the system you are on. Examples target commands: - ``--target windows-arm64``: Windows OS and ARM64 arch @@ -19,4 +19,4 @@ The default target is: ``--target native-native`` ## Imitation -Compiler will imitate your architecture as far as possible. In this imitation phase, it is expected to handle content such as platform-dependent data types such as `int` or `uint` and platform-specific source files in accordance with the target platform. \ No newline at end of file +The compiler will imitate your architecture as far as possible. In this imitation phase, it is expected to handle content such as platform-dependent data types such as `int` or `uint` and platform-specific source files in accordance with the target platform. \ No newline at end of file diff --git a/src/compiler/directives.md b/src/compiler/directives.md index 5485bece..01305693 100644 --- a/src/compiler/directives.md +++ b/src/compiler/directives.md @@ -1,17 +1,17 @@ # Directives -Compiler directives (or pragmas) are statements that describe how the compiler should handle source code. Directives are safe to use. It is checked by the compiler and incorrect usage is warned. +Compiler directives (or pragmas) are statements that describe how the compiler should handle source code. Directives are safe to use. They are checked by the compiler and incorrect usage is warned. -For a directive to be valid, it must be used correctly in the right place. The directive must be start with the `#` prefix. +For a directive to be valid, it must be used correctly in the right place. The directive must start with the `#` prefix. \ -For example to directives: +An example to directives: ```jule #typedef ``` ## Top Directives -Top directives are must be placed at top of source file. -Usually contains specific compiler configurations for file or package. +Top directives must be placed at top of a source file. +Usually contains specific compiler configurations for files or packages. ## Arguments The arguments of the directives are separated by spaces. The directive must be followed by the required arguments, separated by spaces. @@ -24,7 +24,7 @@ For example: ## Directive Expressions -Some directives evaluate the expression you wrote with a custom syntax, and if the expression returns `true` as a result, your file will be included in the build. Expression must always return a boolean. Expressions are only logical. So the variables you will use are boolean, and the binary operations you can do are only logical and, and logical or. +Some directives evaluate the expression you wrote with a custom syntax, and if the expression returns `true` as a result, your file will be included in the build. Expressions must always return a boolean. Expressions are only logical, so the variables you will use are boolean, and the binary operations you can do are only logical and, and logical or. Your variables are set automatically by your compiler. The variables you can use are the same as in file annotation. They are variables that are also described in the [platform support](/compiler/platform-support) documentation. @@ -38,7 +38,7 @@ The syntax is simple and easy to learn. The logical and operator is `&&` and the ### Variables -Here is the list of variables and their existence: +Here is the list of variables and their meanings: - `windows`: operating system is windows - `darwin`: operating system is darwin @@ -57,7 +57,7 @@ Here is the list of variables and their existence: ### Examples -Here is an example code via `build` directive: +Here is an example code with the `build` directive: ```jule #build (darwin || windows) && x64 @@ -67,11 +67,11 @@ Here is an example code via `build` directive: ``` ## Directive: `pass` -Directive pass is a top directive. +The `pass` directive is a top directive. Passes compiler flags to the generated compile command for compiling source code. Uses a string literal as an argument, but literals are not processed; it accepts it directly. So, you can't use escape sequences like original string literals. Pass directives add to command lines after source files. ::: info -There are no issue if you are using same passes. +There are no issues if you are using similar passes. The compiler will eliminate duplicate passes. ::: @@ -90,12 +90,12 @@ The `#pass` directive treats its expression strictly as a single argument. This ## Directive: `build` -The `build` directive is a top directive. Different way of specific programming such as platform specific programming. It can be used with or instead of file annotation. Unlike file annotation, it is a directive, not a naming convention. +The `build` directive is a top directive. Different way of specific programming, such as platform specific programming. It can be used with or instead of file annotation. Unlike file annotation, it is a directive, not a naming convention. Please look at the [specific programming](/compiler/specific-programming) section for more information. ## Directive: `typedef` -In external structs, if the structure is a `typedef` use this will configure code generation correctly. Otherwise, the struct will be treated as a classical structures. +In external structs, if the structure is a `typedef` using this will configure code generation correctly. Otherwise, the struct will be treated as a classical structures. ## Directive: `cdef` In external functions, if the function is a `#define`, it configures code generation to be compatible. diff --git a/src/compiler/specific-programming.md b/src/compiler/specific-programming.md index c47796b0..f83ad849 100644 --- a/src/compiler/specific-programming.md +++ b/src/compiler/specific-programming.md @@ -42,7 +42,7 @@ You can use this directive for platform specific programming or compilation spec ### Variables -Your variables are set automatically by your compiler. There are variables for many situations. You can also read the [variables](/compiler/directives#variables) section to get more ideas about platform specific variables. +Your variables are set automatically by your compiler. There are variables for many situations. You can also read the [variables](/compiler/directives#variables) section to get more idea about platform specific variables. ### Examples