Skip to content

v1.14.0

Choose a tag to compare

@github-actions github-actions released this 18 Aug 10:33
· 236 commits to main since this release

New Functionality

  • GH-2028: New interprocedural optimizations.

    We added infrastructure for performing interprocedural optimizations, and as a first user added a pass which removes unused function parameters in GH-2030. While this works on any code it is mainly intended to simply generated parser code for better runtime performance.

  • GH-1697: Remove some dead statements based on control and data flow.

    We now collect control and data flow information. We use this to detect and remove "dead statements", i.e., statements which are not seen by any other needed computations. Currently we handle two classes of dead statements:

    • assignments which are override before being used
    • unreachable code, e.g., due to preceding return, break or throw

    The implementation for this is still not able to cover all possible Spicy language constructs, so it is behind a feature flag and not enabled by default. To enable it one needs to set the environment variable HILTI_OPTIMIZER_ENABLE_CFG=1 when compiling Spicy code with e.g., spicyc.

    We encourage users to test this compilation mode and if possible use the compiled parsers in production. If parsers compiled this way show the intended runtime behavior in tests they should also be fine to use in production.

Changed Functionality

  • GH-2050: Prefer stdout over stderr for --help messages.

    Spicy tools now emit --help output to stdout instead of stderr.

  • GH-2068: Allow disabling building of tests.

    We added a new CMake option SPICY_ENABLE_TESTS which if toggled on forces building of test and benchmark binaries; it is ON by default. This flag can be used by projects building Spicy to disable building of tests if they are not interested in them. We also provide a configure flag --disable-tests which has has the effect of turning it off.

  • GH-1663: Speed up checking of iterator compatibility.

    We were previously using a control block which held a weak_ptr to the protected data. This was pretty inefficient for a number of reasons:

    • access to the controlled data always required a weak_ptr::lock which created a temporary shared_ptr copy and immediately destroyed it after access
    • to check whether the control block was expired we used lock instead of expired which introduced the same overhead
    • to check compatibility of iterators we compared shared_ptrs to the control data which again required full locks instead of using owner_before

    This manifested in e.g., loops often being less performant than possible. We now changed how we hold data to make iterating collections cheaper.

  • GH-2086: Fix scope resolution of local variables.

    If usage of a local comes before its declaration, we now no longer resolve that usage to this local. It'll either be resolved to an upper layer ID (if there is one of the same name), or rejected if it's otherwise unknown.

  • GH-2066: When C++ compilation fails, ask user for help.

    We do expect C++ code generated by Spicy to be valid, so C++ compiler errors in generated code are likely bugs. We now record the output of the C++ compiler in a dedicated file hilti-jit-error.log and ask users to file a ticket in case C++ compilation failed.

  • GH-1660: When printing anonymous bitfields inside a struct, lift up the fields.

    This now prints, e.g., [$fin=1, $rsv=0, $opcode=2, $remaining=255] instead of [$<anon>=(1, 0, 2, 255)].

    In addition, we also prettify non-anonymous bitfields. They now print as, e.g., [$y=(a: 4, b: 8)] instead of [$y=(4, 8)].

  • GH-1085: Allow registering a module twice.

    So far, if one compiled the same HILTI module twice, each into its own HLTO, then when loading the two HLTOs, the runtime system would skip the second instance. However, that's not really what we want: a module could intentionally be part of multiple HLTOs, in which case each should get its own copy of that module state (i.e., its globals).

    This change allows the same module to be registered multiple times, with the HLTO linker scope distinguishing between the instances at runtime, as usual. To make that work, we move computation of the scope from compile time to runtime, using the library's absolute path as the scope.

  • GH-1905: Fix operator precedence in Spicy grammar.

    We fixed the precedence of a number of operators to be closer to what users would expect from other language like C++ or Python.

    • we reduced the precedence of the in operator
    • pre- and postfix operators ++ and -- now have same precedence and are right associative
    • unary negate was change to match the precedence of other unary operators.
  • Switch compilation to C++20.

    Like Zeek Spicy now requires a C++ compiler. As part of this change we cleaned up the implementation to take advantage of C++ functionality in a number of places. We also moved from the external libraries linb::any to std::any, and ghc::filesystem to std::filesystem.

  • Update supported platforms.

    We dropped support for the following platforms:

    • debian-11
    • fedora-40

    We added support for

    • debian-13
    • fedora-42
  • GH-1660: Render all bitfield instances with included field names.

  • GH-2099: Fully implement iterator interface for set::Iterator.

  • GH-2052: Move calling convention from function to function type.

Bug fixes

  • GH-2057: Fix bytes iterator dereference operation.
  • GH-2065: Error for redefined locals from statement inits.
  • GH-2061: Fix cyclic usage of units types inside other types.
  • GH-2074: Fix fiber abortion.
  • GH-2063: Fix C++ compilation issue with weak->strong refs.
  • GH-2064: Ensure generated typeinfos are declared before used.
  • GH-2044: Catch if methods are implemented multiple times.
  • GH-2078: Fix C++ output for constants of constant type.
  • GH-1988: Enforce that block-local declarations must be variables.
  • GH-1996: Catch exceptions in processInput gracefully.
  • GH-2091: Fix strong->value reference coercion in calls.
  • GH-2100: Add missing deref operations for struct try-member/has-member operators.
  • GH-2119: Fix missing inline functions in enum prototypes.
  • GH-2142, GH-2134: Complete information exposed for reflection in typeinfo.
  • GH-2135: Add &cxx-any-as-ptr attribute.

Documentation

  • GH-1905: Document operator precedence.