Skip to content

Conversation

@SuperFola
Copy link
Member

Description

  • Improves error messages again,
  • clarifies syntax (using macro instead of $ to define macros).

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
  • I have added tests that prove my fix/feature is working
  • New and existing tests pass locally with my changes

@SuperFola
Copy link
Member Author

SuperFola commented May 21, 2025

  • Documentation (website) needs to be updated
  • Potentially fuzzing dictionary too?

@github-actions
Copy link

github-actions bot commented May 21, 2025

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/VM/VM.cpp 421:1681 Ark::VM::safeRun 3 1046 214
src/arkreactor/Compiler/Macros/Processor.cpp 239:617 Ark::internal::MacroProcessor::evaluate 3 355 125
src/arkreactor/Exceptions.cpp 87:290 Ark::Diagnostics::makeContext 9 148 56
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 484:662 Ark::internal::ASTLowerer::handleCalls 5 146 44
include/Ark/Compiler/AST/Parser.hpp 107:196 Ark::internal::ARK_APIParser::string 0 87 32
src/arkreactor/Compiler/Macros/Processor.cpp 102:185 Ark::internal::MacroProcessor::processNode 3 61 27
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 127:231 Ark::internal::ASTLowerer::compileExpression 5 86 27
src/arkreactor/Compiler/AST/Node.cpp 233:306 Ark::internal::Node::debugPrint 1 64 24
src/arkreactor/Compiler/AST/Parser.cpp 292:428 Ark::internal::Parser::import_ 0 109 23
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 257:315 Ark::internal::ASTLowerer::compileListInstruction 4 48 22
src/arkreactor/VM/VM.cpp 1781:1887 Ark::VM::backtrace 3 92 20
src/arkreactor/Compiler/AST/Node.cpp 160:231 Ark::internal::Node::repr 0 59 18
src/arkreactor/Compiler/Macros/Executors/Function.cpp 16:88 Ark::internal::FunctionExecutor::applyMacro 2 55 17
src/arkreactor/Compiler/Macros/Processor.cpp 699:738 Ark::internal::MacroProcessor::isConstEval 1 35 16
src/arkscript/Formatter.cpp 168:224 Formatter::format 3 53 16
src/arkreactor/Exceptions.cpp 292:303 Ark::Diagnostics::helper 9 11 2
Report about files you didn't modify in this PR
Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/Compiler/BytecodeReader.cpp 274:557 Ark::BytecodeReader::display 4 241 95
src/arkscript/JsonCompiler.cpp 27:260 JsonCompiler::_compile 1 200 36
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 163:274 Ark::internal::NameResolutionPass::visitKeyword 3 93 32
src/arkscript/main.cpp 17:346 main 2 284 31
src/arkreactor/TypeChecker.cpp 110:194 Ark::types::generateError 5 72 24
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 55:161 Ark::internal::NameResolutionPass::visit 2 87 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/TypeChecker.cpp 28:108 Ark::types::displayContract 4 70 19
src/arkscript/REPL/Utils.cpp 52:184 Ark::internal::getColorPerKeyword 0 110 19
src/arkreactor/Compiler/NameResolution/StaticScope.cpp 68:109 Ark::internal::NamespaceScope::get 2 32 18
src/arkreactor/VM/Value.cpp 67:127 Ark::Value::toString 1 48 18
include/Ark/Compiler/AST/Predicates.hpp 132:156 Ark::internal::IsSymbol::operator ( ) 1 24 16

CppCheck report

Filename Line Type Description
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 18 performance Variable 'm_ruleset_two' is assigned in constructor body. Consider performing initialization in initialization list.
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 12 style struct member 'EntityWithOffset::offset' is never used.
Report files about files you didn't modify in this PR
Filename Line Type Description
src/arkreactor/Compiler/BytecodeReader.cpp 440 style struct member 'Arg::kind' is never used.
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 143 style Consider using std::find_if algorithm instead of a raw loop.

@github-actions
Copy link

github-actions bot commented May 21, 2025

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 : 37 thousands
 Cumulative speed : 124 execs/sec
    Pending items : 150 faves, 1187 total
 Coverage reached : 13.06%
    Crashes saved : 1
      Hangs saved : 0

Cycles without finds : 0
Time without finds : 0

[+] Captured 46216 tuples (map size 210875, highest value 255, total values 412454416) in '/dev/null'.
[+] A coverage of 46216 edges were achieved out of 210880 existing (21.92%) with 1197 input files.

@SuperFola SuperFola force-pushed the feat/various-improvements branch from 429a5bc to b8999bf Compare May 21, 2025 16:46
SuperFola added 2 commits May 21, 2025 18:50
…n index to get the last element

It would convert -1 to an unsigned value, get 1, and see that 1 is outside our array,
instead of checking if the index was negative and then using size + index as the
wanted index
@SuperFola SuperFola force-pushed the feat/various-improvements branch from b8999bf to 17f527c Compare May 21, 2025 18:50
SuperFola added 14 commits May 22, 2025 17:53
…ng two new bench for closures and lists representing trees
…p as well, compacting two instructions in one
…merge LOAD_CONST;LT;POP_JUMP_IF_FALSE into one better instruction
…OM_SYMBOL_INDEX to load a field from a closure in a single instruction
…r instructions and ignore HALT in the frequencies
…_JUMP_IF_TRUE to compare a symbol to a const and a symbol to a symbol (respectively), then jump to an address if true
…on to compare a symbol to a const, then jump to an address if they differ
@codspeed-hq
Copy link

codspeed-hq bot commented May 23, 2025

CodSpeed Performance Report

Merging #539 will improve performances by 24.92%

Comparing feat/various-improvements (241f342) with dev (4ade02b)

Summary

⚡ 2 improvements
✅ 11 untouched benchmarks
🆕 2 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
ackermann 488 ms 437.6 ms +11.53%
🆕 create_closure N/A 5.1 ms N/A
🆕 create_list N/A 7.5 ms N/A
for_sum 1.3 s 1.1 s +24.92%

@SuperFola SuperFola force-pushed the feat/various-improvements branch from 42ecb3d to ff6b010 Compare May 23, 2025 11:23
…super instructions to get elements from list in a single instruction
@SuperFola SuperFola merged commit c9b21ff into dev May 23, 2025
25 checks passed
@SuperFola SuperFola deleted the feat/various-improvements branch May 23, 2025 16:19
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