You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-33Lines changed: 44 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,5 @@
1
1
---
2
-
description: A short introduction to ByteSkript, its uses, goals and applications.
3
-
coverY: 0
2
+
description: A short introduction to ByteSkript, its uses, goals and applications. coverY: 0
4
3
---
5
4
6
5
# 🎶 Introduction to ByteSkript
@@ -13,14 +12,16 @@ An experimental language based on Skript (with no pre-eminent DSL dependencies)
13
12
14
13
### Visit the [documentation](https://moderocky.gitbook.io/byteskript/) and wiki [here](https://moderocky.gitbook.io/byteskript/).
15
14
16
-
ByteSkript draws heavily from the original [Skript](https://github.com/SkriptLang/Skript/) language design, with some minor structural adaptations to strengthen the language grammar, to remove some unnecessary jargon and make the language more reliable. ByteSkript also increases interoperability with existing JVM languages.
15
+
ByteSkript draws heavily from the original [Skript](https://github.com/SkriptLang/Skript/) language design, with some
16
+
minor structural adaptations to strengthen the language grammar, to remove some unnecessary jargon and make the language
17
+
more reliable. ByteSkript also increases interoperability with existing JVM languages.
17
18
18
19
{% hint style="info" %}
19
20
**ByteSkript is not affiliated with**[**SkriptLang**](https://github.com/SkriptLang/Skript/)**.**\
20
-
ByteSkript is a completely **new** implementation of the general guide and style of the 'Skript' language, with its own language specification, goals and licence.
21
+
ByteSkript is a completely **new** implementation of the general guide and style of the 'Skript' language, with its own
22
+
language specification, goals and licence.
21
23
22
-
For clarity: SkriptLang's Skript implementation will be referred to as 'original' or 'minecraft' Skript.
23
-
{% endhint %}
24
+
For clarity: SkriptLang's Skript implementation will be referred to as 'original' or 'minecraft' Skript. {% endhint %}
24
25
25
26
### Goals
26
27
@@ -44,7 +45,9 @@ For clarity: SkriptLang's Skript implementation will be referred to as 'original
44
45
The layout, look, readability and core language components should keep parity with original Skript.\
45
46
Some small changes will be made to improve readability and compile accuracy.
46
47
47
-
Skript is designed to be beginner-friendly. Ideally, a user with no experience should be able to read Skript code and understand its function. All instructions are written in basic English, avoiding niche programming terms and symbols wherever possible.
48
+
Skript is designed to be beginner-friendly. Ideally, a user with no experience should be able to read Skript code and
49
+
understand its function. All instructions are written in basic English, avoiding niche programming terms and symbols
50
+
wherever possible.
48
51
49
52
## Using ByteSkript
50
53
@@ -62,68 +65,76 @@ Running these for the first time will create special folders in the run director
62
65
63
66
This is the simplest resource, used for loading (and running) user-created script files.
64
67
65
-
Raw script files can be written and placed in the `skript/` folder. All scripts will be loaded internally, but no classes or jar files will be written.
68
+
Raw script files can be written and placed in the `skript/` folder. All scripts will be loaded internally, but no
69
+
classes or jar files will be written.
66
70
67
71
The `on [script] load` event will be triggered for each script as an entry point.
68
72
69
-
{% hint style="success" %}
70
-
The ByteSkript compilers, language specification and compile-time API are available in this resource, so advanced scripts may use dynamic loading to load extra skript code written at runtime!
73
+
{% hint style="success" %} The ByteSkript compilers, language specification and compile-time API are available in this
74
+
resource, so advanced scripts may use dynamic loading to load extra skript code written at runtime!
71
75
{% endhint %}
72
76
73
77
### SkriptClassCompiler
74
78
75
-
This resource is used for generating compiled JVM `.class` files for each script in the `skript/` folder. The classes produced by this are not directly executable, but may be useful for sharing and special loading.
79
+
This resource is used for generating compiled JVM `.class` files for each script in the `skript/` folder. The classes
80
+
produced by this are not directly executable, but may be useful for sharing and special loading.
76
81
77
82
The compiled scripts will **not** be loaded or run.
78
83
79
84
### SkriptJarBuilder
80
85
81
-
This resource builds an executable jar containing all of the user-created scripts, resources and the ByteSkript runtime (`skript` namespace and functions.)
86
+
This resource builds an executable jar containing all of the user-created scripts, resources and the ByteSkript
87
+
runtime (`skript` namespace and functions.)
82
88
83
89
\
84
-
This output jar can be run with `java -jar JarName.jar` and is distributable - it does not need anything as a dependency.
90
+
This output jar can be run with `java -jar JarName.jar` and is distributable - it does not need anything as a
91
+
dependency.
85
92
86
-
When executing this jar, all scripts will be loaded and the `on [script] load` event will be triggered for each script as an entry point.
93
+
When executing this jar, all scripts will be loaded and the `on [script] load` event will be triggered for each script
94
+
as an entry point.
87
95
88
-
{% hint style="danger" %}
89
-
The ByteSkript standard compiler and compile-time API are **not** added to the output jar.
90
-
{% endhint %}
96
+
{% hint style="danger" %} The ByteSkript standard compiler and compile-time API are **not** added to the output jar. {%
97
+
endhint %}
91
98
92
-
{% hint style="success" %}
93
-
The dynamic function on-the-fly compiler **is** available in this jar, so dynamic function calls are available.
94
-
{% endhint %}
99
+
{% hint style="success" %} The dynamic function on-the-fly compiler **is** available in this jar, so dynamic function
100
+
calls are available. {% endhint %}
95
101
96
102
## Language Libraries
97
103
98
-
Due to its fixed nature, the Skript language has always relied on third-party add-ons to add new syntax and functionality for specific areas.
104
+
Due to its fixed nature, the Skript language has always relied on third-party add-ons to add new syntax and
105
+
functionality for specific areas.
99
106
100
107
ByteSkript achieves this through libraries, which can register compile-time and run-time functionality.
101
108
102
-
There are two provided syntax APIs, labelled `v1` and `v2`. Both are available and easily accessible, but may be suited to different tasks.
109
+
There are two provided syntax APIs, labelled `v1` and `v2`. Both are available and easily accessible, but may be suited
110
+
to different tasks.
103
111
104
-
Within the set of built-in functions in the `skript` namespace are some for accessing JVM resources which can be used to build more advanced functionality.
112
+
Within the set of built-in functions in the `skript` namespace are some for accessing JVM resources which can be used to
113
+
build more advanced functionality.
105
114
106
115
### API v1
107
116
108
-
The `v1` syntax API offers complete control of syntax, including writing bytecode instructions, look-aheads, additions, etc.
117
+
The `v1` syntax API offers complete control of syntax, including writing bytecode instructions, look-aheads, additions,
118
+
etc.
109
119
110
-
However, it also requires creating and individually registering (fairly complex) classes to add new syntax and language structures.
120
+
However, it also requires creating and individually registering (fairly complex) classes to add new syntax and language
121
+
structures.
111
122
112
-
This is the most powerful syntax API, as it allows control of the result code at the VM-bytecode level for experienced users. It is recommended for adding entirely new language structures or features with excessively-variable layouts.
123
+
This is the most powerful syntax API, as it allows control of the result code at the VM-bytecode level for experienced
124
+
users. It is recommended for adding entirely new language structures or features with excessively-variable layouts.
113
125
114
-
{% hint style="info" %}
115
-
The implicit array creation syntax `(a, b, ...)` has to use the v1 API to create variable-size arrays.
116
-
{% endhint %}
126
+
{% hint style="info" %} The implicit array creation syntax `(a, b, ...)` has to use the v1 API to create variable-size
127
+
arrays. {% endhint %}
117
128
118
129
### API v2
119
130
120
131
The `v2` syntax API is significantly easier to use, but offers much less control over syntax.
121
132
122
-
Syntax methods are given an annotation, and the class they belong to is registered to a library. This API is much more suitable for property syntax, where creating a class for each one would be excessive.
133
+
Syntax methods are given an annotation, and the class they belong to is registered to a library. This API is much more
134
+
suitable for property syntax, where creating a class for each one would be excessive.
123
135
124
-
{% hint style="info" %}
125
-
The v2 API is used internally by all of the I/O handler syntax. A lot of these are also forced to extract or bridge.
126
-
{% endhint %}
136
+
{% hint style="info" %} The v2 API is used internally by all of the I/O handler syntax. A lot of these are also forced
0 commit comments