Using Python Ruby Golang as Quick Calculator in Emacs

By Xah Lee. Date: .
ruby as calculator in emacs d78e5
ruby as calculator in emacs
golang as calculator in emacs 5b5c7
golang as calculator in emacs

1 i now use golang as calculator. C-n new buffer, g3 inserts main template. type 1+2, space w j shows result.

2 many advantages of using lang instead of emacs Alt+x calc. faster, more powerful, flexible, and saved result, editable.

3 you can use golang python ruby or nodejs etc. Either in eshell, or in a buffer and press a button to run it.

4 i used to use emacs calc for quicky back in 1999. switched to python ~2009. then switched to ruby, now golang.

5 for example, ruby, just Alt+x eshell, irb, 1+3 enter.

6 but notebook interface is usually better than repl, cuz you have more powerful editing and saving features

7 e.g. Ctrl+n open new, type p 1+2, Alt+x xah-run-current-file, type x.rb, result shows 3

8 for lang require template such as golang “main” stuff, just type g3 and it inserts it. Using emacs abbrev.

For how to setup, see

put in a few bucks to my patreon. https://www.patreon.com/xahlee Thanks.

Ask me question on patreon