4 ms·
RMSbolt – An implementation of the Godbolt compiler-explorer for Emacs
- partycoder 8y agoI like how "god" was substituted by "rms" (Richard Stallman's initials). Godbolt is pretty useful. It is a good idea to start by turning off compiler optimizations.
- archgoon 8y agoOne of the cool things about god bolt is I get to share some of the (probably edge case) optimizations that llvm employs. Compare the following two for loops: (gcc) https://godbolt.org/z/bNbPmo https://godbolt.org/z/bNbPmo (clang) https://godbolt.org/z/QUPTGu https://godbolt.org/z/QUPTGu Note that clang elides the loop and performs in constant time. Note also that changing the types of some of the variable signatures form long to int removes the optimization.
- glandium 8y agoInterestingly enough, Godbolt is the full last name of its author, Matt Godbolt.
- DonHopkins 8y agoNot only his initials, but also his password!
- archgoon 8y agoOh cool; the author also added support for byte code compilation; for languages like python and java.
- teddyh 8y ago> No more sending your code to any server Outstanding!
- mbrumlow 8y agoI used early versions of this before it was in GitHub. Glad to see it is progressing. It worked very well and have been in using it regularly. Can't wait to upgrade!
- wink 8y agoFunny how I seem to have misused godbolt all the time, only being interesting in the output of a piece of code or comparing some compilers, not really caring for the assembly code :P As for this I'd have to a) install emacs (shush) and b) install all those compilers I don't have installed Obligatory xkcd: https://xkcd.com/1172/ https://xkcd.com/1172/
- MrEldritch 8y agoOh, wow - this is really cool. I'd like to see a programming environment that integrated something like this directly; this seems like it could, if done cleverly, do an enormous amount for the leaky-abstractions problem. Something that was designed such that you could easily work with and analyze your code in the high-level and low-level views. Not to mention, having the machine be right there next to your code, with their correspondences clearly marked, would do an enormous amount to demystify what your code's really doing on the lower levels. (I think there's a glimmer of an idea in here for what a future programming system might look like, that allows us to use high-level abstractions and other ergonomic programming concepts AND actually think about the metal and how to use it directly at the same time. Something something interactive compilation...)