Write closing thoughts in development log
This commit is contained in:
1 parent
7773c79d6f
commit
5a46db89d6
1 file changed
+35
@@ -238,3 +238,38 @@ The final pipeline I ended up with was:
|
|||||||
|
|
||||||
I then created an `evaluator` function to wrap this up in the `eval`
|
I then created an `evaluator` function to wrap this up in the `eval`
|
||||||
module, to allow for a simple interface to the whole library.
|
module, to allow for a simple interface to the whole library.
|
||||||
|
|
||||||
|
## Conclusion / Closing thoughts
|
||||||
|
|
||||||
|
Creating the differentiation program was a lot of fun, and I'm happy
|
||||||
|
with the result I ended up with. The code is well-tested, and for the
|
||||||
|
most part is fairly maintainable (perhaps with the area needing the
|
||||||
|
most work in that respect being the constant folding pass).
|
||||||
|
|
||||||
|
In order to quantify how effective the test suite is, I ran a mutation
|
||||||
|
testing tool (`cargo-mutants`) and it found that only 3 out of 221
|
||||||
|
generated mutants were missed by the test suite, giving a mutation
|
||||||
|
score of 98.6% which is very good. The three missed mutants were also
|
||||||
|
limited to the demo program itself (which makes sense since it has no
|
||||||
|
tests) and error message formatting code, so none of them are
|
||||||
|
particularly concerning.
|
||||||
|
|
||||||
|
There are quite a lot of areas where further work could be done, such
|
||||||
|
as adding support for functions like sine, cosine and natural
|
||||||
|
logarithms; enhancing the simplification and canonicalisation passes
|
||||||
|
and allowing non-constant exponents. However, I think the most
|
||||||
|
interesting enhancement would be to add equalities to the language and
|
||||||
|
allow definitions to be stored within a session, with explicit
|
||||||
|
differentiation commands to get the deriviative of something, such as:
|
||||||
|
|
||||||
|
```
|
||||||
|
> y = x^3 - x^2
|
||||||
|
> dy/dx
|
||||||
|
3x^2 - 2x
|
||||||
|
```
|
||||||
|
|
||||||
|
This, along with a few other features, would transform the program
|
||||||
|
into a more general-purpose symbolic mathematics engine, which would
|
||||||
|
be very cool and useful. The current architecture would allow for
|
||||||
|
this quite nicely, as evaluators are able to have mutable state which
|
||||||
|
could be used for storing variable bindings.
|
||||||
Reference in new issue
Block a user