CalcuLaTeX
CalcuLaTeX copied to clipboard
CalcuLaTeX 2.0
CalcuLaTeX has potential, but it's held back by messy code and a badly designed arbitrary precision unit math system.
Arbitrary precision unit math is a pain. There are a number of libraries for it in Rust, but many of them are either made for type safe compile-time usecases, or are text based calculators.
An obvious solution is to use one of these text based calculators with a custom parser and then compile the result to LaTeX. However, an easier and less efficient solution is to use the language as an IR.
For example, with fend, we could compile CalcuLaTeX input to fend input, run fend, and then re-parse fend output and display it with LaTeX. It would probably be easier to intercept a FendResult
on the output end and compile it to LaTeX. However, on the input side I believe it would be a lot easier to generate a fend input string than to actually create a Fend IR.
Using this method, a lot of CalcuLaTeX's general design might stay the same. Right now, input expressions (left side of the = ?
), are basically directly translated to LaTeX, and that won't change.
One major issue with this approach is vectors and matrices