ArkScript v4.0.0-13 #524
Closed
SuperFola
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Added
$reprmacro to get a string representation of a given nodearkscript -f|--formatVM::forceReloadPlugins, to be used by the REPL to force reload the plugins and be sure that their symbols are all definehelp,save(save history to disk),history(print history),reset(reset vm and code) commands to the REPL>to:)typelist,concat,appendand friends to only push valid nodes (that produces a value)Ark::internal::Passto describe compiler passes: they all output an AST (parser, import solver, macro processor, and optimizer for now)-f(no-)importsolver,-f(no-)macroprocessorand-f(no-)optimizerto toggle on and off those compiler passesempty?as a macro when possibleandandorimplementation--checkto the formatter as an option: returns 0 if the code is correctly formatted, 1 otherwiseappend!,concat!andpop!MAKE_CLOSURE <page addr>instruction, generated in place of aLOAD_CONSTwhen a closure is made-fdump-irto dump the IR entities to a file named{file}.ark.ir(string:setAt string index char)(bound checked)(@= list|string index new_value),(@@= list|list<string> index1 index2 new_value|char)(bound checked)andandor@@to get elements in list of lists / list of stringsrandom, returning a random number between INT_MIN and INT_MAX, or in a custom range$as-isto paste a node inside a maro without evaluating it further ; useful to stop recursive evaluation of nodes inside function macrosLOAD_SYMBOL_BY_INDEXinstruction, loading a local from the current scope by an index (0 being the last element added to the scope)STORE_FROM_INDEXandSET_VAL_FROM_INDEXinstructions for parity with the super instructions not using load by indexINCREMENT_BY_INDEXandDECREMENT_BY_INDEXinstructions for parity with the super instructions not using load by indexSTORE_TAIL_BY_INDEX,STORE_HEAD_BY_INDEX,SET_VAL_TAIL_BY_INDEX,SET_VAL_HEAD_BY_INDEXsuper instructions added for parity with the super instructions not using load by indexRESET_SCOPEinstruction emitted at the end of a while loop to reset a scope so that we can create multiple variables and useLOAD_SYMBOL_BY_INDEXChanged
(= closure1 closure2)will work only if they have the same fields (name) and if the values match($ name value)/($ name (args args args) body)/($if cond then else)(import package.sub.file)arkscript --versionandarkscript --helpnow output ArkScript version with the commit hashvoid Value::toString(std::ostream&, VM&)now becomesstd::string Value::toString(VM&)Node::operator<<to replace it withNode::debugPrintlet,mutorset, resulting in a compiler crashargcountand crash the processor(fun)as the argument block, resulting in a crashlet/mut/setnodes($ test (@ [1 2 3] -5))(concat! lst lst)(print nil?)(+)whilenodesfunnodeslet,mutorsetnodes inside macros with an invalid node typeinternal::listInstructionswith the different instructions, to be used by the compiler and name resolution passsymcatandargcountto$symcatand$argcountfor uniformityArk::VMclass is nowfinalSTOREinstruction has been renamedSET_VALSTOREinstruction is emitted in place of theLETandMUTinstructions, without any mutability checking nowio:writeFileno longer takes a mode and has been split intoio:writeFileandio:appendToFileinst byte1 byte2 byte3CALL_BUILTIN <builtin> <arg count>super instructionstr:xyzbuiltins tostring:xyzfor uniformity with the standard librarystring:findtakes an optional third argument, startIndex (where to start the lookup from, default 0list:setAtcan work with negative indexes, and is now bound checkedarkscriptexecutable (not enabled when embedding arkscript, so that one can grab variables from the VM)-bcroption can be given a source file, it will then be compiled before its bytecode is shownLOAD_SYMBOL_BY_INDEX, to avoid the sometimes expansive lookup by idRemoved
NodeType::ClosureUtils::digPlacesandUtils::decPlacesgot removed as they were no longer neededlist:removeAt,arkexecutable now replaced byarkscript)VM::getUserPointerandVM::setUserPointerARK_PROFILER_COUNTdefine\0escape in stringstermcolordependency to rely onfmtfor coloring outputsandandorinstructions in favor of a better implementation to support short-circuitingLETandMUTinstructions in favor of a single newSTOREinstructionSAVE_ENVinstructionThis discussion was created from the release ArkScript v4.0.0-13.
Beta Was this translation helpful? Give feedback.
All reactions