Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
compiler_version: 16
sanitizers: On
coverage: On
with_deps: false
with_deps: true

- name: Run tests
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[submodule "lib/ut"]
path = lib/ut
url = https://github.com/boost-ext/ut.git
[submodule "lib/dtl"]
path = lib/dtl
url = https://github.com/cubicdaiya/dtl.git
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
- new operator `@@` to get elements in list of lists / list of strings
- new builtin `random`, 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 macros
- `LOAD_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` and `SET_VAL_FROM_INDEX` instructions for parity with the super instructions not using load by index
- `INCREMENT_BY_INDEX` and `DECREMENT_BY_INDEX` instructions for parity with the super instructions not using load by index
- `STORE_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 index

### Changed
- instructions are on 4 bytes: 1 byte for the instruction, 1 byte of padding, 2 bytes for an immediate argument
Expand Down Expand Up @@ -109,6 +113,8 @@
- magic numbers for value types in bytecode files have been changed from 0x01, 0x02, 0x03 to 0xF1, 0xF2, 0xF3 (number, string, function)
- numbers in the values table in bytecode files are no longer stringified but their IEEE754 representation is now encoded on 12 bytes (4 for the exponent, 8 for the mantissa)
- changed how scopes are stored inside the VM to enhance performances. All scope data are now contiguous!
- when possible, accessing variables from the current scope is compiled to a new instruction `LOAD_SYMBOL_BY_INDEX`, to avoid the sometimes expansive lookup by id
- this works inside normal scopes (introduced by while loops) and functions scopes, but not for closures

### Removed
- removed unused `NodeType::Closure`
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,15 @@ endif ()
if (ARK_TESTS)
file(GLOB_RECURSE SOURCES
${ark_SOURCE_DIR}/tests/unittests/*.cpp
${ark_SOURCE_DIR}/tests/unittests/Suites/*.cpp
${ark_SOURCE_DIR}/lib/fmt/src/format.cc
${ark_SOURCE_DIR}/src/arkscript/Formatter.cpp
${ark_SOURCE_DIR}/src/arkscript/JsonCompiler.cpp
${ark_SOURCE_DIR}/src/arkscript/REPL/Utils.cpp)
add_executable(unittests ${SOURCES})
target_include_directories(unittests PUBLIC ${ark_SOURCE_DIR}/tests/unittests)

target_include_directories(unittests SYSTEM PUBLIC ${ark_SOURCE_DIR}/lib/dtl/dtl)

add_subdirectory(${ark_SOURCE_DIR}/lib/ut)
target_include_directories(unittests PUBLIC ${ark_SOURCE_DIR}/include)
Expand Down
2 changes: 1 addition & 1 deletion include/Ark/Ark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <Ark/Constants.hpp>
#include <Ark/Utils.hpp>
#include <Ark/VM/VM.hpp>
#include <Ark/Compiler/Compiler.hpp>
#include <Ark/Compiler/Welder.hpp>
#include <Ark/TypeChecker.hpp>

#endif
11 changes: 2 additions & 9 deletions include/Ark/Compiler/BytecodeReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* @file BytecodeReader.hpp
* @author Alexandre Plateau (lexplt.dev@gmail.com)
* @brief A bytecode disassembler for ArkScript
* @version 0.5
* @version 1.0
* @date 2020-10-27
*
* @copyright Copyright (c) 2020-2024
* @copyright Copyright (c) 2020-2025
*
*/

Expand Down Expand Up @@ -96,13 +96,6 @@ namespace Ark
*/
[[nodiscard]] bool checkMagic() const;

/**
* @brief Return the bytecode object constructed
*
* @return const bytecode_t&
*/
[[nodiscard]] const bytecode_t& bytecode() noexcept;

/**
*
* @return Version compiler version used to create the given bytecode file
Expand Down
Loading
Loading