diff --git a/assets/js/search-data.json b/assets/js/search-data.json
index 2978c977..d4a9982b 100644
--- a/assets/js/search-data.json
+++ b/assets/js/search-data.json
@@ -869,7 +869,7 @@
},"124": {
"doc": "Optimization",
"title": "sslc -O option",
- "content": "The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn’t a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It’s primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops. There are several levels of optimization available: . | -O1 - Basic, only removes unreferenced globals variables and procedures, code itself remains untouched. | -O2 - Full, most code optimizations are on, but only those that were tested on complex scripts. | -O3 - Experimental, provides most efficiency, but tend to break some complex code due to bugs. | . The following optimizations are performed: . | constant expression folding: if an expression depends only on values which are known at compile time, then the expression is replaced by its result. a := 2 + 2; -> a := 4; . | constant variable initialization: All variables are initialised to some value, (‘0’, if you don’t specify anything else,) so sslc attempts to make use of that fact to remove the first assignment to a variable if the first assignment is a constant expression. variable a; -> variable a := 4; a := 4; -> . | constant propagation: checks for values assigned to variables which can be computed at compile time, and replaces relevant references to the symbol by the constant. The original store is not removed by this optimization. Global variables are considered for this optimization only if they are not marked import or export, and are not assigned to anywhere in the script. a := 4; -> a := 4; foo(a); -> foo(4); . | dead code removal: Checks for and removes code which cannot be reached, either because it is hidden behind a return or because the argument to an if statement can be computed at compile time. if (True) then begin -> display_msg(\"foo\"); display_msg(\"foo\"); -> end else begin -> display_msg(\"bar\"); -> end -> . | unreferenced variable elimination: Checks for variables which are never referenced, and removes them. Also applies to global variables, as long as they are not marked for export. variable i, j, k; -> variable i; i := 1; -> i := 1; return; -> return; . | unreferenced procedure elimination: Checks for any procedures which are never called, and removes them. procedure foo begin return \"foo\"; end -> procedure foo begin return \"foo\"; end procedure bar begin return \"bar\"; end -> procedure start begin procedure start begin -> display_msg(foo); display_msg(foo); -> end end -> . | dead store removal: Removes variable assignments if the result of the variable is unused, and if the expression used to compute the value of the variable is provably free of side effects. (See pure keyword) a := \"moo\"; -> a := \"foo\"; a := \"foo\"; -> display_msg(a); display_msg(a); -> a := \"bar\"; -> . | store combination: Where there are two stores in a row to the same variable, the two expressions are combined. var1 := var2; -> var1 := var2 + var3; var1 += var3; -> . | variable combination: Where usage regions of variables do not overlap, combine the variables to provide additional candidates for unreferenced variable elimination. Very useful for scripts containing multiple foreach loops, which generate 2 or 3 hidden variables each. a := \"foo\"; -> a := \"foo\"; display_msg(a); -> display_msg(a); b := \"bar\"; -> a := \"bar\"; display_msg(b); -> display_msg(a); . | namelist compression: Fallout stores the names of all file scope variables and procedures in a namelist which is saved into the .int. Any of these that are unreferenced can be removed, and the names of global variables can be modified to make them shorter. | . ",
+ "content": "The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn’t a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It’s primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops. There are several levels of optimization available: . | -O1 - Basic, only removes unreferenced variables and procedures, code itself remains untouched. | -O2 - Full, most code optimizations are on, but only those that were tested on complex scripts. | -O3 - Experimental, provides the most efficiency, but tends to break some complex code due to bugs. | . The following optimizations are performed: . | constant expression folding: if an expression depends only on values which are known at compile time, then the expression is replaced by its result. a := 2 + 2; -> a := 4; . | constant variable initialization: All variables are initialised to some value, (‘0’, if you don’t specify anything else,) so sslc attempts to make use of that fact to remove the first assignment to a variable if the first assignment is a constant expression. variable a; -> variable a := 4; a := 4; -> . | constant propagation: checks for values assigned to variables which can be computed at compile time, and replaces relevant references to the symbol by the constant. The original store is not removed by this optimization. Global variables are considered for this optimization only if they are not marked import or export, and are not assigned to anywhere in the script. a := 4; -> a := 4; foo(a); -> foo(4); . | dead code removal: Checks for and removes code which cannot be reached, either because it is hidden behind a return or because the argument to an if statement can be computed at compile time. if (True) then begin -> display_msg(\"foo\"); display_msg(\"foo\"); -> end else begin -> display_msg(\"bar\"); -> end -> . | unreferenced variable elimination: Checks for variables which are never referenced, and removes them. Also applies to global variables, as long as they are not marked for export. variable i, j, k; -> variable i; i := 1; -> i := 1; return; -> return; . | unreferenced procedure elimination: Checks for any procedures which are never called, and removes them. procedure foo begin return \"foo\"; end -> procedure foo begin return \"foo\"; end procedure bar begin return \"bar\"; end -> procedure start begin procedure start begin -> display_msg(foo); display_msg(foo); -> end end -> . | dead store removal: Removes variable assignments if the result of the variable is unused, and if the expression used to compute the value of the variable is provably free of side effects. (See pure keyword) a := \"moo\"; -> a := \"foo\"; a := \"foo\"; -> display_msg(a); display_msg(a); -> a := \"bar\"; -> . | store combination: Where there are two stores in a row to the same variable, the two expressions are combined. var1 := var2; -> var1 := var2 + var3; var1 += var3; -> . | variable combination: Where usage regions of variables do not overlap, combine the variables to provide additional candidates for unreferenced variable elimination. Very useful for scripts containing multiple foreach loops, which generate 2 or 3 hidden variables each. a := \"foo\"; -> a := \"foo\"; display_msg(a); -> display_msg(a); b := \"bar\"; -> a := \"bar\"; display_msg(b); -> display_msg(a); . | namelist compression: Fallout stores the names of all file scope variables and procedures in a namelist which is saved into the .int. Any of these that are unreferenced can be removed, and the names of global variables can be modified to make them shorter. | . ",
"url": "/sfall/optimization/#sslc--o-option",
"relUrl": "/optimization/#sslc--o-option"
@@ -1016,14 +1016,14 @@
},"145": {
"doc": "SSLC",
"title": "SSLC",
- "content": ". | Command line options | Additional supported syntax | Fixes | Backward compatibility | int2ssl note | . This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional script functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer. Unlike the original script compiler, this has not been compiled as a dos program. When using this in place of the original compile.exe but still using p.bat, you need to either get rid of the dos4gw.exe reference from p.bat or replace the original dos4gw.exe with the one in this archive. If you use Fallout Script Editor, you can extract compile.exe and dos4gw.exe to its \\binary folder, or extract them somewhere else and change your preferences in FSE to point there. FSE doesn’t seem to be able to tell when errors occur when using this compiler though, so I’d recommend either using sfall’s script editor instead or compiling by hand if possible. When compiling global or hook scripts for sfall 3.4 or below, you must include the line procedure start; before any #include files that define procedures to avoid a few weird problems. (this is no longer required starting from 3.5) . This version of compiler was designed primarily for new sfall functions, but it can safely (and is recommended) to be used with non-sfall scripts as well, as long as you don’t use any of the arrays syntax and any sfall script functions. The original unmodified sslc source is over here: https://teamx.ru/site_arc/utils/index.html . ",
+ "content": ". | Command line options | Additional supported syntax | Fixes | Backward compatibility | int2ssl note | . This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional script functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer. Unlike the original script compiler, this has not been compiled as a DOS program. When using this in place of the original compile.exe but still using p.bat, you need to get rid of the dos4gw.exe reference from p.bat. When compiling global or hook scripts for sfall 3.4 or below, you must include the line procedure start; before any #include files that define procedures to avoid a few weird problems. This is no longer required starting from 3.5. This version of compiler was designed primarily for new sfall functions, but it can be safely used (and is recommended) with non-sfall scripts as well. The original unmodified sslc source is over here: https://teamx.ru/site_arc/utils/index.html . ",
"url": "/sfall/sslc/",
"relUrl": "/sslc/"
},"146": {
"doc": "SSLC",
"title": "Command line options",
- "content": "-q don't wait for input on error -n no warnings -b backward compatibility mode -l no logo -p preprocess source -P preprocess only (don't generate .int) -F write full file paths in \"#line\" directives -O optimize code (full by default, see \"Optimization\" page) -O<N> set specific level of optimization (0 - off, 1 - basic, 2 - full, 3 - experimental) -d print debug messages -D output an abstract syntax tree of the program -o set output path (follows the input file name) -s enable short-circuit evaluation for all AND, OR operators -m<macro[=val]> define a macro named \"macro\" for conditional compilation -I<path> specify an additional directory to search for include files . The original command line option -w to turn on warnings no longer has an effect, since warnings are now on by default . ",
+ "content": "-q don't wait for input on error -n no warnings -b use backward compatibility mode -l no logo -p preprocess source -P preprocess only (don't generate .int) -F write full file paths in \"#line\" directives -O optimize code (full optimization, see \"Optimization\" page) -O<N> set specific level of optimization (0 - none, 1 - basic, 2 - full, 3 - experimental) -d print debug messages -D output an abstract syntax tree of the program -o set output path (follows the input file name) -s enable short-circuit evaluation for all AND, OR operators -m<macro>[=<val>] define a macro named \"macro\" for conditional compilation -I<path> specify an additional directory to search for include files . The original command line option -w to turn on warnings no longer has an effect, since warnings are now on by default . ",
"url": "/sfall/sslc/#command-line-options",
"relUrl": "/sslc/#command-line-options"
diff --git a/feed.xml b/feed.xml
index f2f66b0e..20b24428 100644
--- a/feed.xml
+++ b/feed.xml
@@ -1 +1 @@
-Jekyll2024-03-05T02:42:10+00:00/sfall/feed.xmlsfallSfall documentation
\ No newline at end of file
+Jekyll2024-03-11T02:26:49+00:00/sfall/feed.xmlsfallSfall documentation
\ No newline at end of file
diff --git a/optimization/index.html b/optimization/index.html
index 78ea3e47..96884271 100644
--- a/optimization/index.html
+++ b/optimization/index.html
@@ -1,4 +1,4 @@
-
The execution speed of scripts is not typically important in an unmodded game, given the difference in performance between a modern computer and what Fallout was designed for. When you start adding mods to the mix there’s the potential for problems again, since sfall’s global script system means that you can have a large amount of scripts being run every single frame.
sslc -O option
The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn’t a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It’s primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops.
There are several levels of optimization available:
-O1 - Basic, only removes unreferenced globals variables and procedures, code itself remains untouched.
-O2 - Full, most code optimizations are on, but only those that were tested on complex scripts.
-O3 - Experimental, provides most efficiency, but tend to break some complex code due to bugs.
The following optimizations are performed:
constant expression folding: if an expression depends only on values which are known at compile time, then the expression is replaced by its result.
a := 2 + 2; -> a := 4;
+ Optimization | sfallSkip to main contentLinkMenuExpand(external link)DocumentSearchCopyCopied
The execution speed of scripts is not typically important in an unmodded game, given the difference in performance between a modern computer and what Fallout was designed for. When you start adding mods to the mix there’s the potential for problems again, since sfall’s global script system means that you can have a large amount of scripts being run every single frame.
sslc -O option
The sfall build of sslc supports a -O command line option to perform an optimization pass over the generated code. This isn’t a magic make-my-code-go-faster bullet; most of what it does is very limited in scope. It’s primary purpose was to strip out the procedures and variables which get automatically pulled into every script that includes define.h, whether you use them or not, and to do something about the additional variables that get created by foreach loops.
There are several levels of optimization available:
-O1 - Basic, only removes unreferenced variables and procedures, code itself remains untouched.
-O2 - Full, most code optimizations are on, but only those that were tested on complex scripts.
-O3 - Experimental, provides the most efficiency, but tends to break some complex code due to bugs.
The following optimizations are performed:
constant expression folding: if an expression depends only on values which are known at compile time, then the expression is replaced by its result.
a := 2 + 2; -> a := 4;
constant variable initialization: All variables are initialised to some value, (‘0’, if you don’t specify anything else,) so sslc attempts to make use of that fact to remove the first assignment to a variable if the first assignment is a constant expression.
variable a; -> variable a := 4;
a := 4; ->
constant propagation: checks for values assigned to variables which can be computed at compile time, and replaces relevant references to the symbol by the constant. The original store is not removed by this optimization. Global variables are considered for this optimization only if they are not marked import or export, and are not assigned to anywhere in the script.
a := 4; -> a := 4;
diff --git a/sslc/index.html b/sslc/index.html
index cc4073fa..690f957a 100644
--- a/sslc/index.html
+++ b/sslc/index.html
@@ -1,18 +1,18 @@
- SSLC | sfallSkip to main contentLinkMenuExpand(external link)DocumentSearchCopyCopied
This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional script functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer.
Unlike the original script compiler, this has not been compiled as a dos program. When using this in place of the original compile.exe but still using p.bat, you need to either get rid of the dos4gw.exe reference from p.bat or replace the original dos4gw.exe with the one in this archive.
If you use Fallout Script Editor, you can extract compile.exe and dos4gw.exe to its \binary folder, or extract them somewhere else and change your preferences in FSE to point there. FSE doesn’t seem to be able to tell when errors occur when using this compiler though, so I’d recommend either using sfall’s script editor instead or compiling by hand if possible.
When compiling global or hook scripts for sfall 3.4 or below, you must include the line procedure start; before any #include files that define procedures to avoid a few weird problems. (this is no longer required starting from 3.5)
This version of compiler was designed primarily for new sfall functions, but it can safely (and is recommended) to be used with non-sfall scripts as well, as long as you don’t use any of the arrays syntax and any sfall script functions.
This is a modified copy of sslc, that has a few bugfixes from the original, that will recognise and compile the additional script functions provided by sfall, that can also understand some additional syntax, and that has an integrated preprocessor and optimizer.
Unlike the original script compiler, this has not been compiled as a DOS program. When using this in place of the original compile.exe but still using p.bat, you need to get rid of the dos4gw.exe reference from p.bat.
When compiling global or hook scripts for sfall 3.4 or below, you must include the line procedure start; before any #include files that define procedures to avoid a few weird problems. This is no longer required starting from 3.5.
This version of compiler was designed primarily for new sfall functions, but it can be safely used (and is recommended) with non-sfall scripts as well.
-q don't wait for input on error
-n no warnings
--b backward compatibility mode
+-b use backward compatibility mode
-l no logo
-p preprocess source
-P preprocess only (don't generate .int)
-F write full file paths in "#line" directives
--O optimize code (full by default, see "Optimization" page)
--O<N> set specific level of optimization (0 - off, 1 - basic, 2 - full, 3 - experimental)
+-O optimize code (full optimization, see "Optimization" page)
+-O<N> set specific level of optimization (0 - none, 1 - basic, 2 - full, 3 - experimental)
-d print debug messages
-D output an abstract syntax tree of the program
-o set output path (follows the input file name)
-s enable short-circuit evaluation for all AND, OR operators
--m<macro[=val]> define a macro named "macro" for conditional compilation
--I<path> specify an additional directory to search for include files
+-m<macro>[=<val>] define a macro named "macro" for conditional compilation
+-I<path> specify an additional directory to search for include files
The original command line option -w to turn on warnings no longer has an effect, since warnings are now on by default
Additional supported syntax
Syntax which requires sfall for compiled scripts to be interpreted is marked by asterisk (*).
Optional arguments in user-defined procedures. You can only use constants for default values. It basically puts those constants in place of omitted arguments.
new:
procedure test(variable x, variable y := 0, variable z := -1) begin
...
end