Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.9k
Run compilers interactively from your web browser and interact with the assembly
License
compiler-explorer/compiler-explorer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Compiler Explorer is an interactive compiler exploration website. Edit code in C, C++, C#, F#, Rust, Go, D, Haskell, Swift, Pascal,ispc, Python, Java, or any of the other30+ supported languages, and see how that code looks after beingcompiled in real time.
Bug Report·Compiler Request·Feature Request·Language Request·Library Request·Report Vulnerability
Multiple compilers are supported for each language, many different tools and visualizations are available, and the UIlayout is configurable (thanks toGoldenLayout).
Try out atgodbolt.org, orrun your own local instance. An overviewof what the site lets you achieve, why it's useful, and how to use it isavailable here.
Compiler Explorer follows aCode of Conduct which aims to foster an open and welcomingenvironment.
Compiler Explorer was started in 2012 to show how C++ constructs are translated to assembly code. It started as atmux
session withvi
running in one pane andwatch gcc -S foo.cc -o -
running in the other.
Since then, it has become a public website serving over3,000,000 compilations per week.
You can financially supportthis project on Patreon,GitHub,Paypal,or by buying cool gear on theCompiler Explorer store.
There is now a FAQ sectionin the repository wiki. Ifyour question is not present, please contact us as described below, so we can help you. If you find that the FAQ islacking some important point, please feel free to contribute to it and/or ask us to clarify it.
Several videos showcase some features of Compiler Explorer:
- Compiler Explorer 2023: What's New?: Presentation for CppNorth 2023.
- Presentation for CppCon 2019 about the project
- Older 2 part series of videos which go into a bit more detail into themore obscure features.
- Just Enough Assembly for Compiler Explorer: Practical introduction to Assembly with afocus on the usage of Compiler Explorer, from CppCon 2021.
- Playlist: Compiler Explorer: A collectionof videos discussing Compiler Explorer; using it, installing it, what it's for, etc.
ARoad map is available which gives a little insight into the future plans forCompiler Explorer.
Compiler Explorer is written inTypeScript, onNode.js.
Assuming you have a compatible version ofnode
installed, on Linux simply runningmake
ought to get you up andrunning with an Explorer running on port 10240 on your local machine:http://localhost:10240/. If this doesn't work for you, please contact us, as we consider itimportant you can quickly and easily get running. Currently,Compiler Explorer requiresnode
20 or higher installed, either on the path or atNODE_DIR
(an environment variable ormake
parameter).
Running withmake EXTRA_ARGS='--language LANG'
will allow you to loadLANG
exclusively, whereLANG
is one for thelanguage ids/aliases defined inlib/languages.ts
. For example, to only runCompiler Explorer with C++ support,you'd runmake EXTRA_ARGS='--language c++'
. You can supply multiple--language
arguments to restrict to more thanone language. TheMakefile
will automatically install all the third-party libraries needed to run; usingnpm
toinstall server-side and client-side components.
For development, we suggest usingmake dev
to enable some useful features, such as automatic reloading on file changesand shorter startup times.
You can also usenpm run dev
to run ifmake dev
doesn't work on your machine.
When making UI changes, we recommend following theUI Testing Checklist to ensure all components work correctly.
Some languages need extra tools to demangle them, e.g.rust
,d
, orhaskell
. Such tools are kept separately in thetools repo.
Configuring compiler explorer is achieved via configuration files in theetc/config
directory. Values arekey=value
.Options in a{type}.local.properties
file (where{type}
isc++
or similar) override anything in the{type}.defaults.properties
file. There is a.gitignore
file to ignore*.local.*
files, so these won't be checkedinto git, and you won't find yourself fighting with updated versions when yougit pull
. For more information seeAdding a Compiler.
CheckCONTRIBUTING.md for detailed information about how you can contribute toCompilerExplorer, and thedocs folder for specific details regarding various things you might want to do, such ashow to add new compilers or languages to the site.
If you want to point it at your own GCC or similar binaries, either edit theetc/config/LANG.defaults.properties
orelse make a new one with the nameLANG.local.properties
, substitutingLANG
as needed.*.local.properties
fileshave the highest priority when loading properties.
If you want to support multiple compilers and languages likegodbolt.org, you can use thebin/ce_install install compilers
command in theinfra project to installall or some of the compilers. Compilers installed in this way can be loaded through the configuration inetc/config/*.amazon.properties
. If you need to deploy in a completely offline environment, you may need to remove someparts of the configuration that are pulled fromwww.godbolt.ms@443
.
When running in a corporate setting the URL shortening service can be replaced by an internal one if the default storagedriver isn't appropriate for your environment. To do this, add a new module inlib/shortener/myservice.js
and set theurlShortenService
variable in configuration. This module should export a single function, see thetinyurl module for an example.
There's a simple restful API that can be used to do compiles to asm and to list compilers.
You can find the API documentationhere.
We run aCompiler Explorer Discord, which is a place to discuss using or developingCompiler Explorer. We also have a presence on thecpplang Slack channel#compiler_explorer
and we havea public mailing list.
There's a development channel on the discord, and also adevelopment mailing list.
Feel free to raise an issue ongithub oremail Matt directly for more help.
Following are the official domains for Compiler Explorer:
The domains allow arbitrary subdomains, e.g.,https://foo.godbolt.org/, which is convenient since each subdomain has anindependent local state. Also, language subdomains such ashttps://rust.compiler-explorer.com/ will load with thatlanguage already selected.
Compiler Explorer is maintained by the awesome people listed in theAUTHORS file.
We would like to thank the contributors listed in theCONTRIBUTORS file, who have helped shapeCompiler Explorer.
We would also like to especially thank these people for their contributions toCompiler Explorer:
- Gabriel Devillers (while working forKalray)
- Johan Engelen
- Joshua Sheard
- Andrew Pardoe
Manyamazing sponsors, both individuals and companies, have helped fund and promoteCompiler Explorer.
About
Run compilers interactively from your web browser and interact with the assembly
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.