Solve math problems with GNU Emacs Calc RPN keyboard macros, powered by an LLM.
Give a math problem to an LLM (e.g. Claude). The LLM uses the reference docs and examples as context to produce a Calc RPN macro that solves it. The macro is injected into Emacs in order to get the result.
For instance, "10,001st prime number" returns 2 SPC 10001 SPC 1 - Z< k n Z> and 104743.
- Problem solving in GNU Calc
- Converter from Common Lisp to GNU Calc
The LLM uses:
- Calc RPN command reference -- methodology, rules, and comprehensive command cheat sheet with reusable idioms
- 8 examples of annotated and compact macros
Paste a macro into Emacs, select it, run M-x read-kbd-macro, switch to Calc and press X.
Or test from the command line:
emacs --batch -l elisp/calc-runner.el -f calc-runner--main "2 RET 3 +"docs/calc-reference.md -- Calc RPN command reference
docs/examples-of-annotated-and-compact-macros.md -- 8 examples
elisp/calc-runner.el -- Elisp bridge (emacs --batch)
- calc-problem-solving -- the original collection of solved Project Euler problems with Calc
- cl-lisp2calc -- Common Lisp to Calc compiler
Open an issue or start a discussion.