You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release has a general focus. It makes the compiler more durable, stable and reliable, improves the standard library, implements new design changes and introduces new features.
Legacy Support
Beta 0.0.2 and older versions cannot compile the new standard library and the compiler itself due to the syntax update with Beta 0.0.3. However, Beta 0.0.3 will probably not compile the computer programs you have written in Beta 0.0.2 or older versions due to syntax errors. Beta 0.0.3 requires you to update your code according to the new syntax rules.
New Features
Static variables
With the added keyword static, you can now have variables that are stored statically. Please read relevant manual section for more information about static variables.
Static struct methods
With the added keyword static, you can now have static methods. Static methods can be accessed and called without the need for instances of the structures. Please read relevant manual section for more information about static struct methods.
References
References are a kind of alias for memory areas. It is like a pointer, but weaker and safer. They are protected by the compiler's safety obsessions. A reference is declared with the & operator and must always be initialized. Any changes to the references affect the original address.
References are different from the reference types available for reference counting and are not related to reference counting. Reference types are heap allocations that perform reference counting, references are just an alias.
For example:
let mut x = 100
let mut &y = x
y *= 10
outln(x) // 1000
The current octal literal notation was literals starting with 0. While keeping this usage, we add an alternative: the 0o prefix.
For example:
0o770
Catch incomplete binary expressions
Parser now keeps track of incomplete binary expressions. For example, you were getting parser errors when going to next line in expressions because the newline meant a statement. You had to use parentheses for a correct parsing. Now you can skip to the bottom lines with the incomplete binary expression. The parser follows lines for the remainder of the expression when the binary operator catches and the right operand is missing. Doing this without parentheses provides a more readable and alternative approach.
For example:
let (x, y) = 20, false
if x == 10 ||
y == false {
}
Build directive for platform specific programming
There was already a file annotation feature for writing platform specific code. But this was a restrictive method and required renaming the files. We keep the file annotation property, but add an alternative: the build top directive. This directive provides more flexible platform detection and uses flag-based expressions. In this way, it allows to evaluate more possibilities.
For example:
//jule:build (darwin || windows) && 64bit
The above expression will return true for windows and darwin operating systems with 64-bit architecture.
Added new julenv command to compiler commands. This command gives information about your native platform and Jule development environment.
Add access modifier support to traits
Traits now support access modifiers. From the moment they were added, it only allowed all definitions to be used as public and no access modifiers could be used. Now a change is made to the syntax and the use of the access modifier is allowed. In this way, traits will now be able to apply their definitions as private and public.
In the above example, this trait implements the set method as private, while the get method implements it as public.
Update default standard to c++17 from c++14
We are updating the default C++ standard from C++14 to C++17. According to our tests and observations, we did not see any harm in using the C++17 standard by default. However, as far as we've tested, the API can be compiled with C++20 and generates code that is largely suitable for JuleC C++20.
Downgrades
Remove support for ARM architecture
The compiler did not have as strong support for ARM as for other architectures, so we decided to remove it. We keep ARM64 support. But support for all other ARM architectures has been removed. This was not considered permanent, it may be added in the future as the compiler evolves.
Remove support for multi-return function calls to multi-return expressions
Returns from multi-returning functions can no longer be used for the return statement of a multi-returning function. This could be added back at a later stage, but there are no such plans yet.
Remove trait and structure support from dead-code elimination optimization
Dead code optimizations no longer remove dead structures and traits. This can cause a significant increase in IR size or add almost no difference. But this change also makes the dead code elimination optimization reliable for now because the current algorithm also sometimes eliminates used structs and traits. Support for structures and traits could be added in the future, but no plans yet.
Changes
runtime: fix catching capability of recover function
syntax: [add condition] global variables are must be static
syntax: the cpp keyword comes first now for use declarations
compiler: code generation generates IR codes that has less warnings
compiler: minor improvements for code generation
compiler: improve copy optimization
compiler: improve code generation for match statements
compiler: compiler generates recommended compile command’s path with command-line argument form
compiler: do not check unused declarations if relevant part of code already has errors
compiler: the built-in clone function is useable for mutable defines now
compiler: improve object cleaning
compiler: fix closures
compiler: minor improvements for text of error messages
compiler: add type prefix support for structure literals
compiler: add type prefix support for return statements
compiler: minor safety fixes for built-in recover function
compiler: parse all files even if there is no file annotation pass
compiler: add panic function call support for unreachable code elimination
compiler: add support to code generation for c++20 standard
compiler: error message of code generation
compiler: fix structure literal code generation for cpp-linked structures
compiler: fix code generation for cpp-linked structures
compiler: update default standard to c++17 from c++14
compiler: set default C++ backend compiler as Clang for Windows
JuleC Packages
sema: add built-in panic function call support for missing return statement checking
sema: add support for genericed typed expressions to eval
parser: fix binary expression parsing
sema: fix built-in Error trait functions
sema: fix binary eval for XOR (bitwise or) operator
sema: fix argument overflow checking of built-in real function
sema: fix type declaration catching capability of unary eval
parser: fix comments not useable body of match statements
compiler: fix compile command generation for GCC
lexer: fix column counting for unicode characters
lexer: accept size as 8 of tab characters
lexer: add alternative local literal representation
sema: fix statically type checking for element types
parser: fix top-directive parsing
sema: fix lvalue detection of binary eval
API
str: add trim method and rename exist trim method as ltrim
add: char* conversion support for jule::Str
stop using noexcept keyword
slice: use jule::Int instead of jule::Uint for store length and capacity
fix jule::MAX_F32, jule::MIN_F32, jule::MAX_F64, and jule::MIN_F64 globals
map: fix keys, and values methods
Standard Library
std::jule::build: DIRECTIVES, CPP_HEADER_EXTS, CPP_EXTS, OBJECTIVE_CPP_EXTS, DISTOS, and DISTARCH globals are array now
std::lex: PUNCTS, SPACES, UNARY_OPS, BIN_OPS, WEAK_OPS, and ASSIGN_OPS globals are array now
std::fs: fix typo of Divice (actually Device) field of FsError
std::os: fix typo of Divice (actually Device) field of OsError
std::fs: add read_file, remove_file, remove_dir, and create_dir functions
std::fs:: add NotEmpty field to FsError enum
std::sys: fix O_CREAT, O_EXCL, O_TRUNC, and O_APPEND constants for Windows
std::lex: add Static field for TokenKind enum
std::lex: add Static field for TokenId enum
std::sys: remove O_NOCTTY, O_NONBLOCK, O_ASYNC, and O_CLOEXEC fields for Windows
std::vector: remove new_vector function and add new static function to Vector[T] for same operation
std::vector: remove trailing space from error message of Vector[T]
std::sync::atomic: use references instead of pointers
std::sync::atomic: add the MemoryOrder enum and use memory ordering for atomic functions
std::sys: add remove, rmdir, and mkdir functions for Unix
std::sys: add delete_file, remove_directory, and create_directory function for Windows
std::os: move executable, and exit functions to std::process
std::os: move PATH_SEPARATOR, PATH_LIST_SEPARATOR globals and is_path_sep function to std::fs::path
std::os: move OsError enum, ENV, ARGS globals, getwd, chdir functions to std::env and rename OsError enum as EnvError
std::jule::types: SYS_INT, and SYS_UINT globals are constant now
std::jule::build: add Build field to Directive enum
std::jule::build: remove Arm field from Arch enum
std::jule::build: remove is_arm function
std::jule::constant: make all constructor functions are static
runtimeRelated with std/runtime or compiled behaviorcompilerRelated with comptime or compilation problems
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Beta 0.0.3 Release
This release has a general focus. It makes the compiler more durable, stable and reliable, improves the standard library, implements new design changes and introduces new features.
Legacy Support
Beta 0.0.2 and older versions cannot compile the new standard library and the compiler itself due to the syntax update with Beta 0.0.3. However, Beta 0.0.3 will probably not compile the computer programs you have written in Beta 0.0.2 or older versions due to syntax errors. Beta 0.0.3 requires you to update your code according to the new syntax rules.
New Features
Static variables
With the added keyword
static
, you can now have variables that are stored statically. Please read relevant manual section for more information about static variables.Static struct methods
With the added keyword
static
, you can now have static methods. Static methods can be accessed and called without the need for instances of the structures. Please read relevant manual section for more information about static struct methods.References
References are a kind of alias for memory areas. It is like a pointer, but weaker and safer. They are protected by the compiler's safety obsessions. A reference is declared with the
&
operator and must always be initialized. Any changes to the references affect the original address.References are different from the reference types available for reference counting and are not related to reference counting. Reference types are heap allocations that perform reference counting, references are just an alias.
For example:
Please read relevant manual section for more information about references.
New octal literal representation
The current octal literal notation was literals starting with
0
. While keeping this usage, we add an alternative: the0o
prefix.For example:
Catch incomplete binary expressions
Parser now keeps track of incomplete binary expressions. For example, you were getting parser errors when going to next line in expressions because the newline meant a statement. You had to use parentheses for a correct parsing. Now you can skip to the bottom lines with the incomplete binary expression. The parser follows lines for the remainder of the expression when the binary operator catches and the right operand is missing. Doing this without parentheses provides a more readable and alternative approach.
For example:
Build directive for platform specific programming
There was already a file annotation feature for writing platform specific code. But this was a restrictive method and required renaming the files. We keep the file annotation property, but add an alternative: the
build
top directive. This directive provides more flexible platform detection and uses flag-based expressions. In this way, it allows to evaluate more possibilities.For example:
The above expression will return true for windows and darwin operating systems with 64-bit architecture.
Please read relevant manual section for more information about
build
directive.The
julenv
compiler commandAdded new
julenv
command to compiler commands. This command gives information about your native platform and Jule development environment.Add access modifier support to traits
Traits now support access modifiers. From the moment they were added, it only allowed all definitions to be used as public and no access modifiers could be used. Now a change is made to the syntax and the use of the access modifier is allowed. In this way, traits will now be able to apply their definitions as private and public.
For example:
In the above example, this trait implements the
set
method as private, while theget
method implements it as public.Update default standard to c++17 from c++14
We are updating the default C++ standard from C++14 to C++17. According to our tests and observations, we did not see any harm in using the C++17 standard by default. However, as far as we've tested, the API can be compiled with C++20 and generates code that is largely suitable for JuleC C++20.
Downgrades
Remove support for ARM architecture
The compiler did not have as strong support for ARM as for other architectures, so we decided to remove it. We keep ARM64 support. But support for all other ARM architectures has been removed. This was not considered permanent, it may be added in the future as the compiler evolves.
Remove support for multi-return function calls to multi-return expressions
Returns from multi-returning functions can no longer be used for the return statement of a multi-returning function. This could be added back at a later stage, but there are no such plans yet.
Remove trait and structure support from dead-code elimination optimization
Dead code optimizations no longer remove dead structures and traits. This can cause a significant increase in IR size or add almost no difference. But this change also makes the dead code elimination optimization reliable for now because the current algorithm also sometimes eliminates used structs and traits. Support for structures and traits could be added in the future, but no plans yet.
Changes
recover
functioncpp
keyword comes first now for use declarationsclone
function is useable for mutable defines nowrecover
functionJuleC Packages
panic
function call support for missing return statement checkingError
trait functionsreal
functionAPI
trim
method and rename existtrim
method asltrim
char*
conversion support forjule::Str
noexcept
keywordjule::Int
instead ofjule::Uint
for store length and capacityjule::MAX_F32
,jule::MIN_F32
,jule::MAX_F64
, andjule::MIN_F64
globalskeys
, andvalues
methodsStandard Library
DIRECTIVES
,CPP_HEADER_EXTS
,CPP_EXTS
,OBJECTIVE_CPP_EXTS
,DISTOS
, andDISTARCH
globals are array nowPUNCTS
,SPACES
,UNARY_OPS
,BIN_OPS
,WEAK_OPS
, andASSIGN_OPS
globals are array nowDivice
(actuallyDevice
) field ofFsError
Divice
(actuallyDevice
) field ofOsError
read_file
,remove_file
,remove_dir
, andcreate_dir
functionsNotEmpty
field toFsError
enumO_CREAT
,O_EXCL
,O_TRUNC
, andO_APPEND
constants for WindowsStatic
field forTokenKind
enumStatic
field forTokenId
enumO_NOCTTY
,O_NONBLOCK
,O_ASYNC
, andO_CLOEXEC
fields for Windowsnew_vector
function and addnew
static function toVector[T]
for same operationVector[T]
MemoryOrder
enum and use memory ordering for atomic functionsremove
,rmdir
, andmkdir
functions for Unixdelete_file
,remove_directory
, andcreate_directory
function for Windowsexecutable
, andexit
functions tostd::process
PATH_SEPARATOR
,PATH_LIST_SEPARATOR
globals andis_path_sep
function tostd::fs::path
OsError
enum,ENV
,ARGS
globals,getwd
,chdir
functions tostd::env
and renameOsError
enum asEnvError
SYS_INT
, andSYS_UINT
globals are constant nowBuild
field toDirective
enumArm
field fromArch
enumis_arm
functionBeta Was this translation helpful? Give feedback.
All reactions