stupid-stats | Tutorial and demo of rust compiler replacement tooling | Compiler library

 by   nrc Rust Version: Current License: No License

kandi X-RAY | stupid-stats Summary

kandi X-RAY | stupid-stats Summary

stupid-stats is a Rust library typically used in Utilities, Compiler applications. stupid-stats has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Compilation using rustc happens in several phases. We start with parsing, this includes lexing. The output of this phase is an AST (abstract syntax tree). There is a single AST for each crate (indeed, the entire compilation process operates over a single crate). Parsing abstracts away details about individual files which will all have been read in to the AST in this phase. At this stage the AST includes all macro uses, attributes will still be present, and nothing will have been eliminated due to cfgs. The next phase is configuration and macro expansion. This can be thought of as a function over the AST. The unexpanded AST goes in and an expanded AST comes out. Macros and syntax extensions are expanded, and cfg attributes will cause some code to disappear. The resulting AST won't have any macros or macro uses left in. The code for these first two phases is in libsyntax. After this phase, the compiler allocates ids to each node in the AST (technically not every node, but most of them). If we are writing out dependencies, that happens now. The next big phase is analysis. This is the most complex phase and uses the bulk of the code in rustc. This includes name resolution, type checking, borrow checking, type and lifetime inference, trait selection, method selection, linting, and so forth. Most error detection is done in this phase (although parse errors are found during parsing). The 'output' of this phase is a bunch of side tables containing semantic information about the source program. The analysis code is in librustc and a bunch of other crates with the 'librustc_' prefix. Next is translation, this translates the AST (and all those side tables) into LLVM IR (intermediate representation). We do this by calling into the LLVM libraries, rather than actually writing IR directly to a file. The code for this is in librustc_trans. The next phase is running the LLVM backend. This runs LLVM's optimisation passes on the generated IR and then generates machine code. The result is object files. This phase is all done by LLVM, it is not really part of the rust compiler. The interface between LLVM and rustc is in librustc_llvm. Finally, we link the object files into an executable. Again we outsource this to other programs and it's not really part of the rust compiler. The interface is in librustc_back (which also contains some things used primarily during translation). All these phases are coordinated by the driver. To see the exact sequence, look at the compile_input function in librustc_driver/driver.rs. The driver (which is found in librust_driver) handles all the highest level coordination of compilation - handling command line arguments, maintaining compilation state (primarily in the Session), and calling the appropriate code to run each phase of compilation. It also handles high level coordination of pretty printing and testing. To create a drop-in compiler replacement or a compiler replacement, we leave most of compilation alone and customise the driver using its APIs.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              stupid-stats has a low active ecosystem.
              It has 50 star(s) with 13 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 5 have been closed. On average issues are closed in 5 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of stupid-stats is current.

            kandi-Quality Quality

              stupid-stats has no bugs reported.

            kandi-Security Security

              stupid-stats has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              stupid-stats does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              stupid-stats releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of stupid-stats
            Get all kandi verified functions for this library.

            stupid-stats Key Features

            No Key Features are available at this moment for stupid-stats.

            stupid-stats Examples and Code Snippets

            No Code Snippets are available at this moment for stupid-stats.

            Community Discussions

            Trending Discussions on stupid-stats

            QUESTION

            Drop-in compiler replacement can't find std crate
            Asked 2018-May-23 at 11:25

            I am trying to make a drop-in compiler replacement. Here's my source code.

            ...

            ANSWER

            Answered 2018-May-22 at 07:09

            Just a guess here, but I think your tool1 is not installed in the same folder as rustc. Note that you may have an executable called rustc in your cargo bin folder alongside your tool1, but this rustc is probably a rustup wrapper that redirects to the real compiler somewhere in your toolchain folder (probably $HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc).

            You will need to either install your tool1 inside the toolchain folder or call it with a -L argument pointing to the toolchain libraries (probably $HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib).

            Source https://stackoverflow.com/questions/50450909

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install stupid-stats

            You can download it from GitHub.
            Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/nrc/stupid-stats.git

          • CLI

            gh repo clone nrc/stupid-stats

          • sshUrl

            git@github.com:nrc/stupid-stats.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Compiler Libraries

            rust

            by rust-lang

            emscripten

            by emscripten-core

            zig

            by ziglang

            numba

            by numba

            kotlin-native

            by JetBrains

            Try Top Libraries by nrc

            r4cppp

            by nrcRust

            derive-new

            by nrcRust

            graphql

            by nrcRust

            libhoare

            by nrcRust

            xmas-elf

            by nrcRust