Welltype
Related resources
- The Tomb instruction set
- MD5 library
for v0.9.3.2 |
for v0.9.3.0 |
for v0.9.2.9
Changes in v0.9.3.2
v0.9.3.2
2017.03.12. (r5451)
- Fixed a compiler error: full path names were handled incorrectly.
- Fixed an error in the readwtb: the mutable
seq types were displayed incorrectly.
- Added new functions to classify characters:
- function iscntrl(char) : bool;
- function isprint(char) : bool;
- function isspace(char) : bool;
- function isblank(char) : bool;
- function isgraph(char) : bool;
- function ispunct(char) : bool;
- function isalnum(char) : bool;
- function isalpha(char) : bool;
- function isupper(char) : bool;
- function islower(char) : bool;
- function isdigit(char) : bool;
- function isxdigit(char) : bool;
- New compiler options were introduced:
- -signed-index: enable the usage of signed
integers as indices
- -no-signed-index: disable the usage of signed
integers as indices (default)
- -large-index: enable the usage of 64-bit
integers as indices
- -no-large-index: disable the usage of 64-bit
integers as indices (default)
- Indexing sequences and strings is now supported with
all integer types (there an automatic conversion
will take place to u32):
- u8
- i8 (with -signed-index;
may cause ConstraintErrorException)
- u16
- i16 (with -signed-index;
may cause ConstraintErrorException)
- u32 (original indexing type)
- i32 (with -signed-index;
may cause ConstraintErrorException)
- u64 (with -large-index;
may cause ConstraintErrorException)
- i64 (with -signed-index and -large-index;
may cause ConstraintErrorException)
Changes in v0.9.3
v0.9.3.0
2017.02.05. (r5393)
- Introduced the record update syntax: ( expression ) { field_assignments }.
- Fixed a compiler error: a part was missing from the generated
code for the return statements (if the frame had local objects
on the stack).
- Fixed a runtime error: the loader handled the records wrong,
and falsely returned an AMBIG when the first fields
was the same in two different records.
- Added new functions:
- impure function fread(file, seq<T>) : u32;
- impure function fwrite(file, seq<T>);
Where T can be: i16, u16,
i32, u32, f32,
i64, u64, f64.
Changes in v0.9.2.9
v0.9.2.9
2016.12.27. (r5148)
- Fixed a compiler error: there was a glitch in the return
coverage checker, and it missed the if statements
without an else branch.
- Fixed a compiler error: nested function calls were not tested,
which was a problem i.e. in case of succ().
- Fixed a compiler error: the generated code for the functions
succ(), pred(), tos(enum) and
toenum() has been fixed.
- Fixed a compiler error: the compiler crashed if a function
with no return type used in assignment.
- Fixed a compiler error: impure functions given as argument
were callable from a pure function. The compiler now
displays an error for this.
- Fixed a runtime error: simultaneously started wt
instances are no longer exit with LFAIL on Linux.
- Fixed a runtime error: there was a glitch in the cleanup code,
causing an infinite loop in the wtgl program (the
wtgl is not released yet).
- Added new functions:
- impure function freadstr(file, char) : string;
- impure function fread(file, seq<i8>) : u32;
- impure function fread(file, seq<u8>) : u32;
- impure function fwrite(file, seq<i8>);
- impure function fwrite(file, seq<u8>);
Changes in v0.9.2.8
v0.9.2.8
2016.11.27. (r5082)
- Introduced new built-in types:
- i8 / byte
- u8 / ubyte
- i16 / short
- u16 / ushort
- Numerous new functions introduced for the new built-in types.
- Fixed a compiler error: the compiler crashed when a datatype contained
a sequence of the same datatype that is in.
- Fixed a compiler error: fixed an infinite loop when computing attributes
of a datatype.
- Fixed a compiler error: due to an errorneous condition sequences formed
from 64-bit wide type were unusable in foreach.
- Fixed the f32atan2, the f64atan2, the f32pow
and the f64pow microprograms.
- New compiler option to disable the effect of -labels-top
and -labels-all: -labels-none.
- Added new functions:
- function "+"(char, i8) : char;
- function "+"(char, u8) : char;
- function "+"(char, i16) : char;
- function "+"(char, u16) : char;
- function "+"(char, u32) : char;
Changes in v0.9.2.5
v0.9.2.5
2016.03.18. (r4922)
- Record types store field names in the binary, and these names will be loaded
into the runtime environment. Dynamic loader will validate record imports.
- Slightly modified internal representation of the enumeration type.
- Name of an enumeration type cannot be s anymore,
because the generated functions will conflict with the built-in functions.
Changes in v0.9.2.3
v0.9.2.3
2016.03.06. (r4908)
- Added enumeration type support.
- The syntax of the data type literal modified. Its syntax is now clear, and not confusing.
The rule DATACONS expression changed to
DATACONS { expression } (like the record literal).
- Performance improvement in the virtual machine: some parts are rearranged; new instruction
has introduced; a frequently used instruction has optimized.
- Resource safety was not guaranteed in some cases.
- Fixed an indeterminism in the compiler: occasionally AST nodes were ordered by its
addresses, and caused invalid sequences in the binary.
- Fixed a compiler error: Wrong destructor code were generated for the
file and dir types.
Changes in v0.9.2
v0.9.2.0
2015.12.27. (r4735)
- Data type optimization: A reference counter is stored in the data type
instances, and this counter is incremented when it is copied, and decremented
when deleted. The actual delete is performed when the counter reached
zero.
- The parser recognizes the UTF-8 BOM at the beginning of the file.
- Fixed a compiler error: Invalid code was generated for the data type default
constructor.
- Fixed a compiler error: The compiler crashed when parsed a data type constructor
with invalid initialization expression.
- Fixed a compiler error: The compiler generated invalid code for deleting
incomplete data types and records.
- Fixed a compiler error: Compiler forbid indexing, copying and returning
mutable strings.
- All other discovered minor bugs was fixed in the parser and in the compiler.
- Fixed a bug in the virtual machine: Sometimes the string length was incorrect,
and caused unexpected strings during the runtime.
- Fixed a bug in the virtual machine: On 64-bit systems, the data types could be
loaded onto unaligned area, and it is corrupted the representation.
- Fixed a bug in the virtual machine: There was a defect in the memory manager that
caused memory leak and resource leak.
- A compile error will be raised when a variable initialization contains
self-reference. Previous compilers accepted this, and caused runtime anomalies.
- New implementation for the function sqrt(u32) : u32;
function. In order to make things deterministic, the
function sqrt(i32) : i32; also uses the new implementation.
- The
function strcpy(mutable string, u32, string, u32, u32);
is no longer impure, the first parameter is mutable,
and handles overlapped operations correctly.
- Fixed a compiler error: The compiler merged import
and export sections too aggressively. This caused
inconsistent Welltype Binaries in some extraordinary cases. The compiler
now keeps the original import and export order, and merges sections much less
aggressively.
- New flag in the wtc program:
-add-hash ALGNAME. This flag adds
INTEGRITY sections based on the
ALGNAME hash algorithm. Duplicate algorithms
are ignored.
- The compiler inlines 32-bit and 64-bit constants by default. But it can be overridden
with the new -no-inline-32 and with the
-no-inline-64 flags.
- New flag in the wt program:
-i to verify integrity sections on loading binaries.
- Added optional (or not so optional) integrity sections into the Welltype Binary.
- Added new string functions:
- function strstr(string, u32, string) : u32;
- function strrstr(string, u32, string) : u32;
- function fromutf8(string) : string; (converts UTF-8
string to ANSI code page; can raise
UnicodeErrorException exception)
- function toutf8(string) : string; (converts ANSI
string to UTF-8 string; affects only code points above 127)
- Added new file handler function:
impure function faccess(string, i32) : bool; to check access rights.
Changes in v0.9.1.7
v0.9.1.7
2015.11.09. (r4458)
- Limited records are no longer copyable when imported. However, make a copy
from a limited record is still possible, but must be done on the exporter
side. This gives more control over the limited records. Note that, all types
encapsulates an imported limited record (or just an uncopyable type) will be
uncopyable as well.
- Fixed a compiler error: wrong code were generated for copying
file and dir type.
- Fixed a compiler error: functions were not collected when forward declared and
used only in global initialization before defined.
- Added new string functions:
- function chars(char, u32) : string;
- function chars(char, u32, string) : string;
- function copies(string, u32) : string;
- function copies(string, u32, string) : string;
- impure function strcpy(string, u32, string, u32, u32);
- function strstr(string, string) : u32;
- function strrstr(string, string) : u32;
- function strchr(string, char) : u32;
- function strchr(string, u32, char) : u32;
- function strrchr(string, char) : u32;
- function strrchr(string, u32, char) : u32;
- function strspn(string, string) : u32;
- function strspn(string, u32, string) : u32;
- function strcspn(string, string) : u32;
- function strcspn(string, u32, string) : u32;
- function strtok(string, string) : seq<string>;
Changes in v0.9.1.5
v0.9.1.5
2015.10.22. (r4289)
- Added limited record support. Limited records are basically the same as
private records, but they are not default constructible when imported.
- The file and the dir
types are now not default constructible objects. The
function fclose(file); and the
function closedir(dir); are no longer available,
since the files and directories are closed automatically. Furthermore,
they can be copied, and the copy will refer to exactly the same file and
directory handle.
- Exception handlers and finally blocks can no
longer access to local variables.
- Fixed a bug in the runtime. This bug occured rarely, and caused
misinterpreted object references. Thus, this bug can cause a segfault.
- Fixed the function pointer call. Empty parameter list were always accepted
as valid argument.
- The version of the compiler suite is now in the binary, thus the loader
and the readwtb can verify it.
- The compiler now validates the mutable property
when creating a function pointer.
- Fixed a compiler error: calling operators and functions with the string
syntax was not recognized (e.g. the
"+"(3, 4) expression caused compilation error).
- Fixed a compiler error: not default constructible types were not always
detected in the global block.
- Added a new conversion function (the other conversion functions have similar
identity conversion as well):
function tochar(char) : char;.
- Added a new sequence function:
function empty(seq<T>) : bool;.
- Added pseudorandom number generator functions:
impure function rand() : u32;,
impure function randf() : f32;, and
impure function srand(u32);.
- Added new string functions:
function substr(string, u32) : string;,
function empty(string) : bool;,
function startswith(string, string) : bool;, and
function endswith(string, string) : bool;.
- Change builtin behavior of function trim(string) : string;.
Now trims all characters with code below or equal to the code of the
space character.
Changes in v0.9.1.4
v0.9.1.4
2015.10.11. (r4165)
- Function types are introduced. These types can be imported and exported,
and this type is not default constructible. The syntax is the following:
type FUNCTIONSIGNATURE ;,
where the FUNCTIONSIGNAURE is the usual
function signature syntax. The function type expression syntax is:
FUNCTIONTYPENAME ( IDENTIFIER ) or
FUNCTIONTYPENAME ( STRINGLITERAL ), where
- FUNCTIONTYPENAME is a name of a
function type;
- IDENTIFIER is a name of a function;
- STRINGLITERAL is an operator symbol.
This expression is called .
Calling a function pointer is the same as calling a regular function.
A function type cannot be assigned when formal parameters are involved.
A global data, or part of it cannot be passed to a function pointer
which is originated from a formal parameter. Finally, function pointer
what is originated from a formal parameter cannot be stored to any
local variable.
- Data types are not require default constructor
anymore, but a data type without default
constructor cannot be automatically initialized. These new data types
are , otherwise
there are .
This property is inherited by records.
- Fixed a compile error which occured when switch-case
was used.
- Added eight conversion functions: function tochar(i32) : char;,
function tochar(u32) : char;,
function tochar(i64) : char;, and
function tochar(u64) : char; -- and the reverse direction:
function toi32(char) : i32;,
function tou32(char) : u32;,
function toi64(char) : i64;, and
function tou64(char) : u64;.
Changes in v0.9.1.3
v0.9.1.3
2015.10.02. (r4008)
- A code generation problem has been fixed: In case of multiple
global blocks only the first one was evaluated.
The other blocks were also generated, but as an unreachable code.
Changes in v0.9.1.2
v0.9.1.2
2015.08.31. (r3983)
- The parser did not handled correctly the '\b' character, and
did not support the '\v' character.
- Added two string functions: function trim(string s) : string; and
function trim(string s, string ignore_set) : string;.
- Added string comparison operators:
<, <=, ==, !=, >=, >
- Data type constructor names can be used in different data types
without compile error. But the ambiguous data type constructors
must be qualified with the data type name.
- The readwtb raw data display is now 80
characters wide.
- Fixed a compiler error. When user ctor block and data types were created in
the global block, the user ctor block did not executed.
- The loader matches the name of the data type constructors.
Changes in v0.9.1
v0.9.1.0
2015.05.01. (r3931)
- Added data type support with data type literals.
- Added endianness query and conversion functions.
- New boolean funcion pure function "^"(bool, bool) : bool.
- New character functions: pure function tolower(char) : char
and pure function toupper(char) : char.
- Fixed a critical error in the loader (return value types were not matched).
- The --version option added to the compiler.
- The wt program will now set the exit code
when the executed program generated an error.
- Unused global variables are ignored by the compiler.
- Some corrections in the data sheet.
Changes in v0.9.0.7
v0.9.0.7
2015.02.02. (r3714)
- Added record literal support.
- Fixed a problem when executing the runtime on Linux with single-processor systems.
- Fixed identifier resolution (an identifier can be a type name, an operator, or
a simple identifier).
- Improved integer literal validation.
- Fixed an allocation error in readwtb.
- Fixed a critical error in the runtime.
- Unary "+" and unary "-" for f32
and f64 types.
- The unhandled exceptions were not reraised.
- Fixed the import include generator. Written function declarations were incomplete.
- The unresolved externals will be displayed in the error log, instead of
terminating the compiler without any details.
- Fixed a compiler error. When the return value contained object and scalar,
then the compiler reached an internal error.
Changes in v0.9.0.4
v0.9.0.4
2014.11.30. (r3269)
- Added sequence literal support.
- Import include generation is available again
( and
options).
- Shebang support in .wtb binaries. The compiler
can place the shebang line with the
option.
- Some improvements in the runtime API.
- Some compiler improvements when processing pre
and post.
- The AssertionFailedException, the
PreconditionViolationException, and the
PostconditionViolationException exceptions will not be
included in the binary when the related features are disabled
(-disable-asserts -disable-precond -disable-postcond).
- The raise statement is counted in the return coverage.
- The compiler crashed when invalid expressions are used with
and .
(Reported by Tibor Brunner)
- Fixed the help screen of the compiler and the runtime.
Initial version: v0.9
v0.9.0.0
2014.11.13. (r3179)
- The functionality is almost the same as the previous ScriptKernel v0.8.2.8,
but there are some changes in the syntax and in the semantics.