Releases: rail5/bashpp
Releases · rail5/bashpp
v0.8.3
- Internal system methods refactored:
Treat all internal system methods (such as __new, __delete, __copy) as
ordinary methods. - Removed special-casing for system methods; they are now generated,
overridden, and dispatched using the same mechanisms as user-defined
methods. - Improved method override and inheritance logic for system methods, ensuring
correct virtual/override semantics. - Refactored code generation for object creation, deletion, and copying to
use generated methods (__new, __delete, __copy) instead of templates or
global functions. - Enhanced constructor and destructor handling for better inheritance and
chaining. - Added comprehensive regression tests for copy, delete, and constructor
chaining behaviors. - Code cleanup and improved error propagation in method prologues.
v0.8.2
v0.8.1
- bpp: Enhanced method override tracking and reference propagation:
Added weak pointer tracking for overridden methods in bpp_entity and
bpp_method.
Improved reference propagation for "find all references" and "rename
symbol". - bpp: Refactored method inheritance and constructor codegen for
virtual/override correctness:
Improved vTable and constructor call code generation.
Centralized constructor call logic.
Optimized method inheritance and override tracking. - bpp: Bug fix: for/select statements: Ensure code buffers are flushed.
- bpp: More efficient CRTP: Removed std::invoke and map, use switch with
if constexpr. - bpp: FlatIntervalTree: Replaced IntervalTree for better cache locality and
performance. - bpp: Error handling improvements:
Preserve node children for diagnostics.
Unified InternalError and SyntaxError handling.
Improved error reporting and tree traversal.
Display 1-indexed line/column numbers in error messages. - bpp-lsp: Bug fix: Properly identify entities as lvalues in assignments in
the language server. - bpp-lsp: Adaptive debounce timing for didChange notifications in the
language server
Debounce interval now adapts to reparse durations.
Simplified unsaved changes tracking.
Improved logging and thread safety. - bpp-lsp: Bug fix: Provide completions after 'this'/'super' keywords in the
language server. - bpp-lsp: Changed global BashppServer instance to pointer for better server
lifetime control. - libstd-bpp: STL: Use supershells, remove head/tail dependencies, use sed.
- Test suite: Use supershells for faster execution.
v0.8.0
This is a MASSIVE upgrade involving a MASSIVE speed increase.
Here is an article about this change: https://log.bpp.sh/2026/01/25/the-parser-is-dead-long-live-the-parser.html
- Rewrote the entire lexer/parser using Flex/Bison instead of ANTLR4
This also comes with a MASSIVE parser speed-up. It's orders of
magnitude faster than it was before.
This also means we now manually build and traverse our own AST,
giving us greater control.
This is arguably the biggest internal change to the compiler since
the v0.1 release. - Fixed #10 incidentally as a consequence of the parser rewrite.
All generated pre- and post-code for Bash++ constructs is now
guaranteed to only run in the event that the main code itself runs. - bpp-lsp: Added a '-b' / '--target-bash' option to the language server
This mirrors the same option in the compiler, and affects some
diagnostics and warnings about compatibility. - Reworked ObjectReference handling from the ground-up
- Solved a few memory leaks by removing owning pointers where owneship
was neither necessary nor desirable - Fixed parsing and handling of heredocs
Previously, the parser naively assumed that the heredoc header/delim
had to immediately precede the heredoc content. There is no such
restriction imposed by Bash. We now parse accurately - Preserve exit status codes of executed commands using the new __repeat
system function
v0.7.1
- Compile with C++23 standard
- bpp-lsp: Eliminate deadlock potential in ProgramPool
Restrict ourselves to only one mutex, and use atomic operations on
the snapshot state instead of relying on a secondary mutex which
could otherwise potentially cause deadlock - bpp-lsp: Bug fix: avoid re-parsing twice
- docs: Cleaned up synopsis on manual page for 'typeof'
v0.7.0
- bpp: Added typeof operator: Returns a pointer's class name as a
string - Dynamic casts: return nonzero exit code if the cast fails under any
circumstances - bpp: Allow dynamic_casts to resolve the target class dynamically at
runtime
With this update:- @dynamic_cast<$shell_var> and @dynamic_cast<@object.reference> are now valid syntax
- If a shell variable or object reference are given as the target 'cast-to' class, the compiler will expect to resolve the class type at runtime
- @dynamic_cast<ClassName> is still absolutely valid syntax, however, ClassName being invalid will no longer result in a syntax error, but will instead give a warning that 'ClassName' does not refer to any known class and that the cast may fail at runtime
- Error reporting overhaul: Better and more conscious UTF8 handling
Removed the 'position_unknown' checks; we no longer have to deal
with unknown positions now that we're not relying on ANTLR's built-
in position tracking
Separation of concerns: moved padding, etc, utf8 procedures to
helper functions rather than complicating things by inlining
everything - Bug fix in entity resolution: Declare all temporary variables local
if possible
If we're inside a class, a supershell, or bash function, it's
possible for us to declare all temporary variables 'local', and we
absolutely should
This fixes a bug with nested object references. For example,
@this.member=@(echo @this.member and then some)
If the temporary variables necessary to access this.member are not
declared local, then:- The pre-code necessary to access this.member precedes that assignment statement
- Then, we enter the supershell in the rvalue of the assignment statement, which also contains a reference to this.member
- So, once again we generate the pre-code necessary to access it, we access it,
- AND THEN we execute the post-code necesary to clear the memory
- That memory having been cleared, we return from the supershell context to the broader assignment statement
And we find that we no longer know where to put the rvalue.
The variables which told us how to access this.member have been
cleared from inside the supershell.
If we declare all temporary variables local however, then the pre-
and post-code within the supershell is entirely isolated from the
pre- and post-code of the surrounding assignment statement.
- STL: Added Typed versions of arrays, stacks and queues
With our new dynamic cast semantics permitting runtime
evaluation of the target (casted) type, runtime type restrictions
become enforceable and typed containers such as these become
possible - STL: Added TypedShared classes: Shared (concurrency-safe) data
structures with runtime type enforcement on their elements - bpp-lsp: Wrap program parsing in try-catch
No need to crash if there's a ParseCancellationException etc.
The lexer & parser still need a full rewrite. - bpp-lsp: ProgramPool: Verify parsing was successful before changing
pool state
This prevents crashes which may come from storing 'nullptr' parse
results in the program pool's state, and later (unthinkingly) using
them as if they were valid pointers. It also prevents us from losing
diagnostic information about programs which have been parsed, which
have also undergone incomplete updates that can't yet be fully
re-parsed. - bpp-lsp: Keep state AND snapshot of state
This eliminates any slight possibility for race conditions, where
one thread may jump the queue and access an element of the
ProgramPool's state while another thread is simultaneously modifying
it
v0.6.2
- Error reporting: Highlight error string in red & underline
Unified output_syntax_error(varied types, message) to a
single templated function
Assign syntax error position to object_assignment ctx rather than
a specific token - Bug fix: Object instantiations: inherit current class from context
- Bug fix: Protect against primitive value assignments in object
instantiations - bpp-lsp: Use libfrozen-dev to make request/notification handler maps
constexpr
v0.6.1
- Lexer: handle position tracking with potential (as yet
unimplemented) multi-line tokens
This also fixes a bug in position tracking re: escaped newlines
Our previous (naive) procedure was simply to assume that if a newline
was emitted, it was as its own independent token with no other content
Therefore we just compared token->getText() to '\n'
But escaped newlines were emitted as "\\n", which meant that we weren't
properly tracking source code position data when these were present
Further, multi-line tokens will very likely be implemented in our
eternally-pending lexer/parser rewrite, in an effort to more efficiently
handle strings as statements of arbitrary string_data + occasional
interpolation sequences like object references, supershells, etc. - Docs: Consistent formatting in the compiler manual
- bpp: More helpful error reporting in object instantations / pointer
declarations - bpp_program: Keep entity maps even if empty for all source files
- Lexer: No double emits Double-emits screw up position tracking
v0.6.0
- bpp: Added --target-bash/-b option
This option allows you to specify the target Bash version for
compiled code. If specifying a version >= 5.3, supershells will
compile to use Bash 5.3's new native supershell implementation
There is a plan to support compiling to Bash < 4.0, but this has
not yet been implemented. Default Bash target is 5.2 - Cleaned up manuals
- bpp-lsp: Resolve nonprimitive data members of classes
- bpp-lsp: Fixed code completions when suggesting data members, methods
- bpp-lsp: Full support for Reference Requests ("Find references")
v0.5.7
- bpp-lsp: Allow immediate port reuse, set SO_REUSEADDR
- bpp-lsp: Renamed port/socket longopts to be more intuitive
- bpp-lsp: Renamed longopt to match corresponding option in bpp
- Corrected inaccuracies in the documentation
- bpp: Track class references in object instantiations, dynamic
casts, and pointer declarations