Skip to content

Commit eadee0f

Browse files
author
Florian Thake
committed
VERSION: 0.14.0 - TeaStackVM, Compiler, Dis-/Assembler, Suspend+Continue, Yield
... cooperative and preemptive multitasking capabilities with suspend + constraint. ... single step debugging, callstack and debug info for Tea StackVM Programs.
1 parent e03217d commit eadee0f

52 files changed

Lines changed: 6266 additions & 826 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Deprecation_and_Breaking_Changes.txt

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,26 @@ TeaScript Breaking Changes in the actual release
33

44
Changes in CoreLibrary functionality
55
------------------------------------
6-
strat() / CoreLibrary::StrAt() will now return strings of length [0..4] depending on the utf-8 code point char amount.
7-
It will always return a full and complete utf-8 encoded glyph. If the wanted pos is in the middle
8-
of an utf-8 code point this complete utf-8 code point will be returned.
6+
_exit() now takes any type of argument, it will be the result value of the script.
7+
A separated exit code is deprecated. A script will always have a result or NaV (Not A Value).
98

10-
readtextfile / CoreLibrary::ReadTextFile() will now do a complete UTF-8 validation of the read input.
11-
Also, it will not throw anymore but return Bool(false).
12-
9+
Script arguments are passed now as a Tuple "args" instead of "arg1", "arg2", ...
10+
The legacy form is available in the TeaScript Host Application via --legacy-args
11+
or when class Engine is used at compile time via define TEASCRIPT_ENGINE_USE_LEGACY_ARGS=1
1312

1413
Changes on C++ API level
1514
------------------------------------
16-
Util.hpp is splitted in 3 files: Util.hpp, UtilContent.hpp, UtilInternal.hpp.
17-
Most likely you still only need Util.hpp.
18-
19-
ASTNode::Eval() has been made const.
20-
21-
Parser::Num() throws exception::parsing_error instead of std::out_of_range
22-
23-
exception::bad_value_cast now inherits from exception::runtime_error (w. SoruceLocation) instead of std::bad_any_cast
24-
25-
Engine::AddVar/AddConst w. unsigned int overload now adds a U64 instead of I64
26-
(NOTE: If a future U32/I32 will be added this overloads (and those for int) will change again/as well!)
15+
Member mParser in class Engine is now in mBuildTools shared pointer.
16+
(was required for make 'opt-out header only' possible!)
2717

28-
Tuple is first class citizen now.
18+
Function and IntegerSequence are first class citizen now.
2919
This must be taken into account for a visitor applied to ValueObject::Visit.
3020

3121

3222
Visibility of Core Library functions
3323
------------------------------------
3424
The following Core Library functions moved up to Level CoreReduced:
3525

36-
_f64toi64
37-
3826
The following Core Library functions moved up to Level Core:
3927

4028
The following Core Library functions moved up to Level Util:
@@ -47,14 +35,6 @@ TeaScript list of deprecated parts
4735

4836
The following deprecated parts have been finally removed from this release:
4937

50-
bool Parser::Int( Content & )
51-
use Integer( Content & ) or Num( Content &, bool ) instead.
52-
53-
func eval( sth_unspecified ) from TeaScript Core Library (use the not confusing _eval( code_string ) variant instead)
54-
55-
56-
The following parts are now deprecated and will be removed in some future release:
57-
5838
Engine::ActivateDeprecatedDefaultMutableParameters()
5939
Please, change your script code to explicit mutable parameters with 'def' keyword.
6040
More deatails are available in the comment.
@@ -69,4 +49,17 @@ TeaScript list of deprecated parts
6949
Please, use InjectVars() instead.
7050

7151
Context( VariableStorage const &init, TypeSystem && rMovedSys, bool const booting )
72-
Please, uses a different constructor instead.
52+
Please, uses a different constructor instead.
53+
54+
55+
The following parts are now deprecated and will be removed in some future release:
56+
57+
CoreLibrary::ExitScript()
58+
directly issued control flow exceptions are deprecated, use either _exit() or the new _Exit statement instead.
59+
60+
exit( exit_code )
61+
use either _exit( Any ) or the new _Exit statement instead.
62+
A separated exit code is deprecated. A script will always have a result or NaV (Not A Value).
63+
64+
class Engine HasExitCode()/GetExitCode() and mExitCode
65+
A separated exit code is deprecated. A script will always have a result or NaV (Not A Value).

Known_Issues.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,10 @@ Beside feature incompleteness there are the following known issues which will be
55
NOTE: The numbers stay same, solved items will (usually) be removed in the next release from this list.
66

77

8-
3.) [PLATFORM: any] Solved in 0.13 (explicit cast to variuos number types is posible now with the as operator
9-
e.g., n as i64 or x as f64 )
10-
11-
12-
5.) [PLATFORM: Windows]
13-
Echo'ed(!) input of Unicode might be broken on Windows for the case if the Unicode glyph is
14-
assembled as a surrogate pair in it's UTF-16 representation. This is a bug (or missing feature)
15-
inside the WIN32 API. See https://developercommunity.visualstudio.com/t/Bug-in-WIN32-API-ReadConsoleW-for-UTF-16/10252965
16-
Echo'ed input is present when
17-
- typing commands / code in the interactive shell. (TeaScript Host Application only)
18-
- request user input via readline() function. (TeaScript Library and Host Application)
19-
20-
Nevertheless, the read in data is correctly stored in it's UTF-8 representation and can be used without problems,
21-
e.g. printing the read data later on the screen will be correct.
8+
5.) [PLATFORM: Windows] Solved!
9+
Turns out the broken echo'ed Unicode output was a bug in the Windows Terminal application.
10+
It is fixed in Windows Terminal 1.19.
2211

23-
Hint: Ensure you are using "Windows Terminal" together with either PowerShell or Command Prompt to experience
24-
the best possible Unicode support on Windows.
25-
2612

2713
6.) [PLATFORM: any]
2814
Parsing and/or Evaluation errors from inside in-string evaluation may show wrong source
@@ -32,15 +18,17 @@ NOTE: The numbers stay same, solved items will (usually) be removed in the next
3218
For TeaScript Library use Engine::SetDebugMode( true )
3319

3420

35-
7.) [PLATFORM: Linux with gcc or clang w. libstdc++]
21+
7.) [PLATFORM: Linux with gcc < 13 or clang w. libstdc++]
3622
Comparing values where at least one is a floating point and this value is not finite (e.g. NAN or infinity)
3723
will throw a teascript::exception::runtime_error. Actually, this exception cannot be caught within the
3824
TeaScript code.
39-
On Windows (Visual Studio) and clang w. libc++ a total strong ordering will be performed and the values can be compared.
25+
On Windows (Visual Studio) and clang w. libc++ and gcc >= 13
26+
a total strong ordering will be performed and the values can be compared.
4027

4128

42-
8.) [PLATFORM: Linux]
29+
8.) [PLATFORM: Linux with clang or gcc < 13]
4330
CoreLibrary function clock_utc() will return UTC time _without_ leap seconds.
31+
WORKAROUND: Use gcc >= 13 on Linux.
4432

4533

4634
10.) [PLATFORM: any]
@@ -50,5 +38,17 @@ NOTE: The numbers stay same, solved items will (usually) be removed in the next
5038
WORKAROUND: since 0.11.0 Subscript Operator is implemented, use tup[0].1 or tup[0][1] as a workaround.
5139

5240

53-
13.) -
41+
13.) [PLATFORM: Linux with clang and libc++]
42+
Sending a Suspend Request from another thread to a running program (compiled TeaScript Binary (.tsb))
43+
in the TeaStackVM is not possible due to the lack of the C++20 library feature std::stop_source|token.
44+
WORKAROUND: Use gcc/g++ on Linux, ideally >= version 13.
45+
46+
47+
14.) [PLATFORM: any]
48+
In compile mode: A stop or loop statement referencing an outer loop from an inner loop
49+
is not possible when issued from inside an operand of a unary,binary operator or subscript operator.
50+
However, this is actually possible in evaluation mode but it is dicouraged to use (looks like dirty code!).
51+
E.g., the following code evaluates but is broken when compiled:
52+
def tup := (1,2,3,4)
53+
repeat "test" { print( tup[ repeat { stop "test", 1 } ] ) }
5454

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<NotepadPlus>
2+
<UserLang name="TeaScript Dark" ext="tea" udlVersion="2.1">
3+
<Settings>
4+
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
5+
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
6+
</Settings>
7+
<KeywordLists>
8+
<Keywords name="Comments">00// 01 02 03/* 04*/</Keywords>
9+
<Keywords name="Numbers, prefix1"></Keywords>
10+
<Keywords name="Numbers, prefix2">0x</Keywords>
11+
<Keywords name="Numbers, extras1">A B C D E F a b c d e f</Keywords>
12+
<Keywords name="Numbers, extras2"></Keywords>
13+
<Keywords name="Numbers, suffix1"></Keywords>
14+
<Keywords name="Numbers, suffix2">u8 u64 i64 f64</Keywords>
15+
<Keywords name="Numbers, range"></Keywords>
16+
<Keywords name="Operators1">:= == &gt;= &lt;= &gt; &lt; != + - * / @= @@ @?</Keywords>
17+
<Keywords name="Operators2">eq ne gt lt ge le bit_and bit_or bit_xor bit_not bit_lsh bit_rsh</Keywords>
18+
<Keywords name="Folders in code1, open">{ ( [</Keywords>
19+
<Keywords name="Folders in code1, middle">,</Keywords>
20+
<Keywords name="Folders in code1, close">} ) ]</Keywords>
21+
<Keywords name="Folders in code2, open"></Keywords>
22+
<Keywords name="Folders in code2, middle"></Keywords>
23+
<Keywords name="Folders in code2, close"></Keywords>
24+
<Keywords name="Folders in comment, open"></Keywords>
25+
<Keywords name="Folders in comment, middle"></Keywords>
26+
<Keywords name="Folders in comment, close"></Keywords>
27+
<Keywords name="Keywords1">if else repeat forall in is as typename typeof func def const undef is_defined debug with stop loop return mod not or and false true suspend yield _Exit</Keywords>
28+
<Keywords name="Keywords2">TypeInfo i64 f64 u8 u64 Bool String Function Tuple IntegerSequence NaV Number Const Buffer</Keywords>
29+
<Keywords name="Keywords3"></Keywords>
30+
<Keywords name="Keywords4"></Keywords>
31+
<Keywords name="Keywords5"></Keywords>
32+
<Keywords name="Keywords6"></Keywords>
33+
<Keywords name="Keywords7"></Keywords>
34+
<Keywords name="Keywords8"></Keywords>
35+
<Keywords name="Delimiters">00&quot; 01\ 02&quot; 03&quot;&quot;&quot; 04 05&quot;&quot;&quot; 06# 07 08((EOL)) 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
36+
</KeywordLists>
37+
<Styles>
38+
<WordsStyle name="DEFAULT" fgColor="C0C0C0" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
39+
<WordsStyle name="COMMENTS" fgColor="808000" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
40+
<WordsStyle name="LINE COMMENTS" fgColor="808000" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
41+
<WordsStyle name="NUMBERS" fgColor="18BFD1" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
42+
<WordsStyle name="KEYWORDS1" fgColor="0080FF" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
43+
<WordsStyle name="KEYWORDS2" fgColor="8080FF" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="1" nesting="0" />
44+
<WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
45+
<WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
46+
<WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
47+
<WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
48+
<WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
49+
<WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
50+
<WordsStyle name="OPERATORS" fgColor="FFFF80" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="1" nesting="0" />
51+
<WordsStyle name="FOLDER IN CODE1" fgColor="C0C0C0" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
52+
<WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
53+
<WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
54+
<WordsStyle name="DELIMITERS1" fgColor="FF8080" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
55+
<WordsStyle name="DELIMITERS2" fgColor="FF8080" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="0" nesting="0" />
56+
<WordsStyle name="DELIMITERS3" fgColor="8080C0" bgColor="3F3F3F" fontName="Cascadia Mono" fontStyle="1" nesting="0" />
57+
<WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
58+
<WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
59+
<WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
60+
<WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
61+
<WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
62+
</Styles>
63+
</UserLang>
64+
</NotepadPlus>

TeaScript_SyntaxHighlighting_Notepad++.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<Keywords name="Folders in comment, open"></Keywords>
2525
<Keywords name="Folders in comment, middle"></Keywords>
2626
<Keywords name="Folders in comment, close"></Keywords>
27-
<Keywords name="Keywords1">if else repeat forall in is as typename typeof func def const undef is_defined debug with stop loop return mod not or and false true suspend yield</Keywords>
27+
<Keywords name="Keywords1">if else repeat forall in is as typename typeof func def const undef is_defined debug with stop loop return mod not or and false true suspend yield _Exit</Keywords>
2828
<Keywords name="Keywords2">TypeInfo i64 f64 u8 u64 Bool String Function Tuple IntegerSequence NaV Number Const Buffer</Keywords>
2929
<Keywords name="Keywords3"></Keywords>
3030
<Keywords name="Keywords4"></Keywords>

0 commit comments

Comments
 (0)