
Tinyexpr: parser, compiler, and evaluation engine in C for math expressions - blacksqr
https://codeplea.com/tinyexpr
======
ridiculous_fish
fish shell uses tinyexpr for its math implementation. It's great, the perfect
little focused library.

------
codeplea
I wrote this. I'm glad to see it posted. Happy to answer any questions.

------
jbottoms
How does it compare with Djikstra's stunting algorithm?

~~~
codeplea
It's apples and oranges really. I would say that it's easier to use recursive
descent to parse a full programming language though.

Shunting yard works very well if you want to parse math expressions into
postfix notation. It is then really easy to run postfix notation into bytecode
on a stack-based virtual machine.

For comparison, here is a shunting yard based math expression evaluator in
Javascript that I wrote before writing TinyExpr:
[https://github.com/codeplea/rimath](https://github.com/codeplea/rimath)

