官术网_书友最值得收藏!

  • Mastering Rust
  • Rahul Sharma Vesa Kaihlavirta
  • 349字
  • 2021-07-02 13:35:18

Package managers

"The key to efficient development is to make interesting new mistakes."                                                                                                                                                               

– Tom Love

A real-world software code base is often organized into multiple files and will have many dependencies, and that calls for a dedicated tool for managing them. Package managers are a class of command-line tools that help manage projects of a large size with multiple dependencies. If you come from a Node.js background, you must be familiar with npm/yarn or if you are from Go language, the go tool. They do all the heavy lifting of analyzing the project, downloading the correct versions of dependencies, checking for version conflicts, compiling and linking source files, and much more.

The problem with low-level languages like C/C++ is that they do not ship with a dedicated package manager by default. The C/C++ community have been using the GNU make tool for a long time, which is a language-agnostic build system and has arcane syntax, that puts off many developers. The problem with make is that it does not know what header files are included in your C/C++ sources, so they have to be manually given this information. It has no built-in support for downloading external dependencies, nor does it know about the platform you are running on. Fortunately, this is not the case with Rust as it ships with a dedicated package manager which has more context on the project being managed. What follows is a tour of Cargo, Rust's package manager, which makes it easy to build and maintain Rust projects. But first, we need to dig into Rust's module system a bit more.

主站蜘蛛池模板: 汉沽区| 辽宁省| 乌兰察布市| 靖远县| 莫力| 道真| 汉源县| 驻马店市| 桑植县| 屯昌县| 象山县| 晋城| 汕尾市| 长岭县| 游戏| 尉氏县| 郓城县| 米脂县| 昔阳县| 临清市| 孝义市| 和龙市| 柳州市| 咸宁市| 通江县| 华坪县| 涞源县| 龙海市| 筠连县| 称多县| 乌鲁木齐县| 兴安盟| 肃宁县| 五常市| 新疆| 遵义县| 土默特左旗| 宾阳县| 苍山县| 淅川县| 沧源|