ArkScript v4.0.0-14 #536
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
fmtlib
$repr
macro to get a string representation of a given nodearkscript -f|--format
VM::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:
)type
list
,concat
,append
and friends to only push valid nodes (that produces a value)Ark::internal::Pass
to describe compiler passes: they all output an AST (parser, import solver, macro processor, and optimizer for now)-f(no-)importsolver
,-f(no-)macroprocessor
and-f(no-)optimizer
to toggle on and off those compiler passesempty?
as a macro when possibleand
andor
implementation--check
to 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_CONST
when a closure is made-fdump-ir
to 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)and
andor
@@
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-is
to paste a node inside a maro without evaluating it further ; useful to stop recursive evaluation of nodes inside function macrosLOAD_SYMBOL_BY_INDEX
instruction, loading a local from the current scope by an index (0 being the last element added to the scope)STORE_FROM_INDEX
andSET_VAL_FROM_INDEX
instructions for parity with the super instructions not using load by indexINCREMENT_BY_INDEX
andDECREMENT_BY_INDEX
instructions 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_INDEX
super instructions added for parity with the super instructions not using load by indexRESET_SCOPE
instruction emitted at the end of a while loop to reset a scope so that we can create multiple variables and useLOAD_SYMBOL_BY_INDEX
Changed
(= 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)
begin
block within a cond macro and used in the scope surrounding the cond macroarkscript --version
andarkscript --help
now output ArkScript version with the commit hashvoid Value::toString(std::ostream&, VM&)
now becomesstd::string Value::toString(VM&)
Node::operator<<
to replace it withNode::debugPrint
let
,mut
orset
, resulting in a compiler crashargcount
and crash the processor(fun)
as the argument block, resulting in a crashlet
/mut
/set
nodes($ test (@ [1 2 3] -5))
(concat! lst lst)
(print nil?)
(+)
while
nodesfun
nodeslet
,mut
orset
nodes inside macros with an invalid node typeinternal::listInstructions
with the different instructions, to be used by the compiler and name resolution passsymcat
andargcount
to$symcat
and$argcount
for uniformityArk::VM
class is nowfinal
STORE
instruction has been renamedSET_VAL
STORE
instruction is emitted in place of theLET
andMUT
instructions, without any mutability checking nowio:writeFile
no longer takes a mode and has been split intoio:writeFile
andio:appendToFile
inst byte1 byte2 byte3
CALL_BUILTIN <builtin> <arg count>
super instructionstr:xyz
builtins tostring:xyz
for uniformity with the standard librarystring:find
takes an optional third argument, startIndex (where to start the lookup from, default 0list:setAt
can work with negative indexes, and is now bound checkedarkscript
executable (not enabled when embedding arkscript, so that one can grab variables from the VM)fmtlib
to 11.1.3-13-bcr
option 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 idArk::CodeError
now takes aCodeErrorContext
to store the source (filename, line, column, expression) of an errorRemoved
NodeType::Closure
Utils::digPlaces
andUtils::decPlaces
got removed as they were no longer neededlist:removeAt
,ark
executable now replaced byarkscript
)VM::getUserPointer
andVM::setUserPointer
ARK_PROFILER_COUNT
define\0
escape in stringstermcolor
dependency to rely onfmt
for coloring outputsand
andor
instructions in favor of a better implementation to support short-circuitingLET
andMUT
instructions in favor of a single newSTORE
instructionSAVE_ENV
instructionValue VM::resolve(const Value* val, Args&&... args)
, which has been deprecated in ArkScript v3.4.0This discussion was created from the release ArkScript v4.0.0-14.
Beta Was this translation helpful? Give feedback.
All reactions