Skip to content

SaurabhGoyal/rust_labs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Practice projects in Rust.

  • To run any of them, install rust tool chain - https://www.rust-lang.org/tools/install
  • To run a program, run following command with package name as folder name of the crate inside crates folder and args for that program. Check the readme inside that folder to know about its arguments -
cargo run -p <package_name> -- <args>

Ex.- cargo run -p cprs -- -r source_dir destination_dir

Projects

win_tree [Improvements pending]

  • Description - Windows tree command but with json output.
  • Target concepts -
    • fs - reading file system
    • io - writing files
    • serde - de/serialization
    • regex - pattern matching
    • async - IO bound application (reads hierarchy of directory including all files)
  • Further changes -
    • clap - better parameter handling

tiny_shell [Improvements pending]

  • Description - Terminal shell that takes commands, parses and runs them.
  • Target concepts -
    • process - process execution
  • Further changes -
    • clap - better parameter handling

sudoku_solver [Improvements pending]

  • Description - Sudoku companion app that solves a given arrangement using human strategies in an event driven manner.
  • Target concepts -
    • thread - multiple threads handling various evaluations
    • sync -
      • Arc - Sharing game state with all threads.
      • Mutex - Keeping game state updates synchronised.
      • channel - Using for data and control sugnals to be passed between game client and game controller.
  • Further changes -
    • Rwlock (instead of Mutex) - Game state is read heavy, parallel reads should be allowed and lock should be only during writes.
    • Future (instead of channel) - If the goal is to control the progress of game based on user input, futures can provide the same based on their inherent design of lazy evaluation.
    • More sudoku strategies - Add more strrategies that can solve more puzzles.

unbricked [Improvements pending]

  • Description - Simplest implementation of a brick breaker game.
  • Target concepts -
    • thread - handling both rendering and user input concurrently.
    • sync -
      • Arc - Sharing game state with both threads.
      • Mutex - Keeping game state updates synchronised.
    • console - TUI framework - rendering and user input.
  • Further changes -
    • async and tokio - better state management and concurrency
    • Playability - Larger bricks, faster response time to user control.

cprs [Improvements pending]

  • Description - Data copier tool for large amounts of data
  • Target concepts -
    • win_tree - Used to walk and build tree for given path
    • io - Used to perform copying of one path to given location
    • thread - Threads to listen to events from transfer process and update status
    • rayon - parallellisation of transfer logic
  • Further changes -
    • async - Test if there is any benefit of transfer-async.
    • benchmark - Benchmarking performance against deep and wide trees and ssd and hdd.

torrentrs [Split and moved to https://gitlab.com/saurabh.2561/torrentrs]

  • Description - Torrent downloader in terminal
  • Target concepts -
    • thread -
    • sync -
    • net -
    • async -
    • crossterm -
    • fs -
    • io -
  • Further changes -

Async IO lib [Not Started Yet]

workflow_engine [Not Started Yet]

References

Blogs / feeds

Projects

Useful crates

  • dashmap - Concurrent hashmap.
  • tracing - Tracing of events and spans in async apps.
  • flatdata - Library to create data structures following a flat data model.

About

Practice for rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages