tame/tamer
Mike Gerwitz 9f74c0fc92 tamer: asg::graph: Strict static enforcement of tree/cross edge spans
We are now able to have confidence that the graph is properly constructed
with or without a reference span depending on whether the edge is a tree or
cross edge.  Consequently, the span is now a reliable indicator of whether
an edge is tree or cross in _all_ cases, not just in dynamic ones.

In fact, this did catch a couple cases where the spans were _not_ properly
applied.

This will in turn give me confidence moving forward with static analysis
based on the graph (and edge hooks).

I could go further than this by introducing a new span type in place of
`Option<Span>`, which would also allow me to get rid of having two methods
on `Asg`, but I want to move on for now; this can be cleaned up more later
on.

It's also worth noting that this explicit method-based distinction between
edge types also means that each caller will carefully consider how the
operation affects the graph.  Previously, that consideration was framed very
differently: "do I need a contextual span or not?".  That's not the right
question to ask.

DEV-13163
2023-08-01 09:41:35 -04:00
..
benches tamer: benches: Remove asg and asg_lower_xmle microbenchmarks 2023-05-17 11:14:00 -04:00
build-aux tamer: asg::air::object::tpl: Reject multi-expression shape 2023-07-26 04:03:52 -04:00
src tamer: asg::graph: Strict static enforcement of tree/cross edge spans 2023-08-01 09:41:35 -04:00
tests tamer: asg::air::object::tpl: Reject multi-expression shape 2023-07-26 04:03:52 -04:00
.gitignore tamer: configure.ac: conf.sh: New configuration file 2023-03-10 14:27:57 -05:00
Cargo.lock tamer: asg::graph::visit::topo: Introduce topological sort 2023-04-26 09:51:45 -04:00
Cargo.toml tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
Makefile.am tamer: Makefile.am: cargo clippy: Use active feature flags 2023-03-17 10:20:56 -04:00
README.md Copyright year and name update 2023-01-20 23:37:30 -05:00
autogen.sh Copyright year and name update 2023-01-20 23:37:30 -05:00
bootstrap tamer: Support nightly Rust toolchain pinning 2023-06-05 16:42:31 -04:00
conf.sh.in tamer: asg::graph::object::xir: Initial rate element reconstruction 2023-03-10 14:27:58 -05:00
configure.ac tamer: Support nightly Rust toolchain pinning 2023-06-05 16:42:31 -04:00
rust-toolchain.toml tamer: nightly pin: Describe problems with adt_const_param's ConstParamTy 2023-06-06 11:00:44 -04:00
rustfmt.toml tamer/rustfmt (max_width): Set to 80 2019-11-27 09:15:15 -05:00

README.md

TAME in Rust (TAMER)

TAME was written to help tame the complexity of developing comparative insurance rating systems. This project aims to tame the complexity and performance issues of TAME itself. TAMER is therefore more tame than TAME.

TAME was originally written in XSLT. For more information about the project, see the parent README.md.

Building

To bootstrap from the source repository, run ./bootstrap.

To configure the build for your system, run ./configure. To build, run make. To run tests, run make check.

You may also invoke cargo directly, which make will do for you using options provided to configure.

Note that the default development build results in terrible runtime performance! See [#Build Flags][] below for instructions on how to generate a release binary.

Build Flags

The environment variable CARGO_BUILD_FLAGS can be used to provide additional arguments to cargo build when invoked via make. This can be provided optionally during configure and can be overridden when invoking make. For example:

# release build
$ ./configure && make CARGO_BUILD_FLAGS=--release
$ ./configure CARGO_BUILD_FLAGS=--release && make

# dev build
$ ./configure && make
$ ./configure CARGO_BUILD_FLAGS=--release && make CARGO_BUILD_FLAGS=

Hacking

This section contains advice for those developing TAMER.

Running Tests

Developers should be using test-driven development (TDD). make check will run all necessary tests.

Code Format

Rust provides rustfmt that can automatically format code for you. This project mandates its use and therefore eliminates personal preference in code style (for better or worse).

Formatting checks are run during make check and, on failure, will output the diff that would be applied if you ran make fmt (or make fix); this will run cargo fmt for you (and will use the binaries configured via configure).

Since developers should be doing test-driven development (TDD) and therefore should be running make check frequently, the hope is that frequent feedback on formatting issues will allow developers to quickly adjust their habits to avoid triggering formatting errors at all.

If you want to automatically fix formatting errors and then run tests:

$ make fmt check

Benchmarking

Benchmarks serve two purposes: external integration tests (which are subject to module visibility constraints) and actual benchmarking. To run benchmarks, invoke make bench.

Note that link-time optimizations (LTO) are performed on the binary for benchmarking so that its performance reflects release builds that will be used in production.

The configure script will automatically detect whether the test feature is unstable (as it was as of the time of writing) and, if so, will automatically fall back to invoking nightly (by running cargo +nightly bench).

If you do not have nightly, run you install it via rustup install nightly.