-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstructions.txt
129 lines (86 loc) · 5.42 KB
/
instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
Instructions for the TeaScript C++ Library (Standard version)
==============================================================
Please, also read the COPYRIGHT.TXT for several licensing information.
Table of Content
=====================
- Supported compiler
- Dependencies
- Optional features
- Compiling demo app
- Opt-out header only
- Useful Links
Supported compiler (tested with):
Visual Studio 2022 (17.2 or newer) -- Visual Studio 2019 also works (starting from 16.11.14)
g++ 11.3 -- Use g++ 13 for all linux specific known issues are solved (see Known_Issues.txt)
clang 14 (with libstdc++ or libc++) -- There are clang and/or libc++ specific known issues (see Known_Issues.txt)
Newer compilers should work in general.
All compilers are compiling in C++20 and for x86_64.
Dependencies:
None - for fully C++20 supporting compilers / C++ standard libraries.
Libfmt (as header only) - for gcc 11 / clang 14 (tested with libfmt 11.0.2, 10.2.1 and 10.1.1)
Libfmt can be downloaded here https://fmt.dev/latest/index.html
You only need to set the include path in your project(s) / for compilation. Detection is then done automatically.
HINT: For Windows with C++20 it is also recommended to use libfmt for the best possible Unicode support for stdout.
Also, if you want the format and/or color feature (see below) libfmt is required.
Opt-out header only when use libfmt: If you use libfmt elsewhere and you use it not as header only lib, you do this
for TeaScript as well by defining TEASCRIPT_DISABLE_FMT_HEADER_ONLY to 1 (project wide or prior any TeaScript include).
Optional Features:
Web Preview - In order to enable the Web Preview module the following steps have to be done:
1.) Add include <TeaScriptRoot>/modules/include/
2.) Add include to the Boost Library.
3.) Add modules/WebPreview.cpp to your project compilation.
4.) (Optional) If you want the default Engine loads the WebPreview module set the define TEASCRIPT_ENGINE_USE_WEB_PREVIEW to 1.
TOML Support - for the integrated TOML Support you need the toml++ Library.
You can find the toml++ library here: https://github.com/marzer/tomlplusplus (tested with 3.4.0)
You only need to set the include path in your project(s) / for compilation. Detection is then done automatically.
See include/teascript/TomlSupport.hpp for some more details.
Color and Format String Support - for colorful output and the format string feature you need the libfmt library.
See Libfmt section above.
JsonAdapter - You can change the Json library which is used by TeaScript to one of nlohmann::json, RapidJson or Boost.Json.
Per default PicoJson is used and is enabled by default.
For use a different adapter you must do the following steps:
1.) Add include to <TeaScriptRoot>/extensions/include/.
2.) Add the corresponding JsonAdapter.cpp to your project, e.g., extenstions/JsonAdapterNlohmann.cpp
3.) Add include for the json library of use, e.g., <rootpath>/nlohmann_3.11.3/single_inlude/
4.) Set the define TEASCRIPT_JSON_FLAVOR to the desired Json flavor, e.g., TEASCRIPT_JSON_NLOHMANN
For building the demo app:
Windows: Use the provided VS-project or the settings in compile.props.
If you make a new project, you only need to add the files teascript_demo.cpp,
suspend_thread_demo.cpp and coroutine_demo.cpp and set the include path to <package_root>/include/
Linux: Use the compile_gcc.sh or compile_clang.sh with prior updated include path to libfmt.
Other: Try the way described for Linux. Maybe it will work.
You can test the demo app by invoking it via the provided gcd.tea:
Windows:
./teascript_demo.exe gcd.tea 18 42
Linux:
./teascript_demo gcd.tea 18 42
If you see 6 as the result everything is functional.
Opt-out header only compilation:
The TeaScript C++ Library will be compiled as a header only library per default.
For save includes and compile time it is possible to opt-out header only compilation.
For opt-out header only compilation one translation unit (TU) must be chosen where
all the definitions will go. This can either be an existing TU of your project or simply
make a new one.
The TU for the TeaScript definitios must ensure that these 2 defines are defined prior
any TeaScript include:
#define TEASCRIPT_DISABLE_HEADER_ONLY 1
#define TEASCRIPT_INCLUDE_DEFINITIONS 1
After that you must include the desired definitions of class Engine and/or class CoroutineScriptEngine:
#include "teascript/Engine.hpp"
#include "teascript/CoroutineScriptEngine.hpp"
All other TU's, where TeaScript includes are done, need the define TEASCRIPT_DISABLE_HEADER_ONLY=1 prior any TeaScript include.
(You can set this project wide also.)
When opt-out header only compilation you save (at least) the huge includes in all TU's except one of the files
CoreLibrary.hpp, StackMachine.hpp, StackVMCompiler.hpp, Parser.hpp, ParsingState.hpp and ASTNode.hpp
(except if you need and include it by your self.)
You can see an example of opt'ed out header only in teascript_demo.cpp and its companion files.
Using the Library / API:
Have a look at the provided teascript_demo.cpp for some example usage of the API.
For TeaScript in general you can find documentation here:
https://tea-age.solutions/teascript/overview-and-highlights/
https://tea-age.solutions/teascript/teascript-language-documentation/
If you encounter bugs or problems, have feature wishes or any other question you may contact:
contact |at| tea-age.solutions
Florian Thake
TeaAge Solutions
https://tea-age.solutions