Version History
0.16.0#
Command line#
Additions
- added
-ior--instructionsargument that prints the instructions (old behavior of-b)
Changes
- now
-bactually prints the bytecode and not the instructions
Nest#
Additions
- added a new syntax for raw strings with backticks
- added
is_ascii,is_decimalandis_numerictostdsutil.nest - added
consume_int,parse_realandconsume_realtostdsutil.nest
Changes
- now
su.represcapes non-printable characters - now
su.fmtescapes non printable characters when usingrorR - renamed
iter_get_valtoiter_nextinstditutil.nest - now numbers separators cannot be consecutive (
1__0is no longer a valid integer) - improved
parse_intfunction instdsutil.nest - now the
StrtoRealcast accepts a broader syntax for numbers (e.g. now1is valid)
Bug fixes
- fixed expressions escapes in strings that would not close properly when the last character was
- - fixed an infinite loop occurring when escaping a non-ASCII character in the source code
- fixed
su.lsplitandsu.rsplitthat would ignore separators at the end and at the beginning respectively - fixed file arguments (ex.
--$ --no-default) not working - now multiplying a
Vectorby a negative number results in an error - fixed
sequ.mergenot working with sequences of different lenghts
C API#
Additions
- added
assembler.hwhich defines the following symbolsNst_BytecodeNst_OpNst_OpCodeNst_assembleNst_bc_copyNst_bc_destroyNst_bc_print
- added
dyn_array.hwhich defines the following symbolsNst_DynArrayNst_PtrArrayNst_da_initNst_da_init_copyNst_da_reserveNst_da_appendNst_da_popNst_da_remove_swapNst_da_remove_shiftNst_da_getNst_da_setNst_da_clearNst_pa_initNst_pa_init_copyNst_pa_reserveNst_pa_appendNst_pa_popNst_pa_remove_swapNst_pa_remove_shiftNst_pa_getNst_pa_setNst_pa_clear
- added
Nst_Spantoerror.hand the following functions along with itNst_span_newNst_span_from_posNst_span_emptyNst_span_joinNst_span_expandNst_span_startNst_span_end
- added
Nst_error_add_spantoerror.h - added
Nst_iof_func_set,Nst_iof_fdandNst_iof_fptofile.h - added the following functions to
function.hNst_func_argsNst_func_c_bodyNst_func_nest_bodyNst_func_mod_globalsNst_func_outer_vars
- added
Nst_IC_SEQ_CALLandNst_IC_MAKE_FUNCinNst_InstCode - added
Nst_FuncPrototypeininstructions.h - added
Nst_fprototype_initandNst_fprototype_destroy - added new functions to create and manage a
Nst_InstList:Nst_ilist_initNst_ilist_destroyNst_ilist_addNst_ilist_add_exNst_ilist_add_objNst_ilist_add_funcNst_ilist_get_instNst_ilist_get_objNst_ilist_get_funcNst_ilist_get_inst_objNst_ilist_get_inst_funcNst_ilist_setNst_ilist_set_exNst_ilist_lenNst_ilist_print
- added
Nst_InterpreterStatetointerpreter.h - added
Nst_coroutine_yieldtointerpreter.h - added
Nst_state_spanandNst_statetointerpreter.h - added the following functions to manage
Iterobjects:Nst_iter_start_funcNst_iter_next_funcNst_iter_value
- added
Nst_iter_range_new,Nst_iter_seq_new,Nst_iter_str_newandNst_iter_map_newtoiter.h - added
Nst_obj_customandNst_obj_custom_exmacros with respective_Nst_obj_customand_Nst_obj_custom_exfunctions tolib_import.h - added
Nst_import_libtolib_import.h - added
Nst_map_lenandNst_map_captomap.h - added
Nst_map_nextandNst_map_prevtomap.h - added
Nst_node_set_spantonodes.h - added
program.hwhich defines the following symbols:Nst_ProgramNst_ExecutionKindNst_prog_initNst_prog_destroy
- added various new functions to
sequence.hNst_array_from_objsNst_array_from_objsnNst_vector_from_objsNst_vector_from_objsnNst_seq_lenNst_vector_capNst_seq_objsNst_seq_setfNst_seq_setnNst_seq_setnfNst_seq_getfNst_seq_getnNst_seq_getnf
- added various new functions to
simple_types.hNst_int_i64Nst_real_f64Nst_real_f32Nst_byte_u8
- added
source_loader.hwhich defines the following symbols:Nst_source_loadNst_source_from_svNst_source_from_fileNst_source_text_destroy
- added various new functions to
str.hNst_str_get_objNst_str_valueNst_str_lenNst_str_char_len
- added
str_builder.hwhich defines the following symbols:Nst_StrBuilderNst_sb_initNst_sb_destroyNst_sb_reserveNst_sb_pushNst_sb_push_strNst_sb_push_cNst_sb_push_cpsNst_sb_push_charNst_str_from_sbNst_sv_from_sb
- added
str_view.hwhich defines the following symbols:Nst_StrViewNst_sv_newNst_sv_new_cNst_sv_from_strNst_sv_from_str_sliceNst_sv_nextNst_sv_prevNst_SvNumFlagsNst_sv_parse_intNst_sv_parse_byteNst_sv_parse_realNst_sv_compareNst_sv_lfindNst_sv_rfindNst_sv_ltokNst_sv_rtok
- added
Nst_tok_newandNst_tok_invalidtotokens.h - added
Nst_type_nameandNst_type_travtotype.h - added
Nst_DBG_ASSERT_CALLBACKandNst_DBG_KEEP_DYN_LIBSmacros for debugging - added
Nst_Destructortype alias - added
unicode_db.hwhich defines the following symbols:Nst_UCD_MASK_UPPERCASENst_UCD_MASK_LOWERCASENst_UCD_MASK_CASEDNst_UCD_MASK_ALPHABETICNst_UCD_MASK_DECIMALNst_UCD_MASK_DIGITNst_UCD_MASK_NUMERICNst_UCD_MASK_XID_STARTNst_UCD_MASK_XID_CONTINUENst_UCD_MASK_PRINTABLENst_UCD_MAX_CASE_EXPANSIONNst_UnicodeChInfoNst_unicode_get_ch_infoNst_unicode_expand_caseNst_unicode_is_whitespaceNst_unicode_is_titlecase
- added
Nst_vt_inittovar_table.h
Changes
- added
print_instructionsfield inNst_CLArgs - renamed
_Nst_clargs_parsetoNst_clargs_parse - now
Nst_compilereturns anNst_InstListinstead of anNst_InstList * - now
Nst_compileno longer destroys the AST - renamed
Nst_CP_MULTIBYTE_MAX_SIZEtoNst_ENCODING_MULTIBYTE_MAX_SIZE - renamed
Nst_CPIDtoNst_EncodingID- renamed all variants from
Nst_CP_*toNst_EID_*
- renamed all variants from
- renamed
Nst_CPtoNst_Encoding - renamed
Nst_translate_cptoNst_encoding_translate - renamed
Nst_check_string_cptoNst_encoding_check - renamed
Nst_string_char_lentoNst_encoding_char_len - renamed
Nst_string_utf8_char_lentoNst_encoding_utf8_char_len - renamed
Nst_cptoNst_encoding - renamed
Nst_is_valid_cptoNst_cp_is_valid - renamed
Nst_is_non_charactertoNst_cp_is_non_character - renamed
Nst_check_bomtoNst_encoding_from_bom - renamed
Nst_detect_encodingtoNst_encoding_detect - renamed
Nst_single_byte_cptoNst_encoding_to_single_byte - renamed
_Nst_EM_WRONG_ARG_NUMto_Nst_WRONG_ARG_NUM - moved
Nst_SourceTextfromerror.htosource_loader.h - renamed
Nst_set_colortoNst_error_set_color - removed
Nst_copy_pos - renamed
Nst_no_postoNst_pos_empty - renamed
Nst_tb_printtoNst_error_print - removed
Nst_set_error, renamed_Nst_set_errortoNst_error_set - removed
Nst_set_*_errormacros, renamed_Nst_set_*_errorfunctions toNst_error_set_* - renamed
Nst_set_*_errorfmacros toNst_error_setf_*and made them functions - renamed
Nst_set_*_error_cfunctions toNst_error_setc_* - removed all
Nst_set_internal_*andNst_set_internal_*_cfunctions - renamed
Nst_failed_alloctoNst_error_failed_alloc - removed
Nst_error_add_posin favour ofNst_error_add_span - removed
IOFILE,FUNC,MAP,SEQ,ARRAY,VECTOR,ITER,TYPE,CONT_TYP,AS_INT,AS_BOOL,AS_BYTEandAS_REAL - made
Nst_IOFileObjprivate - removed
_Nst_iof_destroy - made
Nst_FuncObjandNst_FuncBodyprivate - removed
Nst_func_set_vtand_Nst_func_set_vt - removed
Nst_func_newand_Nst_func_destroy - removed
GGC_OBJ - made
Nst_GarbageCollectorprivate - removed
Nst_ggc_collect_gen,_Nst_ggc_initand_Nst_ggc_delete_objs - renamed
_Nst_ggc_obj_reachabletoNst_ggc_obj_reachableand removed macro alias - made
Nst_IC_IS_JUMPa function calledNst_ic_is_jump - renamed
Nst_IC_FOR_GET_VALtoNst_IC_FOR_NEXT - split
Nst_IC_ROTintoNst_IC_ROT_2andNst_IC_ROT_3 - renamed
Nst_InstIDtoNst_InstCode - renamed
idfield inNst_Insttocode - replaced
startandendfields inNst_Instwithspan - removed
valand renamedint_valtovalinNst_Inst - now
Nst_InstListcontains threeNst_DynArrayfields calledinstructions,objectsandfunctions - removed
Nst_inst_new,_Nst_inst_new_val,Nst_inst_new_valandNst_inst_new_int - removed
Nst_IntrState - now
Nst_initdoes not take any arguments - now
Nst_runtakes anNst_Programinstead of anNst_FuncObj - now
Nst_run_moduleonly takes the file name of the module to run and returns anNst_Obj - renamed
Nst_run_paused_coroutinetoNst_coroutine_resume - removed
Nst_state_set_es - removed
Nst_current_inst - made
Nst_IterObjprivate - renamed
_Nst_iter_newtoNst_iter_newand remove macro alias - removed
_Nst_iter_destroy - renamed
_Nst_iter_starttoNst_iter_startand removed macro alias - renamed
_Nst_iter_get_valtoNst_iter_nextand removed macro alias - renamed
Nst_iter_*_get_valfunctions toNst_iter_*_nest - removed
Nst_tokenizef,Nst_add_linesandNst_normalize_encoding - now
Nst_tokenizereturns anNst_DynArray - removed
Nst_RETURN_TRUE,Nst_RETURN_FALSE,Nst_RETURN_NULL,Nst_RETURN_IEND,Nst_RETURN_ZERO,Nst_RETURN_ONEandNst_IS_NULLfromlib_import.h - renamed
_Nst_get_import_pathtoNst_import_full_lib_pathand moved the function tolib_import.h - renamed
Nst_get_full_pathtoNst_abs_pathand moved it tolib_import.h - removed
Nst_llist_newandNst_llist_destroy - made
Nst_MapObjandNst_MapNodeprivate - renamed
_Nst_map_copytoNst_map_copyand removed macro alias - removed
Nst_map_destroy - renamed
_Nst_map_settoNst_map_setand removed macro alias - renamed
_Nst_map_gettoNst_map_getand removed macro alias - renamed
_Nst_map_droptoNst_map_dropand removed macro alias - renamed
_Nst_map_set_strtoNst_map_set_strand removed macro alias - renamed
_Nst_map_get_strtoNst_map_get_strand removed macro alias - renamed
_Nst_map_drop_strtoNst_map_drop_strand removed macro alias - removed
_Nst_map_get_next_idxand_Nst_map_get_prev_idx - removed
Nst_SBufferin favour ofNst_DynArray- removed
Nst_sbuffer_*functions
- removed
- removed
Nst_Bufferin favour ofNst_StrBuilder- removed
Nst_buffer_*functions
- removed
- removed
Nst_node_set_posin favour ofNst_node_set_span - renamed
OBJtoNstOBJ - renamed
_Nst_inc_reftoNst_inc_refand removed macro alias - renamed
_Nst_ninc_reftoNst_ninc_refand removed macro alias - renamed
_Nst_dec_reftoNst_dec_refand removed macro alias - renamed
_Nst_ndec_reftoNst_ndec_refand removed macro alias - renamed
_Nst_ndec_reftoNst_ndec_refand removed macro alias - removed
Nst_NullObj - removed
_Nst_obj_freeand_Nst_obj_destroy - renamed
_Nst_obj_*operations inobj_ops.htoNst_obj_*and removed macro aliases - renamed
_Nst_repr_str_casttoNst_obj_to_repr_str - removed
_Nst_obj_str_cast_seqand_Nst_obj_str_cast_map - renamed
Nst_optimize_bytecodetoNst_optimize_ilist - removed
runner.hand the following symbols:Nst_ExecutionStateNst_es_initNst_es_destroyNst_func_call_from_esNst_es_init_vtNst_executeNst_es_set_cwdNst_es_push_moduleNst_es_push_funcNst_es_push_paused_coroutineNst_es_force_function_end
- renamed
_Nst_fstack_pushtoNst_fstack_pushand removed macro alias - renamed
_Nst_vstack_pushtoNst_vstack_pushand removed macro alias - removed
cwdfromNst_FuncCalland replacedstartandendwithspan - renamed
inst_idxfield ofNst_CatchFrametoidx - removed
Nst_GenericStack- removed
Nst_stack_init,Nst_stack_expandandNst_stack_shrink
- removed
- made
Nst_SeqObjprivate, removedNst_ArrayObjandNst_VectorObj - renamed
_Nst_seq_settoNst_seq_setand removed macro alias - renamed
_Nst_seq_gettoNst_seq_getand removed macro alias - removed
_Nst_vector_resize - renamed
_Nst_vector_appendtoNst_vector_appendand removed macro alias - renamed
_Nst_vector_removetoNst_vector_removeand removed macro alias - renamed
_Nst_vector_poptoNst_vector_popand removed macro alias - made
Nst_IntObj,Nst_RealObj,Nst_BoolObjandNst_ByteObjprivate - renamed
_Nst_number_to_*functions insimple_types.htoNst_number_to_*and removed macro aliases - renamed
_Nst_obj_to_booltoNst_obj_to_booland removed macro alias - moved
Nst_SourceTextfromerror.htosource_loader.h - made
Nst_StrObjprivate - removed
TYPE_NAME,Nst_TYPE_STRandNst_STR_IS_ALLOCmacros - removed
Nst_str_temp - removed
_Nst_str_destroy - renamed
_Nst_str_copytoNst_str_copyand removed macro alias - renamed
_Nst_str_reprtoNst_str_reprand removed macro alias - renamed
_Nst_str_gettoNst_str_getand removed macro alias - now
Nst_str_getreturns the Unicode code point instead of an object, use the newNst_str_get_objfor the old behavior - removed
Nst_str_new_c_raw - now
Nst_str_new_conly takes one argument and the string is always assumed to be static - removed
Nst_TOK,Nst_tok_new_value,Nst_tok_new_noval,Nst_tok_new_noend - made
Nst_TypeObjprivate, removedNst_ContTypeObj - removed
Nst_TypeFlagsand_Nst_type_destroy - renamed
Nst_TRACK_OBJ_INIT_POStoNst_DBG_TRACK_OBJ_INIT_POS - renamed
Nst_DISABLE_POOLStoNst_DBG_DISABLE_POOLS - renamed
Nst_COUNT_ALLOCtoNst_DBG_COUNT_ALLOC - removed
Nst_BREAKPOINT_ON_ASSERTION_FAILin favour ofNst_DBG_ASSERT_CALLBACK - now integer types (
i8,i32, ...) use the types from<inttypes.h> - moved
Nst_objfromobj.htotypedefs.h - removed
Nst_vt_newandNst_vt_from_funcfromvar_table.h - renamed
_Nst_vt_gettoNst_vt_getand removed macro alias - renamed
_Nst_vt_settoNst_vt_setand removed macro alias - renamed node types to have clearer names
Bug fixes
- now when building on linux the files are correctly rebuilt when header files change
- fixed
Nst_CLEAR_FLAGSnot keeping reserved flags intact
0.15.0#
Nest can now be compiled with clang! Check make help for more info.
Nest#
Additions
- added
is_space,lremove,rremoveandrsplittostdsutil.nest - added
del_envandget_capacitytostdsys.nest - added
enumtostdsequtil.nest - added
batchandbatch_paddedtostditutil.nest - added
std.nest, a file that imports all the standard library available under standard import names (e.g.std.io.println) - added
set_option,get_option,clear_optionsandOPTIONtostdjson.nest - added
_debug_and_debug_arch_predefined variables when compiling in debug mode,_debug_is set totrueand_debug_arch_is set tox64on 64-bit platforms andx86on 32-bit ones - added
reverseandreverse_itostdsequtil.nest - added
rsplittostdsutil.nest - added
fmttostdsutil.nestto format values - added
encoding_infotostdcodecs.nest - merged
get_fpiandmove_fpiintoseek - added
time_creation,time_last_accessandtime_last_writetostdfs.nest - added
path.stemtostdfs.nest
Changes
- now line endings will be ignored when the expression should not end, this includes the following cases:
- the condition of while and do-while loops
- the number of repeats in for loops
- the iterator in for-as loops
- the expression and the cases in switch statements
- expressions inside parenthesis
- inside maps, vectors and arrays
- when a line ends with a local-stack operator
- changed the file object to string cast from
<IOFile ----- >to<IOFile[-----]> - renamed
putenvinstdsys.nesttoset_envand added an optional argumentoverwrite - renamed
getenvinstdsys.nesttoget_env - now
relative_pathinstdfs.nestwill use the current working directory if no base is given - renamed
pausetoyieldinstdco.nest - now the
argsargument ofco.callis returned byco.yieldwhen the function resumes - now
co.generatoraccepts a second argument which is the arguments to use when calling the function - now
err.trywill accept fewer arguments than the function requires - removed
get_options,set_optionsandOPTIONSinstdjson.nest - renamed
_get_cwdand_set_cwdtoget_cwdandset_cwdinstdsys.nest - removed
reversedfromstditutil.nest - improved execution times and output printing
- now when pressing
Ctrl-Can error is thrown rather than the process exiting, this error cannot be caught with a normal try-catch statement buterr.tryis needed - renamed
su.splittosu.lsplit - reverted the merging of
su.ljustandsu.rjustintosu.justify, now they are again two separate functions - renamed
su.centertosu.cjust - now when a string is not closed only the end is highlighted rather than the whole string
- now the second argument of
itu.repeatis optional and it will repeat infinitely if not given, it would repeat infinitely even if the number was negative even if it was not specified in the documentation - added
timestampargument to manystdtime.nestfunctions - renamed
hours,minutesandsecondstohour,minuteandsecond - reorganized
extension,filename,join,normalizeandparent_pathto be insidepathinstdfs.nest - removed
remove_dir,remove_dirsandremove_filein favor ofremoveandremove_all
Bug fixes
- fixed a crash that occurred when casting a
IOFileobject to aStr - fixed a crash that occurred when using
co.pauseinside an expression - now months are counted from
1instdtime.nest - fixed an infinite loop when trying to optimize changed jumps
- fixed
su.lfindandsu.rfindthat did not work with non-ASCII characters - fixed
su.centercausing a crash with a negative width - fixed
su.trim,su.ltrimandsu.rtrimnot working with NUL characters - fixed
su.is_titlereturning an incorrect value when a word had a character that was not a space or a letter before it - fixed
itu.cyclenot working with Unicode strings - fixed
itu.chainnot resetting correctly after being iterated over the first time - fixed many memory leaks
- fixed
cp-1251,utf32,latin1encodings not working properly - fixed
utf32encoding name - fixed encoding on
utf16,utf16leandutf16beforU+FFFF - fixed various bugs with virtual files
- now
io.get_flags,io.can_read,io.can_write,io.is_bin,io.can_seekandio.is_a_ttywill throw an error if the file is closed - now
fs.path.normalizewill no longer normalize\\?\at the beginning of a path - now
fs.path.joinwill not add a slash if the first path is an empty string - fixed
RealandInttoBytecasts not working properly
C API#
Additions
- added
Nst_ErrorKindenum - added
Nst_error_add_positionsto add a pair of positions to a traceback - added
Nst_IntrStatestruct - added
Nst_gstate_get_esandNst_state_set_es - added
runner.halong with the following functions:Nst_es_initNst_es_destroyNst_es_init_vtNst_executeNst_es_set_cwdNst_es_push_moduleNst_es_push_funcNst_es_push_paused_coroutineNst_es_force_function_end
- added
Nst_cl_args_init - added
_Nst_override_supports_color - added
_Nst_EM_WRONG_ARG_NUM_FMTmacro to format correctly wrong argument numbers - added
Nst_init,Nst_quitandNst_was_init - added
Nst_assertandNst_assert_cto make assertions - added
Nst_string_char_lenandNst_string_utf8_char_len - added
Nst_inst_list_new - new parser, added many new node-related elements
Nst_SeqNodeType,Nst_NodeData_Ac,Nst_NodeData_As,Nst_NodeData_Ca,Nst_NodeData_Cs,Nst_NodeData_Ex,Nst_NodeData_Fd,Nst_NodeData_Fl,Nst_NodeData_Ie,Nst_NodeData_Lo,Nst_NodeData_Ls,Nst_NodeData_Ml,Nst_NodeData_Rt,Nst_NodeData_Sl,Nst_NodeData_So,Nst_NodeData_Sw,Nst_NodeData_Tc,Nst_NodeData_Vl,Nst_NodeData_We,Nst_NodeData_Wl,Nst_NodeData_Ws_Nst_node_ac_destroy,_Nst_node_ac_init,_Nst_node_as_destroy,_Nst_node_as_init,_Nst_node_ca_destroy,_Nst_node_ca_init,_Nst_node_cs_destroy,_Nst_node_cs_init,_Nst_node_ex_destroy,_Nst_node_ex_init,_Nst_node_fd_destroy,_Nst_node_fd_init,_Nst_node_fl_destroy,_Nst_node_fl_init,_Nst_node_ie_destroy,_Nst_node_ie_init,_Nst_node_lo_destroy,_Nst_node_lo_init,_Nst_node_ls_destroy,_Nst_node_ls_init,_Nst_node_ml_destroy,_Nst_node_ml_init,_Nst_node_rt_destroy,_Nst_node_rt_init,_Nst_node_sl_destroy,_Nst_node_sl_init,_Nst_node_so_destroy,_Nst_node_so_init,_Nst_node_sw_destroy,_Nst_node_sw_init,_Nst_node_tc_destroy,_Nst_node_tc_init,_Nst_node_vl_destroy,_Nst_node_vl_init,_Nst_node_we_destroy,_Nst_node_we_init,_Nst_node_wl_destroy,_Nst_node_wl_init,_Nst_node_ws_destroy,_Nst_node_ws_initNst_print_node
- added
Nst_sbuffer_at,Nst_sbuffer_popandNst_sbuffer_shrink_auto - added
Nst_VERSION_MAJOR,Nst_VERSION_MINORandNst_VERSION_PATCHdefinitions - added
Nst_DECLR_END - added
Nst_ConstFunc - added
Nst_memset - added
Nst_fmt,Nst_vfmtandNst_fmt_objs - added
Nst_MSVC,Nst_GCCandNst_CLANG
Changes
New program execution system:
Programs have been decoupled from the interpreter. Now any program can be executed by setting the es field (of type Nst_ExecutionState) of the global Nst_IntrState. All the information needed to execute a program is saved in the Nst_ExecutionState struct and this can be swapped into the interpreter when no recursive calls are active and it allows to execute a completely different program where it was left off.
New error handling system:
Previously errors were handled in a very messy way. There was Nst_Error which was used internally, Nst_OpErr which was used by libraries and Nst_Traceback which was used during execution. Now interpreter and program execution are separate and because of this the interpreter state can be initialized well before anything is executed on it. This removes the need for Nst_Error and Nst_OpErr which are replaced in the new Nst_ExecutionState and Nst_IntrState by a Nst_Traceback field that contains all the information needed.
General changes:
- removed
errorparameter fromNst_compile - removed
Nst_ErrorandNst_OpErrstructs - replaced the
errorfield inNst_Tracebackwitherror_occurred,error_nameanderror_msg - removed
Nst_print_error - changed
Nst_print_tracebackto take a pointer instead of a plain traceback - changed
Nst_error_occurredto return aNst_ErrorKindinstead of abool - changed
Nst_error_getto return aNst_Tracebackinstead of aNst_OpErr - changed all
Nst_set_internal_*functions to get aNst_Tracebackinstead of aNst_Errorfor the first argument - removed
Nst_set_internal_error_from_op_err - changed
Nst_get_stateto returnNst_IntrState - changed
Nst_ExecutionStateto now only contain information about the running program - removed
errorargument fromNst_tokenizef,Nst_tokenizeandNst_normalize_encoding - removed
errorargument fromNst_optimize_astandNst_optimize_bytecode - removed
errorargument fromNst_parse - renamed
Nst_ggc_initto_Nst_ggc_init - added
v_stackargument toNst_vstack_initNst_vstack_push_Nst_vstack_pushNst_vstack_popNst_vstack_peekNst_vstack_dupNst_vstack_destroy
- added
f_stackargument toNst_fstack_initNst_fstack_pushNst_fstack_popNst_fstack_peekNst_fstack_destroy
- combined
func,call_start,call_end,vt,idxandcstack_sizearguments ofNst_fstack_pushintocall - added
c_stackargument toNst_cstack_initNst_cstack_pushNst_cstack_peekNst_cstack_popNst_cstack_destroy
- combined
inst_idx,v_stack_sizeandf_stack_sizearguments ofNst_cstack_pushintoframe - renamed
Nst_ggc_delete_objsto_Nst_ggc_delete_objs - removed
_Nst_unload_libs - removed
argcandargvarguments from_Nst_parse_args - added
arg_numargument toNst_call_func - renamed
Nst_run_func_contexttoNst_run_paused_coroutineand modified its arguments - removed
Nst_state_initandNst_state_free - renamed
Nst_ENDIANNESStoNst_BYTEORDER - renamed
Nst_IC_NEW_OBJtoNst_IC_NEW_INT - replaced
Nst_IC_FOR_IS_DONEwithNst_IC_JUMPIF_IEND - removed
Nst_print_ast - renamed
Nst_RETURN_CONDtoNst_RETURN_BOOL - removed
Nst_FUNC_SIGNandNst_DEF_EXTRACT - removed
get_func_ptrsfrom libraries, nowlib_initreturns the function pointers - removed
Nst_DeclrListand renamedNst_ObjDeclrtoNst_Declr - renamed
Nst_MAKE_FUNCDECLRtoNst_FUNCDECLR - renamed
Nst_MAKE_NAMED_FUNCDECLRtoNst_NAMED_FUNCDECLR - renamed
Nst_MAKE_OBJDECLRtoNst_CONSTDECLR - renamed
Nst_MAKE_NAMED_OBJDECLRtoNst_NAMED_CONSTDECLR - renamed many functions to better fit the naming style:
_Nst_parse_argsto_Nst_cl_args_parse_Nst_override_supports_colorto_Nst_supports_color_override_Nst_set_console_modeto_Nst_console_mode_initNst_print_bytecodetoNst_inst_list_print_Nst_init_objectsto_Nst_globals_init_Nst_del_objectsto_Nst_globals_quit_Nst_call_functo_Nst_func_call_Nst_get_stateto_Nst_state_get- all
Nst_string_*toNst_str_*
- macros to check token type ranges have been made private
- removed
Nst_WINin favor ofNst_MSVC - renamed
Nst_GNU_FMTtoNst_NIX_FMTsince it is used with clang too - renamed
true_lenfield in strings tochar_len
Bug fixes
- fixed
Nst_obj_eq_candNst_obj_ne_cleaving a dangling reference of the resulting boolean object - fixed type objects not being freed properly
- fixed many constants not being destroyed at the end of the program
- fixed a possible read-after-free bug in the garbage collector
- now the standard library is imported when running Nest on Windows in
x86debug mode - fixed the value store in
ill_encoded_byteretrieved withNst_io_result_get_details - fixed
Nst_str_copythat swappedtrue_lenandlen
0.14.0#
Nest#
Additions
- added
IENDconstant tostditutil.nest - added
map_i,slice_i,filter_i,extend,copyanddeep_copytostdsequtil.nest - added
is_nanandis_inffunctions tostdmath.nest - added
inf_and_nanoption tostdjson.nestto allow forNaNandInfinityto be treated as numeric literals - added
is_infandis_nanfunctions tostdmath.nest - added the 'contains' stack operator
<.>to check if an object is inside another - added
read_symlinkfunction tostdfs.nest - added
gmt_datetostdtime.nest
Changes
- now
itu.new_iteratortakes three arguments instead of four - now
itu.repeatwill repeat forever ifcountis negative - now
itu.cyclewill also acceptIterobjects - removed
iter_is_donefromstditutil.nest - now the iterator of a for-as loop is implicitly casted to
Iter - now
\Uin 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.
'àèì'.1now is'è'and before was'\xa0')- removed
to_iter,get_lenandget_atfromstdcodecs.nestsince they are no longer needed
- removed
- removed
ljustandrjustfromstdsutil.nestin favour ofjustify- with
justifya positive length means justify left and a negative one means justify right
- with
- now
su.reprwill display in\xhh,\uhhhhor\Uhhhhhhunprintable characters (control characters, non-characters, surrogates) - added an argument to
sequ.map,sequ.sortandrand.shuffleto specify whether the sequence should be modified in-place or a new one should be created - added an argument to
json.load_fandjson.dump_fto specify the encoding of the file - renamed
allow_commentsandallow_trailing_commasinjson.OPTIONStocommentsandtrailing_commasrespectively - removed
containsfromstdsequtil.nestin favour of the new stack operator - added
fromandtoarguments tolfindandrfindinstdsutil.nest - now casting a
nanorinfvalue to anIntorBytewill 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.sliceon some occasions - fixed a crash that occurred when an error was thrown inside a function in
sequ.rscan - fixed
json.load_fandjson.dump_fnot working correctly with UTF-8 file names on Windows - fixed Nest not finding files with non-ASCII characters (both command-line and libraries) on Windows
- fixed
su.is_charsetreturning an incorrect result on some non-ASCII strings (e.g.'à' 'èĠ' @su.is_charsetnow returnsfalse, before it would returntrue) - fixed
io.printlnnot printing the full string if it contained a NUL character - fixed some errors passing silently through
io.println - fixed
infandnanvalues not being casted correctly to strings - fixed a bug where any byte using a hexadecimal literal would be interpreted as zero
- fixed
CP-1250encoding not working - fixed
joininstdsutil.nestcausing aMemory Errorif the passed sequence was empty - fixed
rtrimandtriminstdsutil.nestthat 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
\177not 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_nextfield toNst_Obj - added object pools to improve performance
- added
_Nst_obj_freeto free an object's memory or add it to its type's pool - added
Nst_TYPE_STRto get the string of a type object - added
CONT_TYPEandNst_ContTypefor types of containers - added
IEndfield toNst_TypeObjsandIEnd_iendtoNst_Consts - added
c_inf,c_nan,c_neginfandc_negnantoNst_StrConsts - added
Nst_true_ref,Nst_false_ref,Nst_null_ref,Nst_iendandNst_iend_reftoglobal_consts.h - added
Nst_FLAGmacro to create the value of the flag of an object - added
indexable_strandtrue_lenfields toNst_StrObj. - added
Nst_string_new_lento create strings with a known character length - added
Nst_string_get_next_chto iterate over a string's characters without generating theindexable_strfield - added
Nst_FLAG_STR_IS_ASCII,Nst_FLAG_STR_INDEX_16,Nst_FLAG_STR_INDEX_32andNst_FLAG_STR_CAN_INDEXvariants toNst_StrFlags - added
Nst_seq_copyand_Nst_seq_copyto create a shallow copy of sequences - added
Nst_map_copyand_Nst_map_copyto create a shallow copy of a map - added
Nst_fopen_unicodeto open files from UTF-8 strings on all platforms - added
Nst_single_byte_cpto always get a single-byte encoding - added
Nst_NestCallabletype as the type of C functions callable from Nest - added
Nst_sbuffer_copyandNst_buffer_copyto copy the contents of buffers - added
Nst_buffer_append_strto append a string of known length to a buffer - added
Nst_obj_containsand_Nst_obj_containsto implement the<.>operator - added
Nst_TT_CONTAINStoken type - added
Nst_string_rfindto find a substring from the right - added
Nst_CLEAR_FLAGSmacro to remove all non-reserved flags from a macro
Changes
- now
Nst_TypeObjis no longer an alias ofNst_StrObjand contains the pool for the type and the destructor - moved the
traverse_funcparameter from the object to its type - moved the
destructorparameter from the object to its type - removed
destructorargument from_Nst_obj_allocandNst_obj_alloc - changed
_Nst_obj_destroyto only call the destructor, and not free the memory - removed
Nst_obj_destroyand kept only_Nst_obj_destroy - removed
ggc_nextfromNst_GGCObj, instead the newp_nextis used - renamed
ggc_prevtop_previnNst_GGCObj - removed
t_*fromNst_StrConsts - removed
is_donefield fromNst_IterObj - removed
Nst_iter_is_doneand_Nst_iter_is_done - removed
is_doneargument fromNst_iter_new - removed
Nst_iter_range_is_done,Nst_iter_seq_is_done,Nst_iter_str_is_doneandNst_iter_map_is_done - now type shorthands for
Nst_extract_arg_valuesthat are part of type unions will not cast the object automatically - renamed
_Nst_string_get_next_chandNst_string_get_next_chto_Nst_string_next_chandNst_string_next_chrespectively - optimized exponentiation
- rename
_Nst_VECTOR_MIN_SIZEto_Nst_VECTOR_MIN_CAP
Bug fixes
- fixed
Nst_is_non_characterreturningtrueon some valid characters - fixed
Nst_extract_arg_valuessometimes trying to cast an invalid value - fixed
Nst_extract_arg_valuescrashing when deleting any allocated objects if an error occurred - fixed
Nst_encoding_from_namefailing 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,ARRAYandVECTOR - fixed
Nst_string_comparenot working with non-ASCII characters
0.13.2#
Nest#
Bug fixes
- fixed input
C API#
Bug fixes
- fixed
Nst_sbuffer_expand_toexpanding the buffer when not necessary
0.13.1#
Nest#
Bug fixes
- fixed
sliceinstdsequtil.nestthat could cause a crash if anArrayorVectorwas passed
0.13.0#
Command-line arguments#
- removed
--cp1252in favour of--encoding
Nest#
Additions
- added
ENDIANNESSconstant andputenvfunction tostdsys.nest - added
new_iteratortostditutils.nest - added
descriptor,encoding,is_a_tty,is_bin,can_read,can_writeandcan_seektostdio.nest - added string expressions
Changes
- the
stdutf8.nestlibrary has been replaced by thestdcodecs.nestlibrary - added
encodingargument tostr_to_bytearrayandbytearray_to_str - added
encodingandbuf_sizearguments toopen - optimized interpreter
- now strings are encoded with UTF-8
- now casting
MaptoIterwill iterate over the map's items and not create a new iterator - added
map_funcargument 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.hand removedNst_IOFilelogic 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
helprule 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_ByteandNst_Bool; usei64,f64,u8andboolinstead - 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.nestto work with the new names and error propagation - added
generate_docs.nestto generate Markdown documentation from the headers
0.12.1#
Nest#
Additions
- added an experimental and undocumented library
_stdgui.nestthat only has text labels, it will be gradually getting more features - added many functions to
stdfs.nestexistsis_block_deviceis_char_deviceis_named_pipeis_socketis_symlinkmake_dir_symlinkmake_file_symlinkmake_hard_linknormalize
Changes
- now
<<<supports Unicode characters on Windows - renamed
logtolninstdmath.nest - renamed
logntologinstdmath.nest, thebaseargument is now optional and defaults to 10 - removed
log2andlog10 - added a fourth argument to
enumerateinstdsutil.nestto invert the order of the index and item in the array - now any functions that expect a
Boolobject 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
stepargument ofenumerateinstditutil.nest - fixed do-while loops getting compiled like normal while loops
- fixed some casts from
StrtoIntandBytebeing considered valid when they weren't and vice versa - fixed
countinstdsequtil.nestthat could cause undefined behaviour - fixed
<<<having a weird behaviour - fixed many functions in
stdfs.nest,stdsys.nestandstdio.nestnot supporting unicode strings on Windows
C API#
Additions
- added
nst_vector_create,nst_array_create,nst_vector_create_candnst_array_create_ctosequence.h - added
NST_UNSET_ERRORtolib_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_f64andnst_obj_to_booltosimple_types.h - added many functions to
encoding.h:nst_check_ascii_bytesnst_ascii_to_utf32nst_ascii_from_utf32nst_utf8_to_utf32nst_utf8_from_utf32nst_utf16_to_utf32nst_utf16_from_utf32nst_check_utf32_bytesnst_utf32_to_utf32nst_utf32_from_utf32nst_check_1252_bytesnst_1252_to_utf32nst_1252_from_utf32nst_translate_cpnst_cpnst_char_to_wchar_tnst_wchar_t_to_char
Changes
- removed
errargument fromnst_map_get_strandnst_map_drop_str - added
errargument tonst_map_setand_nst_map_resize - now
_nst_vector_resizeandnst_vector_appendreturnbool
Bug fixes
- now
nst_iter_newandnst_tok_new_valuenever leave dangling references if the memory allocation fails - now
nst_get_full_pathalways setserron failure - now strings that contain a NUL byte are fully hashed
0.12.0#
Nest#
Additions
- added
sleep_ms,monotonic_timeandmonotonic_time_nstostdtime.nest - added
lscanandrscantostdsequtil.nest - added icons to the installer and the executable on Windows
- added the
_raw_exitfunction tostdsys.cnest, it cannot be accessed by importingstdsys.nest - added
SUPPORTS_COLORtostdsys.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.exitthat 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.trythat when set to true catchessys.exit - changed many function names in
stdfs.nestto better fit the naming convention or to make them clearerisdir→is_dirmkdir→make_dirmkdirs→make_dirsrmdir→remove_dirrmdir_recursive→remove_dirsisfile→is_filermfile→remove_filelist_dir_recursive→list_dirspath→parent_path
- renamed
virtual_ioftovirtual_fileinstdio.nest - now
openinstdio.nestpermits omitting the second parameter - now
Byteobjects support~and-: - now binary libraries end with
.cnestinstead of.dllor.soto 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.nestwill throw a system error if something fails - now
countinstdsequtil.nestwill 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.yearreturning the years passed from 1900 instead of the current year (it would return 123 instead of 2023) - fixed
sys.exitcausing 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
Strcast on Linux not displaying the address correctly, now it is the same as Windows - fixed a crash with
sequ.slicewhen 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
0.11.2#
Nest#
Additions
- added
to_titleandis_titletostdsutil.nest - added
counttostdsequtil.nest - added
printlntostdio.nest
Changes
- now identifiers can contain unicode characters (
💻can be used as a variable name) - now
containsinstdsequtil.nestalso accepts two strings as an input - now
$accepts also a function and returns the maximum number of arguments it takes (>>> $(## [])prints0) - now
virtual_iofaccepts 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
StrtoBytecast - 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
0.11.1#
Nest#
Changes
- removed
_advance_from iterators and made them around 15% faster - improved
itu.chainto take iterators and strings
0.11.0#
Nest#
Additions
- added
\uand\Ustring escapes - added the
stdutf8.nestlibrary - added
parse_inttostdsutil.nest
Changes
- improved
StrtoInt,StrtoRealandStrtoBytecasts to support underscores and non-decimal literals - now string representations will use
\einstead of\x1band 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
0.10.0#
Nest#
Additions
- added
bin,octandhextostdsutil.nestto have the binary, octal and hexadecimal representation of integers respectively - added
centertostdsutil.nest - added
_get_cwdand_set_cwdtostdsys.nest - added the
stdjson.nestmodule 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.callacceptsnullfor 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
nullvalues - now the CP1252 encoding is officially supported along with UTF-8 and ASCII
- now
RealtoStrwill add.0if the number does not contain a dot or is not in scientific notation (Str :: 1.0now is'1.0'where before it was'1')
Bug Fixes
- fixed
co.callresulting in undefined behaviour when not passing a sequence as the first argument - now coroutines are correctly set as
endedwhen an error occurs inside the coroutine - fixed
FunctoStrcast 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
0.9.2#
Nest#
Changes
- now
&&and||work consistently always returning either the first false element (for&&) or the first true element (for||)0 10 || --> 10 0 10 && --> 0 - added a custom syntax to create an empty array:
{,}, changed the string cast of an empty array to{,}
Bug Fixes
- fixed the end position of value tokens containing a
Real - fixed many crashes reguarding coroutines
0.9.1#
Nest#
Changes
- improved many casts to
Str:IOFiles now show their flags- arrays, vectors and maps, when empty no longer have a space between the opening and closing brackets (
{ }becomes{}) - recursive vector references now use
<{.}>instead of{.} - if the object does not have a custom cast, it now shows its address in memory (
Str :: (0 -> 10)can return<Iter object at 0x00000206A188B8D0>) - now functions show their number of arguments (
Str :: (## a b [])returns<Func 2 args>)
- improved import speed when importing a large number of modules and libraries
Bug Fixes
- fixed a crash or incorrect behaviour when comparing two almost identical strings where one has an extra
\0character at the end - fixed a crash when passing an empty sequence to
min_seqormax_seqinstdmath.nest
0.9.0#
Nest#
Changes
- added
generatortostdco.nest - added
virtual_iof,get_flags,_set_stdin,_set_stdoutand_set_stderrtostdio.nest, now stdin, stdout and stderr can be redirected to other files - now
=>no longer requires an expression after it, instead it will returnnull - now casting an
IOFileto aBoolwill returntrueif the file is open andfalseotherwise - now negative steps in
sequ.sliceare allowed and do not just return an empty sequence - removed
from_iterfromstdsequtil.nestas it can be replaced with a cast to a vector - now functions can be written like lambdas, with a signle expression, and lambdas can be written with a block:
#add a b => a b + ##a b [ >>> (a ' + ' b '\n' ><) => a b + ] = add_with_print - now error messages will always show the full path to the file
- added the following type casts:
MaptoVectorMaptoArrayArraytoMapVectortoMapItertoVectorItertoArrayItertoMapRealtoByte
Bug Fixes
- fixed a crash that occurred when calling a coroutine while it was running, now an error is thrown instead
- fixed
rb+,r+b,wb+,w+b,ab+anda+binio.openbeing considered invalid file modes - fixed a crash caused by
shrink_stacknot allocating enough memory - fixed a crash caused by having a step of 0 in
sequ.slice - fixed an infinite loop that could occur when a switch statement of an imported file was not closed properly and then a file with a continue statement outside a loop was imported
0.8.0#
Nest#
Changes
- added Linux support!
- added the unpacking assignment that can be written with curly braces:
{ 1, 2 } = { a, b }, it also works in for-as loops - added the sequence call operator (
*@) that allows you to call a function passing the arguments as a sequence - renamed
rand_seedtoseedinstdrand.nest - added
canonical_path,relative_path,join,path,filenameandextensionfunctions tostdfs.nest - added
hypottostdmath.nest
Bug Fixes
- comparison operators no longer execute more than once each expression, the following code now prints
Calledonly once where before it would be printed twice:#f [ >>> 'Called\n' => 2 ] 1 @@f 3 < - now all line endings (
\n,\r\nor\r) are parsed correctly
0.7.3#
Nest#
Changes
- added
gcd,lcm,gcd_seq,lcm_seqandabstostdmath.nest - the keys in the map returned by
clock_timeandgmt_clock_timenow arehour,minuteandsecondinstead ofhours,minutesandseconds - now runtime stacks (value stack, call stack and catch stack) shrink when they are small enough, before they could only grow
Bug Fixes
- now the process ends with exit code 1 when an error occurs
- now
-O3will not optimize built-in constants if they are repurpused in any scope or if they might be changed through_vars_or_globals_, now the code will not change its behaviour if you have this enabled The following code before would have given different results depending on the optimization level, now everyghing is coherent:'true' = a false = _vars_.(a) >>> true - when vectors are shrinked the program no longer crashes
0.7.2#
Nest#
Changes
- now random numbers are generated in the range [-2^63, 2^63) using the Mersenne Twister algorithm, because of this
RAND_MAXhas been removed fromstdrand.nest
Bug Fixes
- fixed
0obeing read as0b, now a syntax error is correctly thrown - fixed hexadecimal literals skipping the next character in the code while lexing (
0 = var [] 0xabc(var +was valid) - fixed error positions on some numeric literals where the end was one column off
- fixed a crash that occurred when there was no identifier after
# - fixed a crash that occurred when there was a missing
}or}>on repeated sequences - fixed error message on for loops missing
], it now saysunmatched '['instead ofunexpected token - fixed error messages for extractions and container assignments showing the wrong types
- fixed error positions for container assignments
- fixed error printing when there was an indented line
0.7.1#
Nest#
Changes
- added
zipninstditutil.nestto simultaiously iterate over an arbitrary number of sequences - now if-expressions use less instructions when both cases return
null - removed multiline comment spaces in the Sublime Text plugin
Bug fixes
- fixed
replace_substrinstdsutil.nestthat would sometimes crash - fixed a crash when an error occurred during the optimization of the bytecode
0.7.0#
Nest#
Changes
- Added
stdco.nestlibrary to create and run coroutines - Added
starts_with,ends_withandstr_to_bytearrayinstdsutil.nest - Improved error printing on multiple lines
- Printing a lot of lines when printing errors is now much faster
- added binary, octal and hexadecimal integer literals and scientific notation for real literals
- to write bytes with hexadecimal integer start with
0hinstead of0x - scientific notation still needs a literal with a decimal point and digitds on both sides
- to write bytes with hexadecimal integer start with
- now underscores (
_) can be added inside numbers to make them more legible (100_000_000) - changed "Add to PATH variable" to "Add to PATH environment variable" in the installer
- now
clock_time,gmt_clock_time,clock_datetimeandgmt_clock_datetimeinsert the keys from the least specifit to the most specific, for example callingdt.clock_timewill now return{ 'hours': 17, 'minutes': 32, 'seconds': 59 }instead of{ 'seconds': 59, 'minutes': 32, 'hours': 17 } - added operators when displaying bytecode
- now the bytecode of large programs is displayed faster
Bug fixes
- fixed a crash that happened when an error occurred inside a call from a C function
- fixed the indentation of carets when pointing to an indented error
- now when executing code from the
-cargument no path is added to the import stack - fixed crashes caused by the garbage collector deleting still reachable objects
- fixed
sliceinstdsequtilthat would crash in many occasions - fixed
containsinstdsequtilthat would crash when returning a type error
0.6.3#
Nest#
Fixes#
- fixed a lot of memory leaks
- fixed maps causing a crash when iterated on after changing one of the middle keys
- fixed circular import error reporting showing twice the lines of the first file
- optimized
replace_substrinstdsutil.nest - fixed
sortinstdsequtil.nestsometimes causing a crash
0.6.2#
Nest#
Changes
- now you can have new lines before and after the expression in loops
Fixes#
- now functions defined in the main file access the variable of the file they were defined and not the file where they were called
- fixed maps not always decreasing the reference count of the keys when destroyed
- slight performance improvements
- try-catch no longer leaves values behind
- fixed if expression not setting a value when a statement does not return one
0.6.1#
Nest#
Changes
- added the '!!' operator to throw an error and removed the
throwfunction fromstderr.nest - added the try-catch statement but kept the
tryfunction as it gives more details on the error - added some optimizations to the bytecode
Bug fixes
- fixed the
tryfunction not working - fixed passing a non-existent file causing a crash
- fixed the x86 installer not showing the
add to PATHoption
0.6.0#
Nest#
Installer
- you can now add Nest to PATH through the installer, the variable is removed if Nest is uninstalled and is not duplicated
Changes
- added the
stderr.nestmodule, the 'throw' and 'try' functions are temporary as they will be substituted with a special syntax - added the
\eescape sequence that is equivalent to\x1band can be used for ANSI escape codes such as\e[33mfor the color yellow - changed
~=to:= - the message displayed when
-cis used incorrectly is nowInvalid usage of the option: -cinstead ofInvalid option: -c - swapped the start and the step in the range operator, it now is
[step] <start> -> <stop> - changed the behaviour of
-for maps and vectors, now it will return the map or the vector to which it was applied instead oftrueorfalse
Bug fixes
- now when printing the call traceback of a function the whole call expression is highlighted instead of only the first letter
- fixed functions called from C libraries not being able to access other variables in their module
- fixed
..in for loops and switch statements causing an infinite loop - fixed a crash that could occur when a library called the function
nst_call_func - now when using a step of 0 with the range operator an error is thrown
- fixed circular references not throwing an error when encountered
- fixed some crashes related to error handling and reporting
- now Nest should use less memory when many libraries are imported
0.5.2#
Nest#
Changes
Byteobjects can now be used as map keys- the
==operator can now be used with maps - maps are now slightly faster when re-inserting the items (this happens when an item is dropped or the map changes the internal size)
- clearer explaination in the help message for
-O0and-O1
Bug fixes
- fixed
..statement causing the for-as loop to not call the_advance_function
0.5.1#
Nest#
Changes
- added the functions
filterandcontainstostdsequtil.nest - added the constant
VERSIONtostdsys.nest - now the standard modules drop all the default variables
- now the error messages are colorful and this can be disabled with the
-mor--monochromeflag in the command - now the error messages for the wrong type of a C function tells the argument index starting from 1 instead of 0
Bug fixes
- fixed a crash that occurred when an argument of the wrong type was fed to a C function
- fixed a crash that occurred when comparing self-referencing arrays or vectors, now if a cycle is detected the equality is automatically false
- fixed error messages displaying in the wrong order when an error occurred while a nest module was tokenized, parsed or optimized
0.5.0#
Command improvements#
- standardized command-line arguments parsing according to GNU specifications
--marks the end of the arguments- you can combine multiple one-letter options under one dash (such as
-bf)
- added
-for--force-executionoption to force the execution of the program when-t,-aor-bare used - added
-O0to-O3command line arguments to specify the optimization level, if specified more than one only the last one counts - added
-coption that executes the next argument as nest code (nest -c ">>> 'Hello, world!'"printsHello, world!) - now you can specify more than one compilation insight flag (
-t,-aor-b) meaning that the commandnest -ta file.nestwill print both the tokens and the abstract syntax tree
Nest#
Changes
- now maps maintain the order of the elements that were put in, this affects map iterators in
stditutil.nestand the casting to string - renamed
IOfiletoIOFileto match the naming convention of other types - now real numbers are printed with up to 15 significant digits (before it was 6)
- real numbers are compared up to 15 significant digits (now
0.1 0.2 + 0.3 ==istrue) - added documentation for
splitandjoininstring_utilities_library.md - now vectors allow newlines after the comma
- now you can put the argument names of a function definition on separate lines without backslashes
- now the
reprfunction instdsutil.nestwill accept any type of object - now numbers can have a leading plus sign (
1 2 +3and1 2 3are equivalent) - added byte literal by putting
borBafter an integer - now you can use a byte literal when casting a string to a byte (
Byte :: 'A'andByte :: '65b'are equivalent) - now bytes inside of maps, arrays or vectors will be printed with the literal instead of the character
- improved error messages for operators and function calls
- now
bytearray_to_strinstdsutil.nestdoes not raise an error when there is a NUL byte in the array
Bug fixes
- fixed item dropping for maps that sometimes resulted in a crash
- fixed
_cwd_having the wrong length - functions from external modules now reference the module's global variables rather than the ones of the module they are imported to
- now
-9223372036854775808is considered a valid integer literal - fixed nest module imports sometimes failing
- now the error message for an index outside of bounds for a string displays the correct index
- fixed for loop not popping the iterator off the stack, this resulted in nested loops not working sometimes
- opening an invalid DLL now no longer opens a pop-up error window
- now all the functions in in
stdsutil.nestend at the end of the string at not at the first NUL byte
Other
- added a VSCode plugin, to paste in
%USERPROFILE%\.vscode\extensions - updated the syntax highlighting for sublime text
0.4.1#
Nest#
- added lambda expressions
- fixed error traceback on call stack causing a crash
- fixed for-as loop crashing when a non-iterator object was given
- you can once again index strings
- updated documentation
0.4.0#
Nest#
- added the
stdsys.neststandard library - added the
stdsequtil.neststandart library - added
min,max,min_seq,max_seq.sum_seq,frexp,ldexp,mapandclampfunctions tostdmath.nest - added
iter_start,iter_is_done,iter_get_valanditer_advancefunctions tostditutil.nest - improved error tracing with C function calls
- improved single-line escapes in comment parsing, now an even number of backslashes correctly escapes the newline
- added octal character escapes in string literals
0.3.1#
Nest#
- fixed
nst_map_drop, now the reference is removed correctly - fixed
_vars_object deleted when it shouldn't
0.3.0#
Nest#
- nest now compiles internally to bytecode
- fixed
_vars_being deleted even when returned by a function - added
_globals_, in functions accesses the global variables, in the global scope isnull - greatly improved memory usage
- the program is now optimized
- expressions with known values are evaluated
- the bytecode optimizes the instructions used
- built-in variables are swapped with their value if it is never changed
- more error checking is performed before runtime
- unreachable code is removed
- the
-voption was renamed to-V - added the
-?option, equivalent to-hor--help - added
-band--bytecodeoptions to see the compilation result - better printing for tokens and ast when using the
-tor-aoptions - from now on there will be a windows 32-bit build as well
0.2.2#
Nest#
Byteobjects now support+,-,*,/,%and^==now works correctly onRealobjects- fixed a bug that caused a crash when trying to parse an expression
0.2.1#
Nest#
- fixed
<,<=,>and>=yeilding unexpected results when comparing reals and integers - now
IOfileobjects throw errors with unsupported operations such asreadon a file opened withrb - increased performance
0.2.0#
Nest#
- added the ability to import modules and call functions from C libraries
- now
-will remove a key from a map,{ 'a': 1, 'b': 2 } 'a' - --> true, the map is now { 'b': 2 } - added switch statement
- added
splitandjoinfunctions tostdsutil.nest - added
mkdirs,rmdir_recursive,copy,rename,list_dir,list_dir_recursive,absolute_pathandequivalentfunctions tostdfs.nest - added
_vars_, a variable pointing to the dictionary with all the current variables - fixed maps not changing their maximum size after increasing it
- now the current working directory changes when importing a module
- fixed
replace_substrfailing when replacing the first occurrence caused the string to be bigger than the original - fixed not-closed multiline comments not resulting in a syntax error
0.1.4#
Nest#
- added
MaptoStrcast - added ability to pass a
Strobject tocycle,zip,enumerateandreverseinstditutil.nest - added ability to pass a
Strobject tochoice, instdrand.nest - added
reprfunction tostdsutil.nest - changed
yeardaytoyear_dayandweekdaytoweek_dayfordate,clock_datetimeandgmt_clock_datetimeinstdtime.nest - fixed
yearbeing the same asmonthfordate,clock_datetimeandgmt_clock_datetimeinstdtime.nest - fixed parser parsing some expressions incorrectly
- fixed
move_fptrandget_fptrrequesting the incorrect number of arguments - fixed math module not working
- fixed
shuffleinstdrand.nestwhere an object could not remain in its position
0.1.3#
Nest#
- added
stdmath.nestlibrary - added
stditutils.nestlibrary (iterator utities) - added
-:operator for negation-:ais equal to(0 a -) - added
@@operator to call a function with no arguments:10 @@func +is equal to10 (@func) + - added an optional
free_libfunction to C libraries to free any globally allocated memory - modified
_cwd_, now it shows the full path and not the relative path to the main file - added a native
ArrayorVectortoStrcast and vice versa - fixed
flushfunction instdio.nestexpecting two arguments but taking only one
0.1.2#
Nest#
- now circular imports correctly show an error
- added
stdtime.nestto the standard library - added
flushfunction tostdio.nest - now
_cwd_contains the full path and not the relative path
0.1.1#
Nest#
- fixed maps halting when searching the index in rare occasions
- added a third character argument to ljust and rjust in stdsutil
- fixed
shuffleinstdrand.nest
0.1.0#
Nest#
First Release of Nest.