News for hackers. Stuff that matters.
Re:Carbon Language: An experimental successor to C++ by fouronnes3 on Tuesday July 19, 2022 @12:34PM (#32154208)
C++ has virtually zero tooling and the committee is not interested in ever working on that. Comparing CMake to cargo is like comparing fifth century fireworks to the Space Shuttle. I mean we are getting modules that aren't literally copy paste maybe next year.
Re:Carbon Language: An experimental successor to C++ by StillBored on Tuesday July 19, 2022 @02:36PM (#32156028)
"C++ has virtually zero tooling"

I read that and I was like WTF, the entire programming ecosystem exists on C/C++ tooling. But from your perspective its modules/cargo that is the tooling?

That is IMHO an odd viewpoint. As someone who despises the way cargo works, and hates not having long term explicit control over my dependencies (going so far as to track and check them in along with build artifacts) I'm not convinced that the recent toss another random dependency that itself pulls dependencies into the build is a good thing.

I like the fact that I have three dozen+ different ways to do regexp's in C depending on my priorities, and that picking one requires cognitive overhead and modifications to source control/etc. Its easy to add a line to a makefile/etc to pull crap off github in C, so its not like this is a hard problem to deal with in C/C++ but its one where the scale of the problem allows for optimization. AKA like the dynamic typing argument, making the programmer think about a problem I believe yields a better solution.

Its also one where i'm not tied to the whimsy of the library author should I decide to fork or maintain the code long after they have gotten bored or rewritten it 3 different times. I can to this day rebuild code I wrote 20 years ago on a modern machine with little effort. Can you say the same about even 10 year old node.js or python code?

Put another way, I spend a little bit more on upfront effort and it pays off long term. And I know i'm in the minority, but its also why repeatedly I've run small teams of a half dozen or so people who's products are ahead of major competitors with teams of 100's+ of engineers.

Re:Carbon Language: An experimental successor to C++ by boardwaalk on Tuesday July 19, 2022 @03:18PM (#32156591)
You can do things the way you do them in C++ in Rust if you want. You could `cargo vendor`, you could fork a repo & depend on a specific commit, etc. It’s up to you have the self-control to do that though and not just shovel random dependencies into your project, that’s all.

Mostly you seem to be complaining that it’s just to add dependencies? (maybe put a ‘sleep’ in your bash prompt or something?) and maybe that the Rust ecosystem doesn’t have as many duplicate libraries as C++? (of course it doesn’t?)

Re:Carbon Language: An experimental successor to C++ by StillBored on Tuesday July 19, 2022 @03:57PM (#32157105)
The problem is that cargo gets in the way (as does rustc) if you try and use it in anything other than the simple import this dependency mode. I spent a hell hole of a day or two, trying to pick up a dependency outside cargo because it didn't behave in a way that meshed with the rest of my build environment.

So, yes it handles a couple of the basic cases, but then your out of luck, stuck in a version hell/etc because rustc and cargo are so tightly integrated and the flags needed to emulate some of the behavior with just the compiler are poorly documented and/or version dependent.

It dictates, you conform (which is basically the rust way).

Re:Carbon Language: An experimental successor to C++ by germandiago on Tuesday July 19, 2022 @04:41PM (#32157674)
The problem with the typical rants about C++ is that you guys are outdated.

With Conan you can consume over 1,000 packages directly from build systems and with way more control than what Cargo seems to offer. Take a look. I did use it for a while and compared to 15 years ago things are way better now.

Re:Carbon Language: An experimental successor to C++ by flohofwoe on Wednesday July 20, 2022 @01:54AM (#32161955)
The problem isn't that Conan exists, but that other competing solutions are just as popular which results in fragmentation (for instance vcpkg, and cmake can also directly pull in external dependencies now). In the Rust world there's just Cargo.
Re:Carbon Language: An experimental successor to C++ by pjmlp on Wednesday July 20, 2022 @04:08AM (#32162854)
Not really, Android and Fuchsia have their own cargo replacements, that fit better on their OS SDKs.

Either that, or we get a box of surprises in each build.rs script.

Re:Carbon Language: An experimental successor to C++ by Asm2D on Wednesday July 20, 2022 @04:13AM (#32162880)
Competing solutions are great for innovation.
Re:Carbon Language: An experimental successor to C++ by woodruffw on Wednesday July 20, 2022 @08:39AM (#32164899)
In the world of build systems, I think most people want a little more consistency and a little less innovation. Sometimes a tool should just do its job and broadly resemble other tools in the space.
Re:Carbon Language: An experimental successor to C++ by gkbrk on Wednesday July 20, 2022 @01:27PM (#32169174)
> In the Rust world there's just Cargo.

While not nearly as popular as Cargo (due to being blessed by the core team), Rust still has multiple build tools and package managers.

Re:Carbon Language: An experimental successor to C++ by germandiago on Wednesday July 20, 2022 @05:19AM (#32163272)
Fragmentation is not the problem. The future of C++ is to have metadata exchange, at least the way I see it.

This means that packages can be compiled with any build system, the one that fits you better. In the event that you cannot find a binary that fits you, your package manager can compile on the fly. There are also solutions to keep binary artifacts in Conan. This means that most of the time you can consume pre-made packages in vcpkg/Conan for casual consumption but you can still have binary repositories with fully customized builds for all your permutations of compilers and systems and debug/release. Do not forget this is a hard problem, we are talking to compilation to native, sometimes you need full speed and a custom compilation, not about portable Java bytecode.

But you can still set up and tweak recipes in Conan and upload to your binary repository (what we do at my company).

However, none of these things tie you to a build system, since conan can generate .pc, .cmake, MSBuild, XCode and way more metadata to consume those packages.

You can scale from simple to fully customized. For example before we had a libcxx that we compiled ourselves and pointed all deps and patched packages and could build something with like twenty-some dependencies with that customized libcxx optimized for us. Can you do that with Cargo? Serious question, I did not make extensive use of it.

However for simple uses you can just drop a conanfile.txt and conan install your profile and start to consume your packages. All of this works with CMake, but if I want to use Meson build system or SCons, Make and others I can do it as well. Look at the generators page: https://docs.conan.io/en/latest/reference/generators.html

I do not think fragmentation in build systems is even a real problem anymore because the "not fragmented but simple" philosophy leaves many things out of the box, such as compiling something custom when you really need it.

The system is very flexible. True that the learning curve is harder at first, but much simpler than it used to be in the past.

I can have full projects, not even with Conan, just with simple Meson wraps (Meson wraps are source-only dependencies though) pointing interdependencies to the same version of a library with a very reasonable amount of work: sometimes a single switch in the options, sometimes a small patch that you can keep in your subprojects/ directory or somewhere else.

I can easily generate .cmake and .pc files from Meson itself without trouble, which are two of the most used build systems. But if on top of that you build a Conan recipe then you can have many consumers of your packages for free.

It is nice to have a tool that is more ore less streamlined sometimes, but build systems is a difficult topic and probably there are some that do a few things better than others: cross-compilation, linux tweaks, generating VS solutions for you if your company uses VS, XCode or whatever. It is not bad to have a choice as long as you can interchange.

I would say it is even better than having the one-size-fits-all thing and later when you want to go to the real native stuff then you discover that your tool is too basic and cannot switch.

Re:Carbon Language: An experimental successor to C++ by adev_ on Tuesday July 19, 2022 @07:04PM (#32159127)
> C++ has virtually zero tooling and the committee is not interested in ever working on that

This sentence makes no sense at all:

1 - Tooling does not stop to the build systems

2 - The tooling set in C++ (and C) has been built over decades. It is indeed not a single shiny CLI cargo-style but it several order of magnitude bigger and more powerful than anything you will ever find in any other programming language: memtracers, profilers, thread sanitizers, debuggers, disassemblers, static analyzers, packages managers, bindings generators, ABI checkers, crash analyzers, loggers and I am sure I forget still many others.

Re:Carbon Language: An experimental successor to C++ by fouronnes3 on Wednesday July 20, 2022 @01:28AM (#32161795)
Yeah what I meant was build system tooling, sorry for the approximation.
Re:Carbon Language: An experimental successor to C++ by flohofwoe on Wednesday July 20, 2022 @01:58AM (#32161981)
Most of the tools you mention work below the language level, and thus work automatically for non-C/C++ languages too (or at least LLVM-based languages).
Re:Carbon Language: An experimental successor to C++ by adev_ on Wednesday July 20, 2022 @05:31AM (#32163343)
They do work below the language level but have been generally explicitly made for C and C++ programs. e.g abi-compliance-checker

The other languages benefit of them currently because they leverage LLVM (also made in C++), because their interpreter/VM are made directly in C.

How is it already ? Standing on the shoulders of giants ? :)

Re:Carbon Language: An experimental successor to C++ by germandiago on Wednesday July 20, 2022 @01:03PM (#32168750)
> C++ has virtually zero tooling

CMake, Meson, Waf, Conan, Visual Studio Code, Visual Studio, CLion, Intel VTune, GDB, LLDB, XCode, Artifactory, SonarQube, clang-tidy, clang-format, astyle, Incredibuild...

> Comparing CMake to cargo is like comparing fifth century fireworks to the Space Shuttle

You are wrong here. Cargo serves a set of fixed "this-is-how-to-do-it" thing. In C++ you can build anything. I do not mean it is better, but C++ software already exists and that is the solution that it works better for it. :)

> and the committee is not interested in ever working on that

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p08...

Interoperability effort for modules: https://github.com/GabrielDosReis/ipr

Re:Carbon Language: An experimental successor to C++ by germandiago on Tuesday July 19, 2022 @04:39PM (#32157647)
Besides having lsp (language server protocol), Visual C++, CLion and others, I have been successfully using CMake/Meson paired with Conan and I can tell from experience that it is amazing what you can achieve.

Someone will say Cargo or whatever, which is nice and simple. But with these tools you can choose all details and optimizations as well, something that other tools just hide. But you can still keep it simple with a conanfile.txt for your dependencies and the stock add_executable etc. in CMake/Meson and get done with it. If you feel CMake is subpar (bc its syntax and DSL are terrible, I agree with that) then you can use Meson. It works pretty well.

Re:Carbon Language: An experimental successor to C++ by pjmlp on Tuesday July 19, 2022 @01:01PM (#32154697)
Use Visual C++ and you will have modules today.

I have cargo today in C++ via NuGET and vcpkg, and what is great about it, I don't have to compile my depedencies from scratch.

Re:Carbon Language: An experimental successor to C++ by joshuamorton on Tuesday July 19, 2022 @01:08PM (#32154789)
> I have cargo today in C++ via NuGET and vcpkg, and what is great about it, I don't have to compile my depedencies from scratch.

To be fair, if you're using a language that has a reasonable compilation story, this is only every a concern the first time you compile.

Re:Carbon Language: An experimental successor to C++ by pjmlp on Tuesday July 19, 2022 @01:10PM (#32154816)
Sure I always need an excuse to go out for lunch.
Re:Carbon Language: An experimental successor to C++ by mbrodersen on Tuesday July 19, 2022 @10:04PM (#32160479)
Hahaha you have zero clue. C++ has the best tooling in the world. From static analysers to best in class debuggers to best in class performance profiling tools etc. No other language comes even close.
Re:Carbon Language: An experimental successor to C++ by int_19h on Monday July 25, 2022 @02:28PM (#32228777)
Java has far more extensive tooling in all the categories that you've mentioned. I don't know if it's "the best tooling in the world", but if I had to make an educated guess, I'd bet on Java - and I don't even like it as a language.
Re:Carbon Language: An experimental successor to C++ by flohofwoe on Wednesday July 20, 2022 @02:01AM (#32162006)
Most of the tools you mention are actually language agnostic (debuggers and profilers). And static analyzers are much more important for C and C++ than other languages.
Re:Carbon Language: An experimental successor to C++ by AnimalMuppet on Tuesday July 19, 2022 @01:00PM (#32154690)
Given that gunpowder was invented in the 9th century, fifth century fireworks were probably pretty uninteresting...