-
-
Notifications
You must be signed in to change notification settings - Fork 0
Docs init #657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Docs init #657
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d11cc7f
docs: Added documentation for the initialization section
claycuy 8b7faa8
docs: Update docs
claycuy b59cbe6
docs: Update docs
claycuy 31d8d06
docs: Update docs
claycuy a55737c
Merge branch 'main' into docs-init
claycuy 72e628b
docs: Update docs
claycuy 8afc9c9
docs: Update docs
claycuy 128d04c
docs: Update docs
claycuy 0e0df4b
fix: Forward security config and correct documentation
coderabbitai[bot] 4b413eb
docs: Update docs
claycuy a16fff8
📝 CodeRabbit Chat: Clarify Debug and Unsafe capability permissions in…
coderabbitai[bot] b416fe0
docs: Update docs
claycuy 62426d9
docs: Clarify unsafe mode limits and capability requirements in Engli…
coderabbitai[bot] a962dbd
docs: Update docs
claycuy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,13 @@ | ||
| import { sidebarConfigurationReference } from './sidebarConfigurationReference.js'; | ||
| import { sidebarDataTypes } from './sidebarDataTypes.js'; | ||
| import { sidebarMethodFunctions } from './sidebarMethodFunctions.js'; | ||
| import { sidebarInstructionSet } from './sidebarInstructionSet.js'; | ||
| import { sidebarErrorCodes } from './sidebarErrorCodes.js'; | ||
|
|
||
| export const sidebarAPIReferences = [ | ||
| sidebarConfigurationReference, | ||
| sidebarDataTypes, | ||
| sidebarMethodFunctions, | ||
| { text: 'Primitive Types', link: '/api-reference/primitive-types' }, | ||
| { text: 'Capabilities', link: '/api-reference/capabilities' }, | ||
| { text: 'Time Budget', link: '/api-reference/time-budget' }, | ||
| sidebarInstructionSet, | ||
| sidebarErrorCodes, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export const sidebarConfigurationReference = { | ||
| text: 'Configuration Reference', | ||
| collapsed: false, | ||
| items: [ | ||
| { | ||
| text: 'TypeScript Configuration', | ||
| link: '/api-reference/configuration-reference/typescript-configuration', | ||
| }, | ||
| { | ||
| text: 'Rust Configuration', | ||
| link: '/api-reference/configuration-reference/rust-configuration', | ||
| } | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| export const sidebarDataTypes = { | ||
| text: 'Data Types', | ||
| collapsed: false, | ||
| items: [ | ||
| { text: 'Primitive Types', link: '/api-reference/data-types/primitive-types' }, | ||
| { text: 'Capabilities', link: '/api-reference/data-types/capabilities' }, | ||
| { text: 'Time Budget', link: '/api-reference/data-types/time-budget' }, | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,13 @@ | ||
| import { sidebarConfigurationReference } from './sidebarConfigurationReference.js'; | ||
| import { sidebarDataTypes } from './sidebarDataTypes.js'; | ||
| import { sidebarMethodFunctions } from './sidebarMethodFunctions.js'; | ||
| import { sidebarInstructionSet } from './sidebarInstructionSet.js'; | ||
| import { sidebarErrorCodes } from './sidebarErrorCodes.js'; | ||
|
|
||
| export const sidebarAPIReferences = [ | ||
| sidebarConfigurationReference, | ||
| sidebarDataTypes, | ||
| sidebarMethodFunctions, | ||
| { text: 'Tipe Primitif', link: '/id/api-reference/primitive-types' }, | ||
| { text: 'Kapabilitas', link: '/id/api-reference/capabilities' }, | ||
| { text: 'Batas Waktu Eksekusi', link: '/id/api-reference/time-budget' }, | ||
| sidebarInstructionSet, | ||
| sidebarErrorCodes, | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export const sidebarConfigurationReference = { | ||
| text: 'Referensi Konfigurasi', | ||
| collapsed: false, | ||
| items: [ | ||
| { | ||
| text: 'Konfigurasi TypeScript', | ||
| link: '/id/api-reference/configuration-reference/typescript-configuration', | ||
| }, | ||
| { | ||
| text: 'Konfigurasi Rust', | ||
| link: '/id/api-reference/configuration-reference/rust-configuration', | ||
| }, | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| export const sidebarDataTypes = { | ||
| text: 'Tipe Data', | ||
| collapsed: false, | ||
| items: [ | ||
| { text: 'Tipe Primitif', link: '/id/api-reference/data-types/primitive-types' }, | ||
| { text: 'Kapabilitas', link: '/id/api-reference/data-types/capabilities' }, | ||
| { text: 'Batas Waktu Eksekusi', link: '/id/api-reference/data-types/time-budget' }, | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "weekly": "3.5", | ||
| "allTime": "42.8", | ||
| "updatedAt": "2026-07-28T12:35:48.172Z" | ||
| "weekly": "4.0", | ||
| "allTime": "96.3", | ||
| "updatedAt": "2026-09-21T00:42:01.698Z" | ||
| } |
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
docs/en/api-reference/configuration-reference/rust-configuration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Rust Configuration | ||
| This page provides a comprehensive reference for all available configuration options, limits, and security controls when initializing a `LightVM` instance. | ||
|
|
||
| ## Full Configuration Example | ||
| The following example demonstrates how to configure all available limits, safety flags, and error options using both the builder and object patterns. | ||
|
|
||
| ::: code-group | ||
| <<< @/examples/configuration-reference/builder_pattern.rs{rs:line-numbers}[Builder Pattern] | ||
| <<< @/examples/configuration-reference/object_pattern.rs{rs:line-numbers}[Object Pattern] | ||
| ::: | ||
|
|
||
| ## Configuration Options Breakdown | ||
|
|
||
| | Method / Property | Type | Default | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | `caps` | `Vec<Capability>` | `vec![]` (grants `Capability::Observe`) | Specifies the active capabilities granted to the virtual machine. | | ||
| | `set_max_io` / `max_io` | `usize` | `100` | Maximum number of I/O operations allowed during execution. | | ||
| | `set_max_import` / `max_import` | `usize` | `3` | Maximum number of allowed module imports. | | ||
| | `set_max_alloc` / `max_alloc` | `usize` | `50` | Maximum number of memory allocations allowed. | | ||
| | `set_max_call` / `max_call` | `usize` | `200` | Maximum number of nested function calls allowed. | | ||
| | `set_max_jump` / `max_jump` | `usize` | `100` | Maximum number of control flow jumps allowed. | | ||
| | `set_max_ticks` / `max_ticks` | `u64` | `1_000_000` | Maximum number of execution ticks before stopping to prevent infinite loops. | | ||
| | `set_max_stack_size` / `max_stack_size` | `usize` | `128` | Maximum number of items the evaluation stack can hold. | | ||
| | `set_allowed_imports` / `allowed_imports` | `Vec<String>` | `vec!["math".into(), "time".into(), "utils".into()]` | Whitelist of module names that are permitted to be imported. | | ||
| | `set_time_budget` / `time_budget` | `TimeBudget` | `TimeBudget::Cheap` | Sets the execution time budget tier limit. | | ||
| | `with_unsafe_mode` / `unsafe_mode` | `bool` | `false` | Enables or disables system-level unsafe operations. | | ||
| | `with_nightly` / `nightly` | `bool` | `false` | Allows the usage of experimental nightly features. | | ||
| | `with_backtrace` / `backtrace` | `bool` | `false` | Displays internal backtrace details in error messages. | | ||
| | `with_explain` / `explain` | `bool` | `false` | Displays a more detailed explanatory hint in error messages. | | ||
| | `with_hint` / `hint` | `bool` | `true` | Displays general usage hints on error messages. | | ||
| | `with_diagnostic_links` / `diagnostic_links` | `bool` | `true` | Includes metadata links pointing to error-code documentation. | | ||
|
|
||
| ::: info Related Documentation | ||
| Need to check individual error codes mentioned in error messages? Visit the [Error Code Reference](/api-reference/error-codes/lvm001-code). | ||
| ::: |
35 changes: 35 additions & 0 deletions
35
docs/en/api-reference/configuration-reference/typescript-configuration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # TypeScript Configuration | ||
| This page provides a comprehensive reference for all available configuration options, limits, and security controls when initializing a `LightVM` instance. | ||
|
|
||
| ## Full Configuration Example | ||
| The following example demonstrates how to configure all available limits, safety flags, and error options using both the builder and object patterns. | ||
|
|
||
| ::: code-group | ||
| <<< @/examples/configuration-reference/builderPattern.ts{ts:line-numbers}[Builder Pattern] | ||
| <<< @/examples/configuration-reference/objectPattern.ts{ts:line-numbers}[Object Pattern] | ||
| ::: | ||
|
|
||
| ## Configuration Options Breakdown | ||
|
|
||
| | Method / Property | Type | Default | Description | | ||
| | :--- | :--- | :--- | :--- | | ||
| | `caps` | `Capability[]` | `[Capability.Observe]` | Specifies the active capabilities granted to the virtual machine. | | ||
| | `setMaxIo` / `maxIo` | `number` | `100` | Maximum number of I/O operations allowed during execution. | | ||
| | `setMaxImport` / `maxImport` | `number` | `3` | Maximum number of allowed module imports. | | ||
| | `setMaxAlloc` / `maxAlloc` | `number` | `50` | Maximum number of memory allocations allowed. | | ||
| | `setMaxCall` / `maxCall` | `number` | `200` | Maximum number of nested function calls allowed. | | ||
| | `setMaxJump` / `maxJump` | `number` | `100` | Maximum number of control flow jumps allowed. | | ||
| | `setMaxTicks` / `maxTicks` | `number` | `1_000_000` | Maximum number of execution ticks before stopping to prevent infinite loops. | | ||
| | `setMaxStackSize` / `maxStackSize` | `number` | `128` | Maximum number of items the evaluation stack can hold. | | ||
| | `setAllowedImports` / `allowedImports` | `string[]` | `[]` | Whitelist of module names that are permitted to be imported. | | ||
| | `setTimeBudget` / `timeBudget` | `TimeBudget` | `TimeBudget.Cheap` | Sets the execution time budget tier limit. | | ||
| | `withUnsafeMode` / `unsafeMode` | `boolean` | `false` | Enables or disables system-level unsafe operations. | | ||
| | `withNightly` / `nightly` | `boolean` | `false` | Allows the usage of experimental nightly features. | | ||
| | `withBacktrace` / `backtrace` | `boolean` | `false` | Displays internal backtrace details in error messages. | | ||
| | `withExplain` / `explain` | `boolean` | `false` | Displays a more detailed explanatory hint in error messages. | | ||
| | `withHint` / `hint` | `boolean` | `true` | Displays general usage hints on error messages. | | ||
| | `withDiagnosticLinks` / `diagnosticLinks` | `boolean` | `true` | Includes metadata links pointing to error-code documentation. | | ||
|
|
||
| ::: info Related Documentation | ||
| Need to check individual error codes mentioned in error messages? Visit the [Error Code Reference](/api-reference/error-codes/lvm001-code). | ||
| ::: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Capabilities | ||
|
|
||
| A `Capability` grants a host operation permission to access a protected `LightVM` function. Pass the required values in `VMConfig.caps`. TypeScript uses `Observe` by default. | ||
|
|
||
| | Capability | Numeric value | Protected operations | | ||
| | --- | ---: | --- | | ||
| | `Control` | `0` | `run`, `compile`, `embedded`, function exports, `provide`, clearing outputs, and bytecode optimization | | ||
| | `Observe` | `1` | `inspect`, reading outputs, and variable exports | | ||
| | `Debug` | `2` | Benchmarks, reading panic records, and clearing panic records | | ||
| | `Unsafe` | `3` | `halt`, which stops the VM | | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| `unsafeMode` (or `unsafe_mode` in **Rust**) in disables security checks such as import restrictions and resource quotas for I/O, imports, allocations, calls, and jumps, but does not grant capability permissions. Bounds verification remains enabled. Calling `halt` still requires the `Unsafe` capability in `VMConfig.caps`, even with this mode enabled. | ||
|
|
||
| ::: warning | ||
| Failing to provide the required capabilities will cause protected host operations to fail execution or trigger runtime errors. Always ensure you grant the minimum necessary capability permissions required by your application. | ||
| ::: | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Time Budget | ||
|
|
||
| `TimeBudget` sets how much time Gazle can spend optimizing bytecode. It does not limit VM execution time. | ||
|
|
||
| | Value | Numeric value | Optimizer budget | | ||
| | :--- | :--- | :--- | | ||
| | `Cheap` (default) | `0` | 200 ms | | ||
| | `Normal` | `1` | 1,000 ms | | ||
| | `Expensive` | `2` | 5,000 ms | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.