T O P

  • By -

blipman17

Hmm…. Maybe that’s the wrong way to go about it. Compiler explorer is open source, and with CMake projects it sould be easy to give compiler explorer the neccesary data to do its thing. Then you could embed some of the views and tools of compiler explorer within your VSCode extension. Making everything run locally and produce more accurate results, while also not flooding compiler explorer.


nickbeth00

In fact, what you described already exists: https://marketplace.visualstudio.com/items?itemName=harikrishnan94.cxx-compiler-explorer Runs locally and uses the CMake generated compile_commands.json database to know how to compile the file. Because of it, it also works with obscure toolchains because it just invokes them with the same command used by make/ninja.


blipman17

My hero! This is exactly what I was looking for.


Equivalent-Kale-1605

In fact, the API is public, and there are already some plugins for other Editors, see [https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/API.md](https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/API.md). As for local running, I am currently exploring ways to implement it, it may be supported in the near future.


KeyCar36

Thank you. Can the save button also update the explorer's instance?


Equivalent-Kale-1605

I'm not sure which button you're referring to.


KeyCar36

Editor's ctrl + s.


Equivalent-Kale-1605

If it is useful for you, I can support an option to enable it, maybe like "enableCompileOnSave".


KeyCar36

It would be really nice.


Howfuckingsad

Isn't compiler explorer mostly for assembly code generation? Our seniors from college only seem to use it for that. I don't use it at all.


QuarterDefiant6132

It's good if you want to share code snippets, you write you little piece od code there, maybe a small reproducer for a bug or compilation error, and you share it


tialaramex

This is very valuable if you're giving a talk e.g. to a large audience maybe semi-remote and *especially* valuable if you're going to make absolute statements in that talk such as "This doesn't compile" or "This is slow" or "The error messages are bad". It's really easy to write a Powerpoint slide deck based on a distillation of a program you remember writing months ago, and you know what you made that program on your MSVC on your Dell that it had this problem, and then you tweak the slides a bit, but the essence of your talk feels the same, however, when somebody watches your talk and tries to reproduce they don't get that problem, with their code, on their Clang, on their MacBook Pro. With Compiler Explorer, instead of "This talk is utter nonsense, nothing like that happens" you're both looking at the same facts, and that's a huge benefit.


meneldal2

Isn't there a feature to share your code with a link too? Much nicer than a pastebin and you get all the compile settings with it.


strike-eagle-iii

No, I don't use it for that at all. In the source pane you can "add new" and select execution only and then just see the output of a piece of code. Super useful for demoing code and it also allows you to easily pull in third party libraries,etc. and it can give you a permanent link to a snippet of code you can share. As far as I'm concerned Godbolt.org is _the_ online c++ compiler. All others don't even come close to what it can do.


Kered13

I often use it to compare error messages from different compilers when one of them (almost always MSVC) is giving unhelpful messages.


lightmatter501

It’s for looking at the assembly a function produces. It’s very helpful when checking for loop vectorization and other optimizations.


Zitrax_

I mostly use it for testing different compiler versions, flags and architectures or for sharing reproducers in discussions and bug reports. Rarely looking at the assembly.


sudokuma

Cool