Re:How it works: Compiler Explorer
by qalmakka on Saturday February 03, 2018 @04:03AM
(#16296870)
Tip: you can get Compiler Explorer to output ASM for almost every triple in existence (with varying results) by relying on the -target option of Clang. i.e., if you specify -target x86_64-w64-mingw32-gnu you can get ASM for windows (remember that the includes are still linux ones!), or if you specify -target x86_64-unknown-freebsd11.1 you can get asm for FreeBSD 11.1.
Re:How it works: Compiler Explorer
by ziotom78 on Saturday February 03, 2018 @07:46AM
(#16297406)
Thank you for creating this nice tool! I am teaching a C++ class, and sometimes I connect to Compiler Explorer in real time to explain how things are translated into low-level operations. I found this approach eye-opening for students, as it removes some of the «magical» aura modern compilers have in the eyes of the class.
Re:How it works: Compiler Explorer
by ziotom78 on Saturday February 03, 2018 @10:09AM
(#16297884)
Agreed! :-) However, making students see how complex constructs translate into a sequence of simple assembler operations helps a lot in understanding what compilers are all about.
Re:How it works: Compiler Explorer
by besselheim on Saturday February 03, 2018 @08:31AM
(#16297537)
I've found Compiler Explorer to be very useful indeed, for two main use cases: gaining insight into how security mitigations are implemented in different compilers, and for quickly checking my working when reverse engineering tricky C++ compiled code.
Really interesting to see how the tool works behind the scenes.
Re:How it works: Compiler Explorer
by ratherbefuddled on Saturday February 10, 2018 @05:22AM
(#16346709)
It is! For about 6 months in 1999 I had one terminal running telnet to Xania and the other writing code in some bespoke procedual language on HP-UX. One got significantly more use than the other.
Re:How it works: Compiler Explorer
by SkittlesNTwix on Saturday February 03, 2018 @04:05PM
(#16299641)
This is remarkable - I've never heard of Compiler Explorer before now. I wish we had something like this back in university! Thank you so much for making this incredible tool.
Re:How it works: Compiler Explorer
by fulafel on Saturday February 03, 2018 @06:16AM
(#16297174)
I think this view of Docker is pretty common: poor man's virtualization. You'd prefer real VMs but you can't reliably & performantly run nested VMs on public providers. Or can you? What's the current status on AWS/GCP/DigitalOcean/Hetzner?
Re:How it works: Compiler Explorer
by chubot on Saturday February 03, 2018 @12:40PM
(#16298552)
(tangent here)
I didn't get that from the article. He said that the tooling around Docker is clunky:
But I’ve always felt a bit like the Dockerfile you write is hard to maintain. I have to use some Makefile trickery to prevent having to repeat parts of the Dockerfile amongst each of the containers.
I don't like Docker either, but it's not because I want VMs. I want VMs even less than I want Docker! I want containers that are fast and light.
Basically I want to solve the problems of reproducibility/stability/portability with as little code as possible. VMs a bad way to do that because they involve not just a new user space like Docker, but a new kernel and hypervisor too!
Re:How it works: Compiler Explorer
by amelius on Saturday February 03, 2018 @06:09AM
(#16297155)
That sounds like a lot of work. My armchair-engineer instinct suspects it would be a lot simpler or at least cheaper to run everything in the browser (Emscripten/WASM), and serve static pages from a single node.
Re:How it works: Compiler Explorer
by mattgodbolt on Saturday February 03, 2018 @03:51PM
(#16299569)
Given how much effort it is to compile and maintain 200 different compilers just for Ubuntu (not to mention some closed-source compilers), this probably is not as simple as you'd think :-)
Re:How it works: Compiler Explorer
by dave84 on Sunday February 04, 2018 @07:20AM
(#16302458)
> highly exaggerated
The article says 8GB of compiler binaries, asm.js in my experience is 10x the size of the original binary.
Obviously not everyone needs to download every compiler but even spreading that number between a few hundered compilers means 200+ mb JavaScript downloads.
He talks about Compiler Explorer[1] in one and Spectre/Meltdown[2] in another.
[1] http://cppcast.com/2016/01/matt-godbolt/
[2] http://cppcast.com/2018/01/matt-godbolt/
Reading compiler output after adding -O3 seems to add magical aura in my case :)
Really interesting to see how the tool works behind the scenes.
I was teaching some workmates a few things about how assembly programming works by looking at compiler output and this was a huge help. :)
I didn't get that from the article. He said that the tooling around Docker is clunky:
But I’ve always felt a bit like the Dockerfile you write is hard to maintain. I have to use some Makefile trickery to prevent having to repeat parts of the Dockerfile amongst each of the containers.
I don't like Docker either, but it's not because I want VMs. I want VMs even less than I want Docker! I want containers that are fast and light.
Basically I want to solve the problems of reproducibility/stability/portability with as little code as possible. VMs a bad way to do that because they involve not just a new user space like Docker, but a new kernel and hypervisor too!
https://bellard.org/jslinux/
Also, most users don't need support for all languages.
The article says 8GB of compiler binaries, asm.js in my experience is 10x the size of the original binary.
Obviously not everyone needs to download every compiler but even spreading that number between a few hundered compilers means 200+ mb JavaScript downloads.
Am I wrong?