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
Warning
This is a later update. Beta 0.0.5 may have major bugs. It has been observed that it generates code in a way that may cause problems with binary eval. Use IR distributions for the latest and most stable version.
With beta 0.0.5 the compiler receives significant improvements and optimizations. A significant gain in memory usage and compilation time was observed. In addition, the compiler receives typical bug fixes.
The compiler's code generation has been improved and can make a significant performance difference for executables in existing codes. It is very possible that your old standard libraries and codes are incompatible with Jule Beta 0.0.5.
As a beta release, we are releasing this without any issues left unresolved, just like we did with Beta 0.0.4. All known issues have been resolved. Of course, since it is a beta release, there are still possible problems. However, we expect this release to be more stable compared to older versions.
Featured Improvements
Disable Shadowing by Default
One of the important changes that may cause your old codes to stop working is that shadowing is turned off by default. We've configured this as optional, so you can tell your compiler to enable shadowing with the newly added --shadowing flag.
Ternary Operator
The classic ternary operator is now supported in Jule. It cannot be said that it is a new syntax. Just use if-else syntax. Ternary operator is included in constant eval optimization whenever possible. In this way, you can get a wider chance of constant eval optimization.
const RATE = 60
fn rate_delta(): int {
const r = if RATE >= 50 { 1000 } else { 100 }
ret r + 20
}
Static Constant Fields for Structures
Structures can now have constant fields that are statically accessible. This gives you a more structured code structure. Of course, as with other constant variables, there is no real variable involved. Constant fields are not actual variables contained in structures and are evaluated at compile-time.
struct Number {}
impl Number {
const PI = 3.14159
const E = 2.71828
}
fn main() {
outln(Number.PI)
outln(Number.E)
}
Pointer Arithmetic
More low-level power. Pointers now have better arithmetic support.
For example:
fn main() {
let s = [1, 2, 3, 4, 5]
let mut p = &s[0]
let end = p + s.len
for p != end; p++ {
unsafe { outln(*p) }
}
}
Type-Match for Generics
An important feature for generics: compile-time type matching. Determine the code according to the type by checking the type of the generics in compile-time. Only the codes provided for the matched type are used. However, you can prevent the types you want from being used and throw a compile-time error with compile-time panic calls. No safety risks, no runtime costs.
We have completely renewed the reference types (now known as smart pointer). Although it is used as the default type for RC as before, it behaves exactly like a pointer. There are corresponding changes and improvements to the syntax. They can now point to any type without any restrictions and can be used nested.
Thanks to the casting support between raw pointer and smart pointer, you can further strengthen the communication between Safe Jule and Unsafe Jule and achieve optimizations such as obtaining Smart Pointers without RC cost.
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.5 Release
With beta 0.0.5 the compiler receives significant improvements and optimizations. A significant gain in memory usage and compilation time was observed. In addition, the compiler receives typical bug fixes.
The compiler's code generation has been improved and can make a significant performance difference for executables in existing codes. It is very possible that your old standard libraries and codes are incompatible with Jule Beta 0.0.5.
As a beta release, we are releasing this without any issues left unresolved, just like we did with Beta 0.0.4. All known issues have been resolved. Of course, since it is a beta release, there are still possible problems. However, we expect this release to be more stable compared to older versions.
Featured Improvements
Disable Shadowing by Default
One of the important changes that may cause your old codes to stop working is that shadowing is turned off by default. We've configured this as optional, so you can tell your compiler to enable shadowing with the newly added
--shadowing
flag.Ternary Operator
The classic ternary operator is now supported in Jule. It cannot be said that it is a new syntax. Just use if-else syntax. Ternary operator is included in constant eval optimization whenever possible. In this way, you can get a wider chance of constant eval optimization.
See manual for more information.
For example:
Static Constant Fields for Structures
Structures can now have constant fields that are statically accessible. This gives you a more structured code structure. Of course, as with other constant variables, there is no real variable involved. Constant fields are not actual variables contained in structures and are evaluated at compile-time.
See manual for more information.
For example:
Pointer Arithmetic
More low-level power. Pointers now have better arithmetic support.
For example:
Type-Match for Generics
An important feature for generics: compile-time type matching. Determine the code according to the type by checking the type of the generics in compile-time. Only the codes provided for the matched type are used. However, you can prevent the types you want from being used and throw a compile-time error with compile-time panic calls. No safety risks, no runtime costs.
See manual for more information.
For example:
Reimplement Reference Types
We have completely renewed the reference types (now known as smart pointer). Although it is used as the default type for RC as before, it behaves exactly like a pointer. There are corresponding changes and improvements to the syntax. They can now point to any type without any restrictions and can be used nested.
Thanks to the casting support between raw pointer and smart pointer, you can further strengthen the communication between Safe Jule and Unsafe Jule and achieve optimizations such as obtaining Smart Pointers without RC cost.
See manual for more information.
Changes
recover
function error handling method>
,<
,>=
, and<=
operators to numerical enums—shadowing
flagjulenv
command shows default compiler and default C++ standard—opt-access
optimization flag—opt-inline
,—opt-ptr
optimization flagsstd::flag
Compiler Packages
Prim
structrecover
call processingAPI
setup_command_line_args
function asset_argv
functionsetup_environment_variables
function asset_envp
functionargc
,argv
, andenvp
globalsjule::Ptr
Standard Library
std::fs
std::sync::atomic
std::vector
asstd::vec
std::jule::integrated
Mutex
, andOnce
structsOS
, andARCH
globalsis_pass_file_annotation
functionBuiltinUsedForRed
,RefPointsToInvalidType
to theLogMsg
enumsleep
static method to theThread
structis_byte_lit
functionis_ascii
functionARGS
global asargs
functionENV
global asenv
functionhas_ref_accessible
method to theStruct
structsame
method to theFnIns
structsame
method to theStructIns
structIter
field asFor
ofTokenKind
andTokenId
enumsBeta Was this translation helpful? Give feedback.
All reactions