Jule 0.0.15
Language
- add: short variable declaration syntax
- remove: the built-in
swap
method of slice and array types - remove: deriving and cloning
- update: data types are considered as built-in type aliases instead of keywords
- update: slicing behavior of slices
- update: traits are considered as mutable type
- update: consider
true
,false
andnil
keywords as built-in constant variables and imagine keywords - update: strings are immutable now and performs rerefence-counting
- update: static variables cannot be reference
- update: syntax of comptime matching and comptime iterations
Compiler
- numerous optimizations, improvements and minor fixes
- add: the
--opt-slice
,--opt-assign
, and--opt-exceptional
optimization flags - fix: C++20 support
- fix: code generation for tuple-type declarations, thanks @sparky4pro and
_lex
for pointing to the issue - fix: some backend compilers may cause compile error when unicode identifiers used on some platforms
- fix: code generation will not generate string literals with literal-special algorithm for structure ostream
- fix: code generation for multi-assign statements with tuple-return functions including traits and any types
- update:
--opt-str
optimization, removed some optimizations because of new immutable strings - improve: the
--opt-append
optimizations for self-append l-value expressions - improve: the
--opt-cond
,--opt-math
,--opt-str
,--opt-deadcode
and--opt-ptr
optimizations - lex: fix
IsAssign
function reportstrue
for the dot token - lex: fix
IsBinOp
function reportsfalse
for sometrue
tokens - parser: fix type-enum item parsing
- parser: fix structure field parsing may cause runtime crash due to source code including missing type
- error for the field
- parser: caught keywords used in use declarations
- sema: fix type declaration handling from unary expression
- sema: fix compiler crash during constant matching analysis with zero-statement case
- sema: fix case handling of comptime-matching, remove all cases if any case is not matched
- sema: fix default case handling comptime-matching, avoid making analysis without checking existing case matches
- sema: fix handled unexceptional built-in functions are not causes compile error
- sema: fix dynamic type annotation for generic function calls allows nil-literals
- sema: fix
comptime::ValueOf
function allows nil-literals - sema: fix illegal cycle caught algorithm for types
- sema: fix mutability analysis of unary expressions
- sema: fix declarative-multi-assign statement may cause runtime crash with single expression
- sema: fix mutable data sharing is allowed even field is accessible between copies within scope of the interior mutability
- sema: fix lvalue analysis of indexing epxressions
- sema: fix type analysis of the built-in
make
function accepts all types - sema: fix entry point and init functions can take the
#deprecated
directive - sema: fix evaluation of type declarations
- sema: fix reference collection for generic functions
- sema: fix type compatibility analysis and handling of untyped literals
- sema: caught responsive-immutable struct literals for mutable operations and interior mutable memory
- sema: caught blank identifier use declaration aliases and link paths
- sema: minor improvements for constant expression evaluation:
- Improvement: don’t remove constant status of string-enum to string casting expressions
- Convert at comptime: constant-string to byte-slice casting expressions
- Convert at comptime: constant-string to rune-slice casting expressions
- Convert at comptime: constant-byte to string casting expressions
- Convert at comptime: constant-rune to string casting expressions
Standard Library
- numerous optimizations, improvements and minor fixes
- add: std::unsafe
- reimplement: std::jule::constant::lit
- std::fs: remove the
WriteStr
method ofFile
- std::io: remove the
WriteStr
method of theByteStream
andFileStream
- std::comptime: rename
Kind.Ref
asKind.SmartPtr
- std::comptime: add the
Match
,TypeAlias
,Line
,File
, andFiles
functions - std::comptime: remove the
Range
functions - std::comptime: add the
RC
method tocomptimeTypeInfo
- std::encoding::base64: fix encode(decode length calculation may cause crash because of zero-length allocation
- std::encoding::base32: fix encoding without padding
- std::encoding::base32: add the
EncodeLen
andDecodeLen
functions - std::encoding::base64: add the
EncodeLen
andDecodeLen
functions - std::encoding::ascii85: rename the MaxEncodedLen function as MaxEncodeLen
- std::jule::lex: remove the
IsOk
method of theFile
- std::jule::ast: remove the
IsPrim
method of theIdentTypeDecl
- std::jule::ast: remove the
IsSelf
field of theSubIdentExpr
- std::jule::ast: rename
BinopExpr
asBinaryExpr
- std::jule::sema: remove the
IsBuiltin
method ofTrait
- std::jule::sema: remove the
CommonIdentExprModel
andCommonSubIdentExprModel
- std::jule::sema: rename
BinopExprModel
asBinaryExprModel
- std::jule::sema::types: remove the all
IsCompatible
variants - std::unicode::utf8: rename the
UtfMax
constant asUTFMax
- std::math: rename the
Fma
function asFMA
- std::strings:: add the
StrBuilder
- std::math::big: use constraints for the
Int.New
static method - std::flag: use constraints for the
Add
andAddVar
functions - std::jule::integrated: rename the
Utf16FromStr
function asUTF16FromStr
- std::jule::integrated: rename the
Utf16ToStr
function asUTF16ToStr
- std::jule::integrated: add the
StrToBytes
function
API
- fix:
jule::to_str<T>
function define declared asjule::to_str2<T>
- fix:
std::mem::Free
function support of thejule::Trait<Mask>
andjule::Any
- fix: wrong declaration of
jule::utf16_decode
- fix: interoperability compatibility of mutable slicing algorithm of
jule::Str
- remove:
#derive Clone
implementations jule::Str
: reimplemented as immutable length-based (not NULL termination based) stringjule::Slice<Item>
: add thevoid append(const jule::Slice<Item>&)
methodjule::Slice<Item>
: remove theswap
methodjule::Array<Item, N>
: remove theswap
method
Legacy Support
This version contains many bug fixes so updating is highly recommended. However, if you update it, your old codes may not compile and some performance problems may occur. For compilation issues, you need to update your code accordingly.
Here are some official tips for performance and interoperability issues:
First of all, there is not much change that could cause performance degradation. Therefore, there is only one specific point you need to look at: strings. Strings cause performance degradation mostly in concatenation operations. Since Jule used mutable strings in previous versions, it could handle this quite efficiently, but now immutable strings are used. Therefore, the cost of merging operations is significantly higher. For strings that you do a high amount of concatenation, use the StrBuilder
structure provided by the std::strings
package. This structure is designed to concatenate strings and treat them as a single string and should largely prevent performance loss.
Review where you rely on automatic conversion of strings for interoperability, otherwise some errors may occur in your program. This is because strings are now length-based rather than NULL terminated. This can lead to various errors due to the lack of NULL termination, especially when working with C-strings. For a safe conversion, the StrToBytes
function is provided by the std::jule::integrated
package. It is highly recommended to use this function for conversion.
If you are wondering why new strings are designed to be length-based rather than NULL termination, despite the risk of causing interoperability problems, it is recommended that you read this section in the manual: About Interoperability and Type Compatibility - Strings.
About Releases
Previous versions were marked as pre-release. It will no longer be marked. Since the bugs have been largely resolved and Jule is mature enough to be used for many tasks, it has been decided that beta versions will no longer be marked as pre-release. So this doesn't mean Jule is stable now. Compiler and standard library still may have some important bugs since Jule is still in beta.