Releases: TheSilvered/nest
Releases · TheSilvered/nest
nest 0.14.0
Nest
Additions
- added
IEND
constant tostditutil.nest
- added
map_i
,slice_i
,filter_i
,extend
,copy
anddeep_copy
tostdsequtil.nest
- added
is_nan
andis_inf
functions tostdmath.nest
- added
inf_and_nan
option tostdjson.nest
to allow forNaN
andInfinity
to be treated as numeric literals - added
is_inf
andis_nan
functions tostdmath.nest
- added the 'contains' stack operator
<.>
to check if an object is inside another - added
read_symlink
functio tostdfs.nest
- added
gmt_date
tostdtime.nest
Changes
- now
itu.new_iterator
takes three arguments instead of four - now
itu.repeat
will repeat forever ifcount
is negative - now
itu.cycle
will also acceptIter
objects - removed
iter_is_done
fromstditutil.nest
- now the iterator of a for-as loop is implicitly casted to
Iter
- now
\U
in strings will only accept 6 hex characters instead of 8, since U+10FFFF is the highest codepoint accepted - now string length and indexing will match the characters and not the bytes (e.g.
'àèì'.1
now is'è'
and before was'\xa0'
)- removed
to_iter
,get_len
andget_at
fromstdcodecs.nest
since they are no longer needed
- removed
- removed
ljust
andrjust
fromstdsutil.nest
in favour ofjustify
- with
justify
a positive length means justify left and a negative one means justify right
- with
- now
su.repr
will display in\xhh
,\uhhhh
or\Uhhhhhh
unprintable characters (control characters, non-characters, surrogates) - added an argument to
sequ.map
,sequ.sort
andrand.shuffle
to specify whether the sequence should be modified in-place or a new one should be created - added an argument to
json.load_f
andjson.dump_f
to specify the encoding of the file - renamed
allow_comments
andallow_trailing_commas
injson.OPTIONS
tocomments
andtrailing_commas
respectively - removed
contains
fromstdsequtil.nest
in favour of the new stack operator - added
from
andto
arguments tolfind
andrfind
instdsutil.nest
- now casting a
nan
orinf
value to anInt
orByte
will throw an error
Bug fixes
- reworked the garbage collector to work more reliably and remove many types of crashes
- fixed error printing sometimes adding an empty line after a fully red one
- fixed incorrect behaviour of
sequ.slice
on some occasions - fixed a crash that occurred when an error was thrown inside a function in
sequ.rscan
- fixed
json.load_f
andjson.dump_f
not working correctly with UTF-8 file names on Windows - fixed Nest not finding files with non-ASCII charcters (both command-line and libraries) on Windows
- fixed
su.is_charset
returning an incorrect result on some non-ASCII strings (e.g.'à' 'èĠ' @su.is_charset
now returnsfalse
, before it would returntrue
) - fixed
io.println
not printing the full string if it contained a NUL character - fixed some errors passing silently through
io.println
- fixed
inf
andnan
values not being casted correctly to strings - fixed a bug where any byte using a hexadecimal literal would be interpreted as zero
- fixed
CP-1250
encoding not working - fixed
join
instdsutil.nest
causing aMemory Error
if the passed sequence was empty - fixed
rtrim
andtrim
instdsutil.nest
that if used could later cause crashes - fixed iterating through strings and creating sequences from strings that contain unicode characters which would create invalid strings
- fixed many inconsistencies between the documentation and the functions in the standard library
- fixed
<
and>
sometimes not working correctly with non-ASCII characters - fixed octal escapes higher than
\177
not working and possibly causing a crash - fixed error printing causing a crash when non-ASCII character were present on the line being printed
C API
Additions
- added
p_next
field toNst_Obj
- added object pools to improve performance
- added
_Nst_obj_free
to free an object's memory or add it to its type's pool - added
Nst_TYPE_STR
to get the string of a type object - added
CONT_TYPE
andNst_ContType
for types of containers - added
IEnd
field toNst_TypeObjs
andIEnd_iend
toNst_Consts
- added
c_inf
,c_nan
,c_neginf
andc_negnan
toNst_StrConsts
- added
Nst_true_ref
,Nst_false_ref
,Nst_null_ref
,Nst_iend
andNst_iend_ref
toglobal_consts.h
- added
Nst_FLAG
macro to create the value of the flag of an object - added
indexable_str
andtrue_len
fields toNst_StrObj
. - added
Nst_string_new_len
to create strings with a known character length - added
Nst_string_get_next_ch
to iterate over a string's characters without generaing theindexable_str
field - added
Nst_FLAG_STR_IS_ASCII
,Nst_FLAG_STR_INDEX_16
,Nst_FLAG_STR_INDEX_32
andNst_FLAG_STR_CAN_INDEX
variants toNst_StrFlags
- added
Nst_seq_copy
and_Nst_seq_copy
to create a shallow copy of sequences - added
Nst_map_copy
and_Nst_map_copy
to create a shallow copy of a map - added
Nst_fopen_unicode
to open files from UTF-8 strings on all platforms - added
Nst_single_byte_cp
to always get a single-byte encoding - added
Nst_NestCallable
type as the type of C functions callable from Nest - added
Nst_sbuffer_copy
andNst_buffer_copy
to copy the contents of buffers - added
Nst_buffer_append_str
to append a string of known length to a buffer - added
Nst_obj_contains
and_Nst_obj_contains
to implement the<.>
operator - added
Nst_TT_CONTAINS
token type - added
Nst_string_rfind
to find a substring from the right - added
Nst_CLEAR_FLAGS
macro to remove all non-reserved flags from a macro
Changes
- now
Nst_TypeObj
is no longer an alias ofNst_StrObj
and contains the pool for the type and the destructor - moved the
traverse_func
parameter from the object to its type - moved the
destructor
parameter from the object to its type - removed
destructor
argument from_Nst_obj_alloc
andNst_obj_alloc
- changed
_Nst_obj_destroy
to only call the destructor, and not free the memory - removed
Nst_obj_destroy
and kept only_Nst_obj_destroy
- removed
ggc_next
fromNst_GGCObj
, instead the newp_next
is used - renamed
ggc_prev
top_prev
inNst_GGCObj
- removed
t_*
fromNst_StrConsts
- removed
is_done
field fromNst_IterObj
- removed
Nst_iter_is_done
and_Nst_iter_is_done
- removed
is_done
argument fromNst_iter_new
- removed
Nst_iter_range_is_done
,Nst_iter_seq_is_done
,Nst_iter_str_is_done
andNst_iter_map_is_done
- now type shorthands for
Nst_extract_arg_values
that are part of type unions will not cast the object automatically - renamed
_Nst_string_get_next_ch
andNst_string_get_next_ch
to_Nst_string_next_ch
andNst_string_next_ch
respectively - optimized exponentation
- rename
_Nst_VECTOR_MIN_SIZE
to_Nst_VECTOR_MIN_CAP
Bug fixes
- fixed
Nst_is_non_character
returningtrue
on some valid characters - fixed
Nst_extract_arg_values
sometimes trying to cast an invalid value - fixed
Nst_extract_arg_values
crashing when deleting any allocated objects if an error occurred - fixed
Nst_encoding_from_name
failing to identify valid encoding names - fixed some bugs with UTF-16 and its variants not working properly
- added some missing documentation for
_Nst_VECTOR_MIN_CAP
,_Nst_VECTOR_GROWTH_RATIO
,SEQ
,ARRAY
andVECTOR
- fixed
Nst_string_compare
not working with non-ASCII characters
nest 0.13.2
Nest
Bug fixes
- fixed input
C API
Bug fixes
- fixed
Nst_sbuffer_expand_to
expanding the buffer when not necessary
nest 0.13.1
Nest
Bug fixes
- fixed
slice
instdsequtil.nest
that could cause a crash if anArray
orVector
was passed
nest 0.13.0
Command-line arguments
- removed
--cp1252
in favour of--encoding
Nest
Additions
- added
ENDIANNESS
constant andputenv
function tostdsys.nest
- added
new_iterator
tostditutils.nest
- added
descriptor
,encoding
,is_a_tty
,is_bin
,can_read
,can_write
andcan_seek
tostdio.nest
- added string expressions
Changes
- the
stdutf8.nest
library has been replaced by thestdcodecs.nest
library - added
encoding
argument tostr_to_bytearray
andbytearray_to_str
- added
encoding
andbuf_size
arguments toopen
- optimized interpreter
- now strings are encoded with UTF-8
- now casting
Map
toIter
will iterate over the map's items and not create a new iterator - added
map_func
argument tosequ.sort
Bug fixes
- fixed many memory leaks
- fixed CP1252 encoding being decoded incorrectly
- fixed a crash that could occur when returning inside a try-catch block
- fixed a crash that could occur when the last statement of a while loop was
..
- fixed some nodes and instructions missing the position
C API
Additions
- added many new encodings
- added Nst_SizedBuffer
- added
file.h
and removedNst_IOFile
logic fromsimple_types.h
- added functions to set the global error and to check it
- added the option to track the position where an object was initialized
- added a
help
rule in makefiles
Changes
- now functions and macros begin with Nst_ instead of nst_ and NST_ respectively
- now the operation error is no longer an argument and is instead set globally
- removed error and internal error macros
- removed
Nst_Int
,Nst_Real
,Nst_Byte
andNst_Bool
; usei64
,f64
,u8
andbool
instead - now all exported symbols are documented in the headers
- improved the functionality of
Nst_extract_arg_values
Bug fixes
- fixed inconsistent behaviour of
Nst_extract_arg_values
Tools
- updated
mkclib.nest
to work with the new names and error propagation - added
generate_docs.nest
to generate Markdown documentation from the headers
nest 0.12.1
Nest
Additions
- added an experimental and undocumented library
_stdgui.nest
that only has text labels, it will be gradually getting more features - added many functions to
stdfs.nest
exists
is_block_device
is_char_device
is_named_pipe
is_socket
is_symlink
make_dir_symlink
make_file_symlink
make_hard_link
normalize
Changes
- now
<<<
supports Unicode characters on Windows - renamed
log
toln
instdmath.nest
- renamed
logn
tolog
instdmath.nest
, thebase
argument is now optional and defaults to 10 - removed
log2
andlog10
- added a fourth argument to
enumerate
instdsutil.nest
to invert the order of the index and item in the array - now any functions that expect a
Bool
object as one of the arguments will accept any object that is then casted to a boolean - the C ABI became the C API
Bug fixes
- fixed many links in the documentation
- fixed
step
argument ofenumerate
instditutil.nest
- fixed do-while loops getting compiled like normal while loops
- fixed some casts from
Str
toInt
andByte
being considered valid when they weren't and vice versa - fixed
count
instdsequtil.nest
that could cause undefined behaviour - fixed
<<<
having a weird behaviour - fixed many functions in
stdfs.nest
,stdsys.nest
andstdio.nest
not supporting unicode strings on Windows
C API
Additions
- added
nst_vector_create
,nst_array_create
,nst_vector_create_c
andnst_array_create_c
tosequence.h
- added
NST_UNSET_ERROR
tolib_import.h
- added
nst_number_to_u8
,nst_number_to_int
,nst_number_to_i32
,nst_number_to_i64
,nst_number_to_f32
,nst_number_to_f64
andnst_obj_to_bool
tosimple_types.h
- added many functions to
encoding.h
:nst_check_ascii_bytes
nst_ascii_to_utf32
nst_ascii_from_utf32
nst_utf8_to_utf32
nst_utf8_from_utf32
nst_utf16_to_utf32
nst_utf16_from_utf32
nst_check_utf32_bytes
nst_utf32_to_utf32
nst_utf32_from_utf32
nst_check_1252_bytes
nst_1252_to_utf32
nst_1252_from_utf32
nst_translate_cp
nst_cp
nst_char_to_wchar_t
nst_wchar_t_to_char
Changes
- removed
err
argument fromnst_map_get_str
andnst_map_drop_str
- added
err
argument tonst_map_set
and_nst_map_resize
- now
_nst_vector_resize
andnst_vector_append
returnbool
Fixes
- now
nst_iter_new
andnst_tok_new_value
never leave dangling references if the memory allocation fails - now
nst_get_full_path
always setserr
on failure - now strings that contain a NUL byte are fully hashed
nest 0.12.0
Additions
- added
sleep_ms
,monotonic_time
andmonotonic_time_ns
tostdtime.nest
- added
lscan
andrscan
tostdsequtil.nest
- added icons to the installer and the executable on Windows
- added the
_raw_exit
function tostdsys.cnest
, it cannot be accessed by importingstdsys.nest
- added
SUPPORTS_COLOR
tostdsys.nest
Changes
- now command-line arguments can contain Unicode characters on Windows
- now the UTF-8 with BOM encoding is supported
- now
>>>
will not flush stdout each time - improved memory usage when importing C libraries
- modified the behaviour of
sys.exit
that now throws an error that will be ignored by try-catch blocks but can be caught witherr.try
- added a third optional argument to
err.try
that when set to true catchessys.exit
- changed many function names in
stdfs.nest
to better fit the naming convention or to make them clearerisdir
→is_dir
mkdir
→make_dir
mkdirs
→make_dirs
rmdir
→remove_dir
rmdir_recursive
→remove_dirs
isfile
→is_file
rmfile
→remove_file
list_dir_recursive
→list_dirs
path
→parent_path
- renamed
virtual_iof
tovirtual_file
instdio.nest
- now
open
instdio.nest
permits omitting the second parameter - now
Byte
objects support~
and-:
- now binary libraries end with
.cnest
instead of.dll
or.so
to allow cross-platform importing - inverted order of coroutine and args in
co.call
- the documentation is now hosted on ReadTheDocs
- now the functions in
stdfs.nest
will throw a system error if something fails - now
count
instdsequtil.nest
will count any non-overlapping substring if both arguments are strings
Bug Fixes
- fixed many bugs and crashes in
stdjson.nest
- fixed many memory leaks
- now all memory allocations refer to the main process
- fixed
dt.year
returning the years passed from 1900 instead of the current year (it would return 123 instead of 2023) - fixed
sys.exit
causing a segmentation fault - fixed possible crash when catching a circular import error
- now failed memory allocations are correctly handled
- now deeply nested structures will not crash the parser
- fixed general object to
Str
cast on Linux not displaying the address correctly, now it is the same as Windows - fixed a crash with
sequ.slice
when the resulting slice would have a negative size - now colors work properly on Windows consoles that require the activation of ANSI escapes
- fixed arguments on Windows not being decoded correctly
- fixed error message for using
%
with incompatible types
nest 0.11.2
Additions
- added
to_title
andis_title
tostdsutil.nest
- added
count
tostdsequtil.nest
- added
println
tostdio.nest
Changes
- now identifiers can contain unicode characters (
💻
can be used as a variable name) - now
contains
instdsequtil.nest
also accepts two strings as an input - now
$
accepts also a function and returns the maximum number of arguments it takes (>>> $(## [])
prints0
) - now
virtual_iof
accepts an optional second argument that specifies the size of the buffer
Bug Fixes
- fixed a crash happening when a lambda was not used and the optimization level was above 1
- fixed a crash happening when calling a C function that expected at least one argument but was given none
- fixed many issues reguarding the
Str
toByte
cast - fixed the error message for
-:
writing'-'
instead of'-:'
- now errors that contain unicode characters will have the correct number of spaces and carets
- fixed number positions only including the first character (again)
- fixed
-//-
that would not close correctly the multiline comment
nest 0.11.1
Changes
- removed
_advance_
from iterators and made them around 15% faster - improved
itu.chain
to take iterators and strings
nest 0.11.0
Additions
- added
\u
and\U
string escapes - added the
stdutf8.nest
library - added
parse_int
tostdsutil.nest
Changes
- improved
Str
toInt
,Str
toReal
andStr
toByte
casts to support underscores and non-decimal literals - now string representations will use
\e
instead of\x1b
and non-control UTF-8 characters are recognized and remain untouched
Bug Fixes
- fixed a crash that occurred when getting the value of an ended string iterator
nest 0.10.0
Additions
- added
bin
,oct
andhex
tostdsutil.nest
to have the binary, octal and hexadecimal representation of integers respectively - added
center
tostdsutil.nest
- added
_get_cwd
and_set_cwd
tostdsys.nest
- added the
stdjson.nest
module that can load and dump json data
Changes
- from now on the documentation will be packaged into the release to always keep correct information
- now
co.call
acceptsnull
for the first argument and behaves like passing an empty array - modified many functions of the standard library to take optional arguments
- now if you call a function with less arguments than expected the remaining ones are filled with
null
values - now the CP1252 encoding is officially supported along with UTF-8 and ASCII
- now
Real
toStr
will add.0
if the number does not contain a dot or is not in scientific notation (Str :: 1.0
now is'1.0'
where before it was'1'
)
Bug Fixes
- fixed
co.call
resulting in undefined behaviour when not passing a sequence as the first argument - now coroutines are correctly set as
ended
when an error occurs inside the coroutine - fixed
Func
toStr
cast using 'vars' instead of 'var' when the function only accepted one argument - fixed error printing when a file that had its new lines changed from CRLF to LF and an error occurred on the last line
- fixed repr of strings containing unprintable characters being incorrect and possibly causing crashes