Skip to content

Comments

Feat/various improvements#641

Open
SuperFola wants to merge 10 commits intodevfrom
feat/various-improvements
Open

Feat/various improvements#641
SuperFola wants to merge 10 commits intodevfrom
feat/various-improvements

Conversation

@SuperFola
Copy link
Member

@SuperFola SuperFola commented Feb 18, 2026

Description

  • macros are always expanded at compile time and are now separate from runtime functions: len is runtime, $len is compile time
  • builtin macros are typechecked at compile time
  • added slice builtin

Checklist

  • I have read the Contributor guide
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation if needed (on https://github.com/ArkScript-lang/website, content/docs/)
  • I have added tests that prove my fix/feature is working
  • New and existing tests pass locally with my changes

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Static analysis report

Lizard report

Listing only functions with cyclomatic complexity >= 15 or NLOC >= 100 or parameters >= 6.

Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/Compiler/Macros/Processor.cpp 259:628 Ark::internal::MacroProcessor::evaluate 3 338 114
src/arkreactor/Builtins/Slice.cpp 21:93 Ark::internal::Builtins::slice 1 63 34
src/arkreactor/Compiler/AST/Parser.cpp 841:932 Ark::internal::Parser::string 1 88 32
src/arkreactor/Compiler/AST/Node.cpp 179:285 Ark::internal::Node::repr 0 90 30
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 195:299 Ark::internal::ASTLowerer::compileExpression 4 87 29
src/arkreactor/Compiler/Macros/Processor.cpp 107:191 Ark::internal::MacroProcessor::processNode 3 63 28
src/arkreactor/Compiler/AST/Node.cpp 287:368 Ark::internal::Node::debugPrint 1 70 26
src/arkreactor/Compiler/AST/Parser.cpp 289:417 Ark::internal::Parser::import_ 1 98 23
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 333:392 Ark::internal::ASTLowerer::compileListInstruction 3 49 22
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 732:784 Ark::internal::ASTLowerer::handleOperator 3 42 18
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 22:265 Ark::internal::IROptimizer::IROptimizer 1 224 17
src/arkreactor/Compiler/Macros/Executors/Function.cpp 16:89 Ark::internal::FunctionExecutor::applyMacro 2 56 17
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 459:537 Ark::internal::ASTLowerer::compileFunction 3 56 16
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 96:112 Ark::internal::ASTLowerer::nodeProducesOutput 1 13 15
src/arkreactor/Compiler/Macros/Executors/Function.cpp 99:156 Ark::internal::FunctionExecutor::unify 5 50 15
Report about files you didn't modify in this PR
Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/VM/VM.cpp 408:2086 Ark::VM::safeRun 3 1406 276
src/arkreactor/Compiler/BytecodeReader.cpp 297:717 Ark::BytecodeReader::display 4 371 113
src/arkreactor/Error/Diagnostics.cpp 45:192 Ark::Diagnostics::makeContext 4 109 44
src/arkscript/JsonCompiler.cpp 27:276 JsonCompiler::_compile 1 214 38
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 162:267 Ark::internal::NameResolutionPass::visitKeyword 3 85 35
src/arkscript/main.cpp 23:327 main 2 259 29
src/arkreactor/TypeChecker.cpp 149:236 Ark::types::generateError 6 75 25
src/arkreactor/TypeChecker.cpp 32:147 Ark::types::displayContract 6 102 24
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 56:160 Ark::internal::NameResolutionPass::visit 2 83 23
include/utf8.hpp 138:184 utf8::isValid 1 44 21
src/arkreactor/Compiler/AST/Optimizer.cpp 33:83 Ark::internal::Optimizer::countAndPruneDeadCode 1 42 20
src/arkreactor/VM/Value/Value.cpp 77:142 Ark::Value::toString 2 52 20
src/arkscript/Formatter.cpp 503:562 Formatter::formatCall 2 51 19
src/arkreactor/Compiler/NameResolution/StaticScope.cpp 68:109 Ark::internal::NamespaceScope::get 3 32 19
src/arkreactor/VM/VM.cpp 2239:2333 Ark::VM::backtrace 3 81 19
src/arkscript/Formatter.cpp 188:250 Formatter::format 3 59 18
include/Ark/Compiler/AST/Predicates.hpp 132:156 Ark::internal::IsSymbol::operator ( ) 1 24 16
src/arkscript/Formatter.cpp 300:341 Formatter::formatFunction 2 35 16
src/arkreactor/VM/Debugger.cpp 146:206 Ark::internal::Debugger::prompt 2 54 15
src/arkreactor/Error/Diagnostics.cpp 194:211 Ark::Diagnostics::helper 7 17 2

CppCheck report

Filename Line Type Description
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 254 style Consider using std::transform algorithm instead of a raw loop.
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 261 style Consider using std::transform algorithm instead of a raw loop.
Report files about files you didn't modify in this PR
Filename Line Type Description
include/Ark/VM/VM.inl 255 style Variable 'maybe_value_ptr' can be declared as pointer to const
src/arkreactor/Builtins/Bytecode.cpp 23 style Parameter 'vm' can be declared as pointer to const
src/arkreactor/Builtins/IO.cpp 165 style Consider using std::transform algorithm instead of a raw loop.
src/arkreactor/Compiler/BytecodeReader.cpp 477 style struct member 'Arg::kind' is never used.
src/arkreactor/Compiler/NameResolution/ScopeResolver.cpp 134 style Consider using std::find_if algorithm instead of a raw loop.
src/arkreactor/VM/VM.cpp 282 error Iterators of different containers 'm_execution_contexts.emplace_back(std::make_unique())' and 'm_execution_contexts.front()' are used together.
include/Ark/VM/Value/Future.hpp 50 style Unused private function: 'Future::deleteSelfViaVM'
src/arkreactor/VM/Value/Future.cpp 23 performance Variable 'm_value' is assigned in constructor body. Consider performing initialization in initialization list.

@coveralls
Copy link

coveralls commented Feb 18, 2026

Coverage Status

coverage: 93.567% (+0.1%) from 93.464%
when pulling 94e546d on feat/various-improvements
into 672fb74 on dev.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 18, 2026

Merging this PR will degrade performance by 2.7%

⚡ 4 improved benchmarks
❌ 8 (👁 8) regressed benchmarks
✅ 6 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
👁 Welder - Simple - 39 nodes[0] 1.1 ms 1.1 ms -2.05%
👁 Welder - Big - 665 nodes[2] 49 ms 50 ms -2.15%
👁 New parser - Medium - 83 nodes[1] 900.8 µs 920 µs -2.09%
👁 Welder - Bigger[3] 68.9 ms 70.3 ms -2.06%
👁 New parser - Bigger[3] 41.2 ms 41.6 ms -1%
👁 New parser - Big - 665 nodes[2] 10.4 ms 10.5 ms -1.47%
ackermann 325.3 ms 320.6 ms +1.47%
fibonacci 28.7 ms 27.9 ms +2.8%
👁 New parser - Simple - 39 nodes[0] 362.4 µs 370.4 µs -2.16%
binary_trees 4.8 s 4.7 s +1.17%
👁 Welder - Medium - 83 nodes[1] 2 ms 2.1 ms -2.7%
create_closure 4.7 ms 4.6 ms +1.03%

Comparing feat/various-improvements (94e546d) with dev (672fb74)

Open in CodSpeed

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

Fuzzing report

/usr/local/bin/afl-whatsup status check tool for afl-fuzz by Michal Zalewski

Summary stats

    Fuzzers alive : 0
   Dead or remote : 1 (included in stats)
   Total run time : 5 minutes, 0 seconds
      Total execs : 19 thousands
 Cumulative speed : 65 execs/sec
    Pending items : 0 faves, 1031 total
 Coverage reached : 10.89%
    Crashes saved : 0
      Hangs saved : 0

Cycles without finds : 0
Time without finds : 0

[+] Captured 42734 tuples (map size 237964, highest value 255, total values 366030956) in '/dev/null'.
[+] A coverage of 42734 edges were achieved out of 238016 existing (17.95%) with 1037 input files.

…r first expression to a CALL_BUILTIN_WITHOUT_ADDRESS, if there isn't a RET after the builtin call

Otherwise, this ends up breaking perfectly valid code by not pushing the return address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants