A supercharged implementation of the godbolt compiler-explorer for Emacs.
RMSbolt tries to make it easy to see what your compiler is doing. It does this by showing you the assembly output of a given source code file. It also highlights which source code a given assembly block corresponds to, and vice versa. It supports more types of languages than any previous tool of its kind.
This README is a condensed version of the docs. For full usage instructions, please start at the docs (also available through info).
- Much more flexible and powerful:
- Supports disassembly to bytecode as well as assembly.
- Supports many languages that godbolt does not support, such as PHP,
- Common Lisp, Emacs Lisp, and Pony.
- Allows targeting custom compilers - which means disassembly for niche assembly targets, specific commits of compilers, and patched libraries or compilers is possible.
- No more sending your code to any server.
- Much faster turnaround time from writing code to seeing and interacting with disassembly.
- 100% usable without the mouse.
- Runs entirely without node, npm, or js:
- No required dependencies other than Emacs 25 and your compiler
:)
- It’s easy to add new languages (even those that use unique bytecode formats) without touching many files.
- Doesn’t eat your ram on the ‘server’ or the ‘client’.
- No enforced limits on code size, compilation time, or processing time.
- No required dependencies other than Emacs 25 and your compiler
- Benefits from living in Emacs:
- Full undo tree from Emacs on disassembly/source so you don’t lose work.
- Vim bindings through evil/viper.
- Use compile.el, flymake, or flycheck to traverse and fix errors as you would normally.
- Use any libraries on your machine trivially.
- Customize colors and behavior through
customize
. - Change tracking through magit/diff-hl/etc.
- Nyans are fully supported with nyan-mode.
- Simpler.
- Infinitely hackable!
rmsbolt will almost certainly not work naively on windows as it depends on a unix shell for building the compilation commands. It may work through cygwin though.
A melpa package is available for rmsbolt.
(quelpa '(rmsbolt
:files (:defaults "starters")
:fetcher gitlab
:repo "jgkamat/rmsbolt"))
Run rmsbolt
to compile the current buffer. This enables rmsbolt-mode
for code region highlighting and automatic recompilation on buffer changes.
rmsbolt-mode
also adds the key binding C-c C-c
to run a compilation.
Run rmsbolt-starter
to generate an example source file for one of the supported languages.
Run rmsbolt-compile
to start a compilation without enabling rmsbolt-mode
.
Language-specific quirks are listed in the full documentation.
RMSbolt is primarily configured with Emacs local variables. This lets you change compiler and rmsbolt options simply by editing a local variable block. The starter files have this block with some common settings:
// Local Variables:
// rmsbolt-command: "gcc -O0"
// rmsbolt-disassemble: nil
// End:
Note: the Local Variable block must be 3000 characters from the end of the file to work. Any method of setting buffer-local variables will work though.
The main knobs are described in the full documentation.
If you need help, have questions, or just want to chat about compilers, feel
free to drop by #rmsbolt
on Libera. Please be sure to stick around, for a
reply.
If you find issues, please send me a mail or submit an issue.
If you would like to submit a patch, please submit a merge request, or send me a mail with your patch. If your change is non-trivial, please assign copyright to the FSF as well.
- Simpler Emacs Packages
- Similar Projects
Please let me know if you find other alternatives not mentioned!