Skip to content

Jule 0.0.15

Compare
Choose a tag to compare
@mertcandav mertcandav released this 17 Aug 10:27
· 907 commits to master since this release

Language

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 reports true for the dot token
  • lex: fix IsBinOp function reports false for some true 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 of File
  • std::io: remove the WriteStr method of the ByteStream and FileStream
  • std::comptime: rename Kind.Ref as Kind.SmartPtr
  • std::comptime: add the Match, TypeAlias, Line, File, and Files functions
  • std::comptime: remove the Range functions
  • std::comptime: add the RC method to comptimeTypeInfo
  • 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 and DecodeLen functions
  • std::encoding::base64: add the EncodeLen and DecodeLen functions
  • std::encoding::ascii85: rename the MaxEncodedLen function as MaxEncodeLen
  • std::jule::lex: remove the IsOk method of the File
  • std::jule::ast: remove the IsPrim method of the IdentTypeDecl
  • std::jule::ast: remove the IsSelf field of the SubIdentExpr
  • std::jule::ast: rename BinopExpr as BinaryExpr
  • std::jule::sema: remove the IsBuiltin method of Trait
  • std::jule::sema: remove the CommonIdentExprModel and CommonSubIdentExprModel
  • std::jule::sema: rename BinopExprModel as BinaryExprModel
  • std::jule::sema::types: remove the all IsCompatible variants
  • std::unicode::utf8: rename the UtfMax constant as UTFMax
  • std::math: rename the Fma function as FMA
  • std::strings:: add the StrBuilder
  • std::math::big: use constraints for the Int.New static method
  • std::flag: use constraints for the Add and AddVar functions
  • std::jule::integrated: rename the Utf16FromStr function as UTF16FromStr
  • std::jule::integrated: rename the Utf16ToStr function as UTF16ToStr
  • std::jule::integrated: add the StrToBytes function

API

  • fix: jule::to_str<T> function define declared as jule::to_str2<T>
  • fix: std::mem::Free function support of the jule::Trait<Mask> and jule::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) string
  • jule::Slice<Item>: add the void append(const jule::Slice<Item>&) method
  • jule::Slice<Item>: remove the swap method
  • jule::Array<Item, N>: remove the swap 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.