GithubHelp home page GithubHelp logo

matteozero / rholang-rust Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wangjia184/rholang-rust

0.0 0.0 0.0 87.78 MB

Rholang runtime in rust

Shell 0.10% C++ 0.03% C 7.51% Rust 92.33% Dockerfile 0.03%

rholang-rust's Introduction

Rholang Runtime

A rholang runtime written in Rust. Development is still in progress...

  • /model/ is a library crate containing protobuf models depended by rho_runtime and rholang_parser
  • /rholang_parser/ crate builds an executable program which accepts rholang code and outputs normalized AST
  • /rho_runtime/ is the primary executable program. It launches rholang_parser to parse rholang code, then handle reducing and storage

File Naming Convertion

Two kinds of naming convertions applied in this project.

  • Filename using snake_case (e.g. common.rs / rho_par.rs) means it is an individual module, which is the default approach in Rust's module system.
  • Filename using PascalCase (e.g. Sortable.rs / DeBruijnIndexMap.rs) means it is a part of its directory module.

The PascalCase style is used to keep the code structure similar as Scala edition without big single file or a lot of re-exports.

src/
├─ context/
│  ├─ mod.rs
│  ├─ DeBruijnLevelMap.rs
│  ├─ DeBruijnIndexMap.rs
├─ normalize/
│  ├─ mod.rs
│  ├─ rho_par.rs

In the above example, DeBruijnLevelMap.rs and DeBruijnIndexMap.rs are included by /src/context/mod.rd as part of context module; While rho_par.rs defines normalize::rho_par module.

Test Case

cargo test --all

Build for Release

CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_PANIC=abort RUSTFLAGS="--emit=asm" cargo build --release

Generate Flame graph

sudo sh -c " echo 0 > /proc/sys/kernel/kptr_restrict"
sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'
CARGO_PROFILE_RELEASE_DEBUG=true CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_PANIC=abort CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1  cargo flamegraph --bin=rho_runtime /D/projects/rho_runtime_bench/bench2.rho

rholang-rust's People

Contributors

wangjia184 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.