Skip to content

occisn/calc-llm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

calc-llm

Solve math problems with GNU Emacs Calc RPN keyboard macros, powered by an LLM.

Usage

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.

Related projects

- Problem solving in GNU Calc
- Converter from Common Lisp to GNU Calc

Reference for LLM

The LLM uses:

Running a macro

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 +"

Project structure

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)

Related projects

Contributing

Open an issue or start a discussion.

About

LLM to solve math problems using GNU Emacs Calc through stack-based RPN keyboard macros.

Topics

Resources

License

Stars

Watchers

Forks

Contributors