About the data source of the number of Rust code lines in the Servo project, servorust

Source: Internet
Author: User

About the data source of the number of Rust code lines in the Servo project, servorust

A blog I wrote two months ago, "Why do I say Rust is a reliable programming language?" (hereinafter referred to as the original article), in which "6. two semi-large Success Stories "I wrote:

  • Servo: Next-generation browser rendering engine (Webkit/Blink), with over 0.4 million lines of Rust code
  • Rustc + std: Rust compiler and standard library, with over 0.35 million lines of Rust code

The source code lines of the two projects are provided, but the data sources are not explicitly provided. This article provides additional instructions.

Official Servo Data Source
  • Source 1 "Experience Report: Developing the Servo Web Browser Engine using Rust" says there are 0.41 million rows (410 K) [May 26, 2015]
  • Source 2 "Servo Continues Pushing Forward" says there are 0.12 million rows (126 K) [May 1, 2015]
  • Source 3 "Servo developer tools overview" says there are 0.15 million rows (150 k) [July 22, 2015]

These three sources are highly authoritative. The main authors of source 1 include Brian Anderson, Rust project leader, and Lars bergrom, Project Leader of Servo, source 2 is from the official blog of Samsung OSG, a partner of the Servo project. Source 3 is the official blog of the Servo project. The data is quite new, both of which are data from January 1, May 2015 or later. There are conflicts between the three statements, which may be caused by different statistical classification standards.

The original version adopted source 1, and now I (Liigo) prefer source 3. Based on the three sources, I guess that the number of source code lines of the Servo project itself, excluding its dependent libraries, is about 0.15 million, the Rust compiler and standard library and the Rust library that Servo relies on add up to about 0.36 million rows (corresponding to "more than 0.35 million rows" described in the original article "). In this case, the number of rustc + std rows must be far smaller than 0.36 million, but the data source does not seem to have specific statistics. In addition, it does not specifically count the number of lines of code in the dependent Library (excluding std) of Servo-source 1 mentions about 20 Rust libraries-I think this type of code can be included in the Servo project, the number of lines of code in Servo will exceed 0.15 million.

In summary, the statistics on the number of lines in source code of two large projects provided in the original article may be duplicated and incorrect, but are not corrected until a clear and accurate number is displayed. Liigo, January 1, July 28, 2015.

Liigo's own statistics

Considering that there may be conflicts, duplicates, and omissions in the source statistics described above, I wrote a program (loc-rs) to count it again. The result is: there are about 0.3 million lines of Rust compiler and standard library code, and about 0.25 million lines of Servo Code. For more information, see the following table.

+-------------------+---------------+| rustc             | 180K lines    |+-------------------+---------------|| rustc             | 59K           || syntax            | 38K           || rustc_trans       | 37K           || rustc_typeck      | 26K           || rustc_resolve     | 7K            || rustc_borrowck    | 5K            || ...               | ...           |+-------------------+---------------+
+-------------------+---------------+| std               | 120K lines    |+-------------------+---------------|| std               | 55K           || core              | 26K           || collections       | 19K           || rustc_unicode     | 7K            || libc              | 6K            || alloc             | 4K            || rand              | 3K            || ...               | ...           |+-------------------+---------------+
+-------------------+---------------+| servro            | 250K lines    |+-------------------+---------------|| servo             | 155K          || serde             | 15K           || regex             | 15K           || rust-mozjs        | 14K           || ipc-channel       | 14K           || hyper             | 12K           || html5ever         | 9K            || ...               | ...           |+-------------------+---------------+

The author has corrected the original data based on the statistical results here. July 30, 2015, Liigo.

Copyright Disclaimer: This article is an original article of the blogger and cannot be reproduced without authorization from the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.