Live data from Hacker News

Clang 5 in a Docker container for C++17

solarianprogrammer.com

51–60 of 69 posts

Re: Clang 5 in a Docker container for C++17

#52
post #20

Earlier quoted context omitted.

> Granted, the state of C++ on MacOS is embarrassingly bad. In what sense? Apple keeps Clang up to date on macOS, and it is essentially no work to get the associated Clang tooling and other C++ tools (valgrind, etc) installed through something like homebrew.

> Apple keeps Clang up to date on macOS, Actually, not especially. The system compiler that ships with Xcode is still quite old and the libraries are quite out of date. For example, though the most recent Xcode finally added -std=c++17 it still lacks core library features like std::variant. I wish they could keep close to mainline but for whatever reason they can't.

> The system compiler that ships with Xcode is still quite old

quite old, quite old... -std=c++17 was only added in clang 5 released in september, 3 months ago. AFAIK current Xcode is based on Clang 4.

Re: Clang 5 in a Docker container for C++17

#53
post #24

Earlier quoted context omitted.

> Granted, the state of C++ on MacOS is embarrassingly bad. In what sense? Apple keeps Clang up to date on macOS, and it is essentially no work to get the associated Clang tooling and other C++ tools (valgrind, etc) installed through something like homebrew.

"AppleClang" is some strange fork with some features (both compiler and library) omitted or broken. OpenMP, for example, is one thing I've been missing for a good while; I've not checked if that's now present with new releases. I can understand adding extra functionality to a fork, like Objective C and swift stuff, but dropping bits is strange. It's due to issues like this that I do all our clang testing on FreeBSD,…

I think clang's OpenMP implementation might not be 100% ready? Many FreeBSD ports that have an OPENMP option straight up use gcc when that option is enabled.

Re: Clang 5 in a Docker container for C++17

#55

Too bad they are on Windows. Otherwise they could just use Nix: https://nixos.org/nix or Guix: https://www.gnu.org/software/guix/

Nix does run on Windows Subsystem for Linux these days.

And can it interact nicely with the "native" environment? I.e. build MSVC projects or ".exe" apps in general that can be used outside of Nix or WSL? I am not a Windows dev but I am very curious, it would be nice to move some cross-platform projects I work on to Nix completely for dev environment...

Re: Clang 5 in a Docker container for C++17

#56

Earlier quoted context omitted.

> Granted, the state of C++ on MacOS is embarrassingly bad. In what sense? Apple keeps Clang up to date on macOS, and it is essentially no work to get the associated Clang tooling and other C++ tools (valgrind, etc) installed through something like homebrew.

No it's awful. They are most certainly not up to date, and even worse, the compilers they ship that advertise certain flags aren't even necessarily feature complete. A glaring example of this was the lack of thread_local support for ages.

Yup. It was only about a year ago that the undefined behaviour sanitizer stopped segfaulting when I turned it on, despite it being clearly "documented" in the man page. I'm amazed that a company with the resources of Apple has such shoddy developer tools.

Re: Clang 5 in a Docker container for C++17

#57
post #2

It feels like cargo-cult computer usage. The description states: "Running Clang in a container has the advantage that it is light on resources and won’t mess with your underlying OS.". Containers aren't really light on resources if the host kernel is not Linux and not messing with OS is easily attainable by installing the binaries in a custom prefix directory (e.g. ~/bin). This is especially true for compilers which…

While docker is pretty bloated and doesn't really add new capabilities, I've found it a real time-saver for distributing cross-platform build environments to a dev team running multiple Linux/osx releases, especially when those build environments are used only a few times per year.

Probably a VM or really good scripts could take care of it, but since we use docker elsewhere people don't have to learn something new that they'd treat as a black box anyway

Re: Clang 5 in a Docker container for C++17

#58
post #20

Earlier quoted context omitted.

> Granted, the state of C++ on MacOS is embarrassingly bad. In what sense? Apple keeps Clang up to date on macOS, and it is essentially no work to get the associated Clang tooling and other C++ tools (valgrind, etc) installed through something like homebrew.

> Apple keeps Clang up to date on macOS, Actually, not especially. The system compiler that ships with Xcode is still quite old and the libraries are quite out of date. For example, though the most recent Xcode finally added -std=c++17 it still lacks core library features like std::variant. I wish they could keep close to mainline but for whatever reason they can't.

No C++ compilers currently implemented the full C++17 standard at this time.

Re: Clang 5 in a Docker container for C++17

#59
post #2

It feels like cargo-cult computer usage. The description states: "Running Clang in a container has the advantage that it is light on resources and won’t mess with your underlying OS.". Containers aren't really light on resources if the host kernel is not Linux and not messing with OS is easily attainable by installing the binaries in a custom prefix directory (e.g. ~/bin). This is especially true for compilers which…

My thought exactly. Not only that, but MSVC supports C++17 features natively so I have no idea why you'd want to do this on Windows. Granted, the state of C++ on MacOS is embarrassingly bad.

>MSVC supports C++17 features natively

MSVC is the worst standard non-conforming C++ compiler in the current major compilers. I consider it MS C++-ish dialect compiler.

Re: Clang 5 in a Docker container for C++17

#60
post #59

Earlier quoted context omitted.

My thought exactly. Not only that, but MSVC supports C++17 features natively so I have no idea why you'd want to do this on Windows. Granted, the state of C++ on MacOS is embarrassingly bad.

>MSVC supports C++17 features natively MSVC is the worst standard non-conforming C++ compiler in the current major compilers. I consider it MS C++-ish dialect compiler.

Not at all. Up to C++14 MSVC is actually better than gcc or clang, it's the only compiler which fully implements C11 with its safety Annex K.

Only from C++17 on gcc and clang do have an advantage. http://en.cppreference.com/w/cpp/compiler_support

The label worst std support would go to: EDG eccp, Intel C++, IBM XLC++, Sun/Oracle C++, Embarcadero C++ Builder, Cray, HP aCC [Collapse], Digital Mars C++

MSVC has very bad C support, this is their problem, not C++.

Post reply on HN