Beta 0.0.3 released! #39
Locked
mertcandav
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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