RMSbolt

I have always felt that knowing, at least in a general way, how a higher level language compiles down to machine code enables one to write better code in the higher level language. That’s not to say that everyone should learn their processor’s assembler language—that’s not necessary these days and would require an effort greater than the expected returns—only that you should be able to read an assembly listing and get a general idea of what it’s doing. This seems so obvious to me that I don’t understand how people can disagree. Some do, however, and they probably won’t be interested in this post.

For many languages it’s possible to get a listing of the assembler output or, in the case of languages like Python, a listing of the bytecode. The problem is that in most cases it’s enough trouble that you won’t bother unless you have a pressing need. Jay Kamat’s RMSbolt package makes everything easy and will give you an automatically updating display of the generated code in a window next to your source code.

Take a look at the animated GIFs in the project’s README to see it in action. This is really ideal because it will let you try alternative statements and see how their code differs. Compilers are always doing surprising things, sometimes even erroneous things, so this can be very useful.

RMSbolt supports C/C++, OCaml, Haskell, Python, Java, Pony, and (limited) Common Lisp. It’s available from Melpa and doesn’t require anything other than Emacs 25 or greater and whatever compilers you’re using.

UPDATE [2018-10-03 Wed 17:55]: Fix link.

This entry was posted in General and tagged . Bookmark the permalink.