Releases: rail5/bashpp
Releases · rail5/bashpp
Release list
v0.4.1
- Added language spec manuals to section 3
You'll find manpages describing the functionality of the language
such as bpp-new(3) and bpp-dynamic-cast(3), which describe the
functionality of '@new' and '@dynamic_cast' respectively, or
bpp-classes(3), which describes the structure of a class in Bash++,
etc.
This documentation is also available on the website
v0.4.0
- Updated include syntax
Includes now allow you specify whether each include should be linked
dynamically or statically, and if dynamically, allows you to
optionally specify where the compiled library will be found at runtime
The syntax is still backwards- compatible and the new features are
optional. - Made system __delete function virtual
This ensures that we'll always call the correct __delete function
regardless of the compile-time inferred type of the object - Rely on generate_delete_code when deleting non-primitive data
members in classes
Less code duplication, more reliable, only one place to change things - destruct_local_objects: rely on generate_delete_code for
implementation - Better build system
More idiomatic GNU Makefile, faster re-builds on changes - Decoupled code generation functions from the listener class
v0.3.8
- Treat constructors and destructors as ordinary methods
Prior to this, constructors and destructors were treated specially
Now, they're treated as ordinary methods which are always VIRTUAL
and PUBLIC. This simplifies things and fixes a few bugs, namely:
Before this change, instantiating an object of class A, and copying
its address to a pointer of class B (which is allowed in Bash++),
and then later calling@deleteon the B pointer, would have called
B's destructor if it had one. This is clearly incorrect behavior
Ensuring that the destructor is virtual forces this to do a vtable
lookup, guaranteeing that we call the correct destructor regardless
of the compile-time inferred type.
Further, before this change, defining a constructor or destructor
within a base class would preclude the possibility of implementing a
separate constructor or destructor in a derived class.
Now that constructors and destructors follow the rules for ordinary
methods (and are virtual), no special logic is necessary in order to
override them in derived classes.
Base class constructors and destructors are still inherited in
derived classes by default. - Object instantiations:
Verify that the desired class exists earlier rather than later
Fixes a segfaulting bug - New statements: call constructors before returning the pointer
Ensure that objects which have not yet been constructed are not
processed too early
v0.3.7
- Test-suite: Added test for nonprimitive copies
- value_assignment: always get address directly from rvalue_object,
do not infer (fixes bug with nonprimitive copies) - Dereference pointers at runtime
Has strong potential to reduce compiler complexity - Make pointer declarations within methods local by default
v0.3.6
- Method handler: Move sanity checks to entry rule
This allows us to skip parsing invalid methods
(non-public toPrimitive, or duplicate method definitions),
saving time
Adding the method to the class before parsing its contents
also allows methods to refer to themselves, which is necessary
for recursive methods
v0.3.5
- Proper support for c-style arithmetic Bash for loops
- More sane handling of bash arithmetic statements
- Proper support for bash number ranges '{#..#[..#]}'
- Compiler source code cleanup:
Made bpp_method's 'add_object_as_parameter' private
Externally we should only ever call add_parameter, which should
determine whether the parameter is nonprimitive on its own
v0.3.4
- Allow taking the address of an object's method
Return value of &@object.method should be:- A function pointer to the method
- Plus the object pointer as the method's implicit first parameter
E.g, 'echo &@object.method' should echo something like
'bpp__Class__method address__of__object'
- Incidental bug fix: vTable lookups in rvalue self references.
Patched by properly using the abstracted generate_method_call_code
function rather than duplicating its functionality. The duplicate
code was a relic from before that abstracted function existed and
should've been noticed and patched out sooner - Parser speedup
Removed left-side ambiguity between member declarations and method
definitions by enclosing them in a shared parent rule
A total rewrite of the lexer/parser is almost definitely incoming
v0.3.3
v0.3.2
- Builds: Only search for dynamic libs if static libs can't be found
- Run an implicit dynamic cast when a method takes a non-primitive argument. Here is a short article on this change
- Abstracted dynamic cast code generation to its own function
v0.3.1
- Keep object counter in compiler
This closes #6, although the allocations are not randomized at
runtime. This decision may be revisited later
An incidentally necessary change for this fix is that the 'isPtr'
nonsense from templates.h had to be removed entirely, methods
internally must accept a pointer as the first argument and no extra
information, just as in C++ for example