News for hackers. Stuff that matters.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by rubber_duck on Wednesday July 10, 2019 @12:30PM (#20403537)
My problem with C++ isn't the lack of borrow checker - this is the feature I like the least in Rust (I know it's their core design goal but frankly the inconvenience and limitations it imposes don't seem worth it for my use case, and then theres the compile times).

C++ lack of modules and package management on the other hand is a huge PITA and I'm not optimistic either of those bolted on so late in to the language lifecycle will provide a useful solution.

It's a pity D took it too far in the other direction with GC and runtime - I really could use a C with classes and modules.

Re:Catching use-after-move C++ bugs with Clang's consumed an... by logicprog on Wednesday July 10, 2019 @03:49PM (#20405773)
I recently found out[2] about DasBetterC[1] and it seems like a super convincing way to get just C with classes and modules, as you say. Essentially, it removes the runtime and all the features that rely on it.

[1]: https://dlang.org/blog/the-d-and-c-series/#betterC [2]: https://theartofmachinery.com/2019/04/05/d_as_c_replacement....

Re:Catching use-after-move C++ bugs with Clang's consumed an... by pjmlp on Wednesday July 10, 2019 @01:21PM (#20404115)
Modules are coming in C++20, with vcpkg and conan becoming the two most used package managers.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by jeremyjh on Wednesday July 10, 2019 @02:20PM (#20404750)
They were coming in C++17 too.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by zone411 on Wednesday July 10, 2019 @02:32PM (#20404885)
Back 2015, when the work on C++14 was still going on, it was already known that modules probably won't make into C++17. Very different situation now.

https://botondballo.wordpress.com/2015/06/05/trip-report-c-s...

Re:Catching use-after-move C++ bugs with Clang's consumed an... by pjmlp on Wednesday July 10, 2019 @03:35PM (#20405623)
The set of ISO C++20 features is pretty much frozen after the upcoming Cologne meeting, and modules are in.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by wyldfire on Thursday July 11, 2019 @08:44AM (#20411041)
So the aforementioned death-on-arrival [1] was premature? Are there really implementations which end up faster as a result?

[1] https://vector-of-bool.github.io/2019/01/27/modules-doa.html

Re:Catching use-after-move C++ bugs with Clang's consumed an... by abraxaz on Wednesday July 10, 2019 @12:46PM (#20403731)
I think conan has real potential when it comes to package management

Some example of what can be done with it https://gitlab.com/xadix/xonan

It is kind of like gentoo portage or nix pkg and can be used to manage your tool chain also

Re:Catching use-after-move C++ bugs with Clang's consumed an... by plq on Wednesday July 10, 2019 @05:12PM (#20406606)
I don't get conan. Portage can already create a linux root in your homedir (see the prefix project) and has a huge package repo. What am I missing?
Re:Catching use-after-move C++ bugs with Clang's consumed an... by pjmlp on Wednesday July 10, 2019 @05:36PM (#20406831)
Portage doesn't work across Windows, QNX, IBM i, IBM z, Android, iOS, macOS, mbed, RTOS, ClearPath, Aix, HP-UX, INTEGRITY, FreeBSD, NetBSD, OpenBSD, PS4, Switch, XBox, Tizen,...
Re:Catching use-after-move C++ bugs with Clang's consumed an... by ailideex on Thursday July 11, 2019 @03:06AM (#20409657)
In addition to what other response said it also lacked binary caching last I checked
Re:Catching use-after-move C++ bugs with Clang's consumed an... by ComputerGuru on Wednesday July 10, 2019 @10:59PM (#20408762)
I find vcpkg to be a much more well thought out solution, or at least did at the time I was doing research into suggesting one for neovim during that discussion. It was clearly developed by a team that’s been around the proverbial dependency management block a few times, and offered more accommodations for working with existing codebases than Conan did.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by colatkinson on Thursday July 11, 2019 @01:05AM (#20409263)
I could be wrong, but conan's "killer feature" is its integration with traditional artifact management solutions. Using it with Nexus (which also takes care of PyPI, npm, and basically every other binary package type under the sun) is fairly smooth sailing.

vcpkg, on the other hand, as far as I know only exports to nuget and compressed archives. Nuget is great and all if you're purely in MS land, but otherwise... not so much. And with compressed archives, you're kinda on your own w.r.t versioning and so on. That being said, I'm much more familiar with conan, so please correct me if I'm wrong.

Additionally, conan, being configurable via normal Python code (for better or worse), can really hack together pretty much any codebase (I've used it with autotools, MSBuild, CMake, and even Xcode).

I will definitely agree that the vcpkg team does ultimately seem to be more experienced, and it's a more polished tool (the conan docs are... lacking in areas, and updating conan will occasionally break things). It'll be interesting to see the direction both tools go in the future, as I would really like cross-platform C++ dependency management to stop being a total PITA.

Re:Catching use-after-move C++ bugs with Clang's consumed an... by paulddraper on Wednesday July 10, 2019 @07:54PM (#20407818)
> C++ lack of modules and package management

What exactly does "modules" mean to you? JS modules, Ruby modules, Java modules, Python modules? Those are substantially different ideas. C++ namespaces are Ruby modules, sans inheritance and runtime representation.

> package management

Does every language now require its own bespoke package management? npm, gem, pip, CPAN, OPAM, composer, maven, ivy, NuGet, Cabal, Cargo, CocoaPods, Quicklisp, LuaRocks, CTAN, Anaconda, etc.

Re:Catching use-after-move C++ bugs with Clang's consumed an... by themusicgod1 on Thursday July 11, 2019 @03:03AM (#20409653)
Not to mention you can get software that is unlicensed on npm, and god knows what gets pulled in when you use cargo or any of the smaller ones. This is a gigantic clusterfuck for those who are interested in using free software that encourages the user to be aware of the importance of free software.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by steveklabnik on Thursday July 11, 2019 @11:57AM (#20412529)
crates.io (for Cargo) requires that every package include a SPDX identifier, and there's tools that can show you what licenses are used in your project.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by pjmlp on Thursday July 11, 2019 @06:53AM (#20410583)
Yes it does, because most of us want to support a single package format, not one per OS.

Get every OS to agree on an universal package manager and then we may get rid of language specific ones that work across all OSes.

Re:Catching use-after-move C++ bugs with Clang's consumed an... by paulddraper on Thursday July 11, 2019 @09:35PM (#20417389)
Language-based systems are very limiting.

Want to use OpenSSL in your Rust project?

Cargo won't/can't get you what you need.

Re:Catching use-after-move C++ bugs with Clang's consumed an... by steveklabnik on Friday July 12, 2019 @12:15AM (#20418092)
Re:Catching use-after-move C++ bugs with Clang's consumed an... by pjmlp on Friday July 12, 2019 @11:35AM (#20421458)
All the ones I use are multi-language, while being independent of the underlying OS, using OpenSSL isn't a problem.
Re:Catching use-after-move C++ bugs with Clang's consumed an... by mhh__ on Wednesday July 10, 2019 @04:52PM (#20406420)
D is perfectly usable as a C with classes and modules if you use the -betterC flag, with optional lifetime checking if you want it (@safe)
Re:Catching use-after-move C++ bugs with Clang's consumed an... by de_watcher on Thursday July 11, 2019 @02:07AM (#20409481)
Just using package management of the OS distribution.

An with the GUI going into Web it then just installs into some kind of Docker image anyway.