Author: Ayush Mishra

Custom Implementation of Blockchain In Rust(Part 1)

Reading Time: 3 minutes Hello folks, in this blog, we will be learning how to create our own Blockchain, which is a technology behind Bitcoin. Blockchain technology has been called the greatest innovation since the internet. A Blockchain is a chain of blocks which contain information. A block contains the following:-1) Transaction Data:- This contains information about the Sender, Receiver, number of bitcoins to be transferred. 2) PreviousHash:- Hash Continue Reading

Advertisements
Loggers in Rust

Different ways to write unit test-cases in Rust

Reading Time: 2 minutes As a developer, we know that how important is to write unit test-cases in programming life. Unit Tests allows you to make big changes to code quickly. The main goal of unit testing is to segregate each part of the program and test that the individual parts are working correctly. Failure in a unit test shows without a doubt which part of the code doesn’t Continue Reading

Debugging with and without parameter in Rust

Reading Time: < 1 minute Rust 1.32.0 introduced a macro dbg! for quick and dirty debugging with which you can inspect the value of a given expression. In one of my previous blogs Are you still using println in Rust for debugging? I explained about this macro in detail. Rust 1.35.0 announced an improvement in this macro to make it more usable for Rustaceans. Now you can trace any fine Continue Reading

Why programming community should be serious about RUST

Reading Time: 3 minutes I have been exploring Rust from the last few weeks, as it has been declared the most loving language in 2018. As a Scala/Java developer, I worked on many applications, which were related to the banking domain, web applications, mobile applications, e-commerce, social media, etc. But I was not able to find what kind of applications should be built in Rust? I have searched Rust’s Continue Reading

struct

Different ways for `Error Propagation` in Rust

Reading Time: 2 minutes Error Propagation means the code, that detects the problem, must propagate error information back to the caller function so that it can handle the problem. In the real world, the practice of Error Propagation is necessary. One of the benefits is that your code will look cleaner by simply propagating error information back to the caller that can handle the error and another benefit is Continue Reading

struct

Another way of creating instance of `struct` in Rust

Reading Time: 3 minutes Till now, I knew only one way of creating instance of struct in Rust , which is mentioned in Rust’s official programming book, by adding curly bracket after the name of the struct and add key-value pairs inside curly brackets like below example. I explored another way of doing this using derive-new. This will add an impl fn new(…) -> Self method generated from the Continue Reading

struct

Non-lexical lifetimes in Rust

Reading Time: 2 minutes This blog is for new Rustacean, who just started exploring Rust. I was exploring Rust’s Vector collection, but got confused while testing one of the Vector example of Rust Programming book. Above code won’t compile because we can’t have mutable and immutable references in the same scope. But if we write println! before pushing element into v, code will compile and execute. Here I got Continue Reading

struct

Implement ‘unimplemented’ feature of Rust

Reading Time: 2 minutes The headline looks weird. Isn’t it. Well, there are some hidden corals in Rust sea, which you won’t find in Rust documentation. In the continuation of my exploration about Rust language, I found a useful feature unimplemented!. This feature lets you write a not-yet-implemented method, like this: The methods you define can also take input parameters and specify a return type, like this: Although your Continue Reading

struct

How to Write Better Compilation Error Message In Rust

Reading Time: 3 minutes While exploring Rust’s standard libraries, I came across a beautiful feature of RUST – compile_error. However this feature is useful for only specific use cases, for example:- when you are defining macro_rules! or conditional compilation strategy. Let’s see both use cases, one by one. 1) macro_rules macro is a very powerful feature in Rust. We use it for metaprogramming for reducing the amount of code. Continue Reading

No more run time !! Enjoy Compile time function evaluation using `const fn` in Rust

Reading Time: 2 minutes Sometimes we want the compiler to pre-compute values at compile time. If you have ever done programming in C++, you would have heard about constexpr which is used to improve performance by doing computations at compile time rather than run time. A few days ago, I was exploring Rust’s Unstable Book and found pretty much same feature in Rust, which is const_fn. I started exploring Continue Reading

You can live without Exceptions, If you are using RUST

Reading Time: 3 minutes If you are coming from Java background, where you have used Exception Handling extensively and you have started working on new language like RUST, which doesn’t support Exception Handling then you will be forced to think that does such kind of world really exists? The Java story Java provides full coverage to Exceptions and those are required to be handled with try-catch like construct. In Java, Continue Reading

Are you still using `println` in Rust for debugging?

Reading Time: 2 minutes Printing to standard output is a good way to trace through your code and troubleshoot potential problems. While coding, many programmers use a lot of println statements to see what is going on at different levels in their code. If you are from Java background, you would have used System.out.println() and System.err.println() methods. If you are from Scala background, you would have used println. As Continue Reading

Scrum vs Extreme Programming! Let’s see the difference!

Reading Time: 2 minutes In my previous blog “A quick overview of Scrum and Extreme Programming for the beginners“, I gave a brief introduction on Scrum and Extreme Programming. If we talk about similarities and differences between Scrum and XP, in some ways they are same and yet in some ways they are different. Scrum and Extreme programming, both are referred as “Agile Methodologies”, used in software development to Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!