Leonardus
|
The project Leonardus coding and architectural documentation is split into
a part CODING covering notes on more general aspects of
programming that could also be applied in other C++ projects.
And these very specific notes.
LeoScript will not have a garbage collection, but a controlled tree of all
existing semantic objects.
IDEA: Details
PostScript
Forth
This is a table of the SOs with details.
All objects are executable or non-executable aka literal.
This executable status becomes manifest with different OTCodes for
name objects and array objects.
For simple objects a duplicate of an object duplicates the value of the object.
For composite objects a duplicate of an object shares its value with the
original object.
There's an enum class OTCode
in the source to list all the codes.
The column type shows the result of the operator type
which is used to
identify objects in LeoScript code.
The column class shows the C++ class name of the SOs.
objects | class | exe status | OTCode | type | description |
---|---|---|---|---|---|
simple | SOL | L | nulltype | The null object is used as placeholder in arrays. | |
SOB | B | booleantype | A boolean value. | ||
SOI | I | integertype | A 128-bit integer. | ||
SOM | M | marktype | A mark object. | ||
SON | literal | N | nametype | for non-executable name objects. | |
executeable | Nx | nametype | for executable name objects. | ||
SOO | O | operatortype | A regular registered code code operator. | ||
SOo | o | operatortype | An unregistered core code operator. | ||
SOR | R | realtype | A 128-bit IEEE real number. | ||
SOQ | Q | rationaltype | A rational number with arbitrary precision. | ||
composite | SOS | S | stringtype | A string. | |
SOD | D | dicttype | A dictionary is a list of key-value pairs of SOs. | ||
SOA | literal | A | arraytype | For a non-executable array of any SOs in any order. | |
executable | Ax | arraytype | For an executable array aka procedure. | ||
SOK | K | stacktype | A stack of SOs. |
The system also makes use of abbreviations (pseudo OTCodes) to determine
groups of OTCodes.
abbreviation | description |
---|---|
Z | I or R or Q |
X | any SO |
See TESTS
A development tool overview will be generated by the build process
as TOOLS.md
.
There are three so-called build types. They denote build and, in particular,
compilation settings for different environments.
Compilation without time-consuming optimizations.
Used to develop and debug the code.
Compilation with good optimization. All debug-code is removed.
All asserts are removed.
Used for the GitLab pipeline.
Compilation without any optimization. No inlining of functions.
Compilation with instrumented code to generate profiling data.
Used to analyze function, line and branch test coverage.
make lcov
only succeeds with this build type.
The make utility can be directed by: BUILD_TYPE=PRODUCTION make leon
or
as in the GitLab pipeline configuration by: make BUILD_TYPE=PRODUCTION leon
or by: export BUILD_TYPE=PRODUCTION
.
If you change the build type a make clean
is recommended.
The command line tools lc
, lb
, leon
, and parser
print the build type
with which they were generated as the first line in their help text.
These are: lb, lc, parser, leon.
These are: e2e.sh, ctest.sh.
We use a two-part Version Number consisting of a major and minor
version, separated by a period. We started with "0.9".
Release Numbers are assigned to these version numbers by appending
a sequential number starting from 1. Therefore, the first release number
was 0.9.1. When the version number is increased, the last number is reset
to 1. Consequently, the first release of version 1.0 is 1.0.1.
Release numbers are stored in git as Release Tags prefixed with 'v'.
Thus, the first release tag is "v0.9.1". In git, the first commit intended
for a release is tagged with this release tag.
The last commit in the release cycle receives a Release Completion Tag
in git. This release completion tag in git has the form of the release tag
with the appended text "--release". Therefore, the first release
completion tag is named "v0.9.1--release".
For each release completion tag, a GitLab Release Object, i.e., a
release in the sense of GitLab, is created.
When a new release is created, a new section is opened in the
CHANGELOG.md for this release. The Release Date of the previous
release is also assigned then. This is the date the respective Git
release object was created.
The section of the previous release in the CHANGELOG is manually revised
when a new release is created. The revised content of the CHANGELOG section
for a release serves as the Release Notes.
For each commit, the corresponding commit message should be appended to
the CHANGELOG. This can be done automatically by installing a git hook
from TOOLS.
A release consists of:
git push
git push origin tag vx.y.z--release
git push
git push origin tag vx.y.z+1
make clean
make
release-info outputmake e2e
./leon -h
release-info outputThe available makefile targets can be displayed by using the the
make
command without options.
The makefile will be triggered from the GitLab pipelines. All process
details are implemented in the makefile and its helping scripts.
Intenionally there are no details coded in the pipeline YAML configuration.
Both the makefile and the CI/CD pipeline are structured into the same five stages:
The makefile supports two different dependency mechanisms:
Main interpreter loop
Interpreter::leonline()
.SON::load_exec()
Processes one line of the leon-format input.
{
, }
are pushed onto Looks up a name and executes it.
Calls the C++ machine code associated with the SOO and SOo.
Unfolds duplicates of the array-content to the execution stack.
Replaces executable names with operator objects recursively into elements
that are SOA. Also does further optimization if Interpreter::odo_
ist set to true.
These dictionary stack manipulations influence what is found by
SON::load_exec()
.
The exec operator pushes
SOA::unfold2exec()
andonto the execution stack.
The loop operators push
SOA::unfold2exec()
onto the execution stack.
The installation of the Boost library in a GitLab pipeline image requires a
apt -y install gfortran- libboost-all-dev
, because of Fortran config issues.
Following Boost modules are in use:
BOOST_ASSERT, BOOST_ASSERT_MSG, BOOST_ASSERT_IS_VOID
are used as building blocks for
DBC_PRE, BDC_POST, DBC_INV, DBC_INV_CTRO, DBC_INV_RAII and DBC_IS_VOID
See TESTS
The following GitLab features are used:
Additional features will be integrated over time.
KDevelop creates a .kdev4
file and a ./kdev4
directory. These files
are integrated into the git repository to share them.
VSC creates a ./vscode
directory. This directory is integrated into
the git repository to share it as reference.
The following helpful adjustments can be made from the example configuration files c_cpp_properties.json
und settings.json
:
GITRELEASE
and BUILD_TYPE
.leo
as PostScript fileThe 'Todo Tree' extension can handle our task tags appropriately.
The 'Lex' extension improves syntax highlighting for the flex source.
The 'Docker' extension supports Dockerfile editing.
The Dockerfiles to build the images are located in ./Docker
.
The images are hosted on Docker hub under the user hagenbund2.
The makefile target dockerize
builds a Docker image with a Leonardus
installation and pushes it to the Docker hub.
We build our own custom CI/CD images with preinstalled software to improve
CI/CD speed of the GitLab pipelines.
These are the steps to build them:
To run Docker in Docker on a workstation:
To run Docker in Docker on GitLab we use in the .gitlab-ci.yml
:
$CI_REGISTRY_USER and $CI_REGISTRY_PASSWORD are stored in the GiLab project
as CI/CD variables.
To run Docker commands as a non-root user, add your user to the "docker" group.
This is particularly necessary for integration with the makefile to trigger
the "dockerize" target locally during development. To do this, enter the following: