Dependency management and IDE Integration #1957
hyperswine
started this conversation in
General
Replies: 1 comment
-
I'm moving this to a discussion, because it's not something we can resolve in the near term. We'd eventually like to have a package manager, but we don't even have a compiler yet. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
CMake is decent enough if configured properly, but there are usually quite a few problems namely the verbosity and the myriad ways to configure a project, leading to an overall mess in practice. Meson can be seen as an improvement in terms of syntax, but functionally, is still a meta build system that could benefit more from a higher coupling to its main supported languages like c++.
I find rust's cargo packaging system to be quite well designed and powerful enough to do most of the things you want. You have a
Cargo.toml
to specify your package's metadata and dependencies and optionally a.cargo/config.toml
to specify registries for your deps, runners for your executable, link args, etc. In your Cargo.toml you have [dependencies], [features], [[example]], and etc. that allows your project to be nicely structured. The use of toml also is nice, though something like strictyaml or even a carbon file could work.A modern language also benefits quite a lot from good IDE integration. Languages like rust, go, typescript and python have language servers that could drastically improve developer experience in environments like vscode and jetbrains. Auto completions, snippets, goto definitions, doc comments on hover, and integrated test and function runners.
Idea: Carbon Package Manager
CPM is a packaging system that is simple to interpret and edit, yet extensible. Like npm, cpm has a site cpm.io for its main registry. Each carbon package is namespaced according to the author's username. Major c++ packages are also available under the c++ namespace
cpm.io/c++
. E.g. boost, fmt, assimp.There are risks with downloading packages from the network, so whenever they are uploaded, they are tagged with their specific commit from their VCS. When you specify a package in
project.carbon
, that tells cpm to fetch from the main registry and install the current version + tag toworkspace/lib/<package>
. If the package were to be updated, its tag will change on the registry and you must explictly docpm update
, which gets the list of updated packages, shows you a diff of each (and can be shown in the IDE). If you are okay with the changes, selectY
.CPM supports c++ packages that are wrapped around in
project.carbon
, which work with cmake and meson.Beta Was this translation helpful? Give feedback.
All reactions