Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,206,155 members, 7,994,940 topics. Date: Wednesday, 06 November 2024 at 04:10 AM

Why I Am Stepping Into Rust - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Why I Am Stepping Into Rust (2063 Views)

Urgent Need Of Someone Who Understands RUST Programming Language / Learn Rust - Build Fast, Safe And Concurrent Programs Without Tears / Rust Lagos! (2) (3) (4)

(1) (Reply) (Go Down)

Why I Am Stepping Into Rust by harryobas: 5:40pm On Apr 01, 2020
In the last couple of months, I have been actively learning Rust which is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety (http://www.rust-lang.org/). Having been working with a dynamically typed language in the last couple years (Ruby) which obviously have performance limitations.

In my quest for wanting to build high performance applications/systems, I decided to look into compiled and statically typed languages. Some of the options I considered were:

1. C++ - Statically typed systems programming language with high performance. This seem to fit the profile of what I was looking for but the deal breaker for me was its complex syntax rules and overall challenging use.

2. Go – A statically typed, compiled programming language that compiles very fast but has a much slower runtime speed compared to C++ due mainly to the fact that memory management is provisioned using garbage collection which in turn hurts runtime performace.

3. Swift – Too apple-centric for my liking.

I have been learning Rust for over 6 months now and here are some of the features/goodies of this amazing language that came out of Mozilla:

1. Fast like C with excellent C inter-op

2. Segmentation faults are impossible

3. Null-pointer dereferences are impossible

4. Buffer overflows are impossible

5. First class build system / documentation generator / code formatting

6. Rich, expressive type system

7. But unlike C++, the types are sane (e.g. std::string)


Happy Coding smiley

2 Likes

Re: Why I Am Stepping Into Rust by Charleys: 5:48pm On Apr 01, 2020
So wetin concern me?
Re: Why I Am Stepping Into Rust by harryobas: 6:05pm On Apr 01, 2020
Charleys:
So wetin concern me?

E no suppose concern you. Na public forum be this (i.e talk your own i talk my own). So abeg talk the one wey concern you

3 Likes

Re: Why I Am Stepping Into Rust by InfinityFabric: 8:22pm On Apr 03, 2020
50% Bullshit, 50% truth as always RESF (Rust Evangelism Strike Force).

1. It's not 1998 or 2000 or 2010, it's 2020. Which syntax rule are talking about ? FALSE
Rust took C++ syntax and made it worse. It's like a giraffe impregnating a donkey, the end result...

2. That's true. But having GC sometimes can make things easier.

3. Apple does not like sharing. TRUE

1. Still behind D in C interop and both are definitely not even close to C++ in C interop. You directly use C in C++. HALF TRUTH.

2.
Segmentation faults are impossible
Less likely to happen compared to C, C++ or D. Not impossible, keep learning. FALSE!
No one told about 'unsafe' ? Sorry, u are still learning.

3. No one told about 'unsafe' ? Sorry, u are still learning.

4. No one told about 'unsafe' ? Sorry, u are still learning.

5. Could good idea now, might be a PITA in the future. Some things are best kept out of the language.

6.
Rich, expressive type system

I understand your pain, you're coming from peasantry so any little upgrade will be seen as uplifting.

7.
But unlike C++, the types are sane (e.g. std::string)

Rust can only dream of C++ Templates and consequently Concepts.
Edit: It got a lot better than the last time I checked.


Once upon a time, a language called D was to destroy C++, it didn't happen

Pros:
- Neat Syntax
- Superior Template (Generics)
- Vast stdlib
- Build system
...

Cons:
- Compiler Licensing issues
- stdlib fragmentation
- Came with GC
- Few libraries to work with

The greatest mess up was GC, people who write C++ are no interested in Garbage Collection talk, bury it!
Many of D features (some were original C++ papers) made it into Modern C++... surprise!

Apparently, RUST didn't (completely) learn from D. It solves most of its cons but left out pros.

- Worse | more Ugly syntax compared C++. Compared to D's mostly neat, expected and simple syntax.
- Inferior Generics system. D had superior generics which are also faster to compile.
- inferior C interop.
- Worse compile times.
- Thin stdlib.



TLDR; The OP is still honeymoon period, he doesn't know much of what he's saying. Forgive him!
Re: Why I Am Stepping Into Rust by harryobas: 5:25pm On Apr 04, 2020
InfinityFabric:


1. It's not 1998 or 2000 or 2010, it's 2020. Which syntax rule are talking about ? FALSE
Rust took C++ syntax and made it worse. It's like a giraffe impregnating a donkey, the end result...

2. That's true. But having GC sometimes can make things easier.

3. Apple does not like sharing. TRUE

1. Still behind D in C interop and both are definitely not even close to C++ in C interop. You directly use C in C++. HALF TRUTH.

2.
Less likely to happen compared to C, C++ or D. Not impossible, keep learning. FALSE!
No one told about 'unsafe' ? Sorry, u are still learning.

3. No one told about 'unsafe' ? Sorry, u are still learning.

4. No one told about 'unsafe' ? Sorry, u are still learning.

5. Could good idea now, might be a PITA in the future. Some things are best kept out of the language.

6.

I understand your pain, you're coming from peasantry so any little upgrade will be seen as uplifting.

7.

Rust can only dream of C++ Templates and consequently Concepts.


Once upon a time, a language called D was to destroy C++, it didn't happen

Pros:
- Neat Syntax
- Superior Template (Generics)
- Vast stdlib
- Build system
...

Cons:
- Compiler Licensing issues
- stdlib fragmentation
- Came with GC
- Few libraries to work with

The greatest mess up was GC, people who write C++ are no interested in Garbage Collection talk, bury it!
Many of D features (some were original C++ papers) made it into Modern C++... surprise!

Apparently, RUST didn't (completely) learn from D. It solves most of its cons but left out pros.

- Worse | more Ugly syntax compared C++. Compared to D's mostly neat, expected and simple syntax.
- Inferior Generics system. D had superior generics which are also faster to compile.
- inferior C interop.
- Worse compile times.
- Thin stdlib.



TLDR; The OP is still honeymoon period, he doesn't know much of what he's saying. Forgive him!

Dude Its like you misunderstand my post in certain areas so let me correct you as follows:

1. I did not say Rust has a better C inter-op than C++ just merely pointed it out as one of its features.

2. Language syntax is a matter of personal taste. For me C++ syntax looks uglier than Rust syntax. But hey that's just my opinion

3. Segmentation faults are impossible by default unless you for example use raw pointers in unsafe block

4. Rust provides the concept of traits that serve the same purpose as templates in C++. Traits in my opinion are cleaner and less verbose than C++ templates.

1 Like

Re: Why I Am Stepping Into Rust by Playforkeeps(m): 1:14pm On Apr 07, 2020
Congrats OP, I’ve been meaning to learn a new low level language and Rust has been on my mind lately, and apparently a lot of Companies have started switching to Rust from Cs
Re: Why I Am Stepping Into Rust by Playforkeeps(m): 1:14pm On Apr 07, 2020
Congrats OP, I’ve been meaning to learn a new low level language and Rust has been on my mind lately, and apparently a lot of Companies have started switching to Rust from the Cs
Re: Why I Am Stepping Into Rust by kiddie(m): 3:48pm On Jul 11, 2020
harryobas:


Dude Its like you misunderstand my post in certain areas so let me correct you as follows:

1. I did not say Rust has a better C inter-op than C++ just merely pointed it out as one of its features.

2. Language syntax is a matter of personal taste. For me C++ syntax looks uglier than Rust syntax. But hey that's just my opinion

3. Segmentation faults are impossible by default unless you for example use raw pointers in unsafe block

4. Rust provides the concept of traits that serve the same purpose as templates in C++. Traits in my opinion are cleaner and less verbose than C++ templates.


4. Templates are generic containers in C++.
Re: Why I Am Stepping Into Rust by kiddie(m): 3:57pm On Jul 11, 2020
InfinityFabric:


1. It's not 1998 or 2000 or 2010, it's 2020. Which syntax rule are talking about ? FALSE
Rust took C++ syntax and made it worse. It's like a giraffe impregnating a donkey, the end result...

2. That's true. But having GC sometimes can make things easier.

3. Apple does not like sharing. TRUE

1. Still behind D in C interop and both are definitely not even close to C++ in C interop. You directly use C in C++. HALF TRUTH.

2.
Less likely to happen compared to C, C++ or D. Not impossible, keep learning. FALSE!
No one told about 'unsafe' ? Sorry, u are still learning.

3. No one told about 'unsafe' ? Sorry, u are still learning.

4. No one told about 'unsafe' ? Sorry, u are still learning.

5. Could good idea now, might be a PITA in the future. Some things are best kept out of the language.

6.

I understand your pain, you're coming from peasantry so any little upgrade will be seen as uplifting.

7.

Rust can only dream of C++ Templates and consequently Concepts.
Edit: It got a lot better than the last time I checked.


Once upon a time, a language called D was to destroy C++, it didn't happen

Pros:
- Neat Syntax
- Superior Template (Generics)
- Vast stdlib
- Build system
...

Cons:
- Compiler Licensing issues
- stdlib fragmentation
- Came with GC
- Few libraries to work with

The greatest mess up was GC, people who write C++ are no interested in Garbage Collection talk, bury it!
Many of D features (some were original C++ papers) made it into Modern C++... surprise!

Apparently, RUST didn't (completely) learn from D. It solves most of its cons but left out pros.

- Worse | more Ugly syntax compared C++. Compared to D's mostly neat, expected and simple syntax.
- Inferior Generics system. D had superior generics which are also faster to compile.
- inferior C interop.
- Worse compile times.
- Thin stdlib.



TLDR; The OP is still honeymoon period, he doesn't know much of what he's saying. Forgive him!

Entirely my opinion:
Rust is an amazing, modernized language which was thought out accurately when implementing. It improves where C++ lacks and takes out features from other languages like Golang(masterpiece concurrency).
There are lots of downsides in C++(is my first language)
1. High compilation time
2. Theres no standard package manager in C++ which makes development complex. Go and Rust package management is first class. vcpkg by Microsoft doesn't even near it.
2b. Versioning in C++ is close to zero.
3. Translation unit in C++ isnt top notch and they plan on making changes using modules which should improve the language compilation time and binary size but still itll take time for every single library to make a port.
4. Making tests in C++ isnt just there yet honestly which is why we see lots of vulnerabilities in C++ softwares, you hardly even see people teaching testing in C++.

C++ creators are trying to patch things up but I think it's too late. Rust is here to stay. I'd even go for Golang than C++.
Re: Why I Am Stepping Into Rust by InfinityFabric: 6:35pm On Jul 11, 2020
kiddie:


Entirely my opinion:
Rust is an amazing, modernized language which was thought out accurately when implementing. It improves where C++ lacks and takes out features from other languages like Golang(masterpiece concurrency).
There are lots of downsides in C++(is my first language)
1. High compilation time
2. Theres no standard package manager in C++ which makes development complex. Go and Rust package management is first class. vcpkg by Microsoft doesn't even near it.
2b. Versioning in C++ is close to zero.
3. Translation unit in C++ isnt top notch and they plan on making changes using modules which should improve the language compilation time and binary size but still itll take time for every single library to make a port.
4. Making tests in C++ isnt just there yet honestly which is why we see lots of vulnerabilities in C++ softwares, you hardly even see people teaching testing in C++.

C++ creators are trying to patch things up but I think it's too late. Rust is here to stay. I'd even go for Golang than C++.

1. Haha, Rust compilation time is worse. Do u even read anything, Rust compilation speed is one of the downsides. Are you comparing "Hello, World" ?

2. What a moronic argument! C++ is an ISO (try to learn what that means) standardized, they typically don't write softwares in those rooms. They write papers.
Pkg man should be something the community does rather than a committee.
C++ now has modules which enable better package management implementation.

3. So u made an argument and u still destroyed it. C++ has modules, period!

4. What does this even mean ?

C++ creators are trying to patch things up but I think it's too late.
More like: I just want to ride on the Rust Evangelism Train by all means. BTW, it's the ISO STANDARD COMMITTEE.
- They've been more than successful with the introduction of C++11.
- You probably can't differentiate a C++98 from a C++20, because if u can u won't be saying this crap.

Rust is here to stay. I'd even go for Golang than C++.
Of course it's here to stay. But what will it stay as ? Maybe a competitor to Golang in Networking and web.
Golang was supposed to be a C++ killer remember? Now it has been relegated to building networking application. Facepalm!
It had to stray away from its original goal of "system programming language", can't even write a half-decent game engine in it.

All in all, Rust like Dlang was needed as competition to C++ so the committee don't get complacent like Intel.
Between 2020 and 2026 is the last stand for Rust, if by C++26 :
- It has worse compilation to C++: Well, I predict its going to
- It less powerful generic programming to C++.
- "Memory Safety" is still the selling point

Then it's just going to be "one of the others"
Re: Why I Am Stepping Into Rust by alphatron(m): 3:33pm On Jul 12, 2020
there's so much hate on c++ in the system programming community, esp UNIX bbased devas, since top minds can agree to dislike a language well enough to replace wat they hated abt it, I'll trust them. C++ can hardly be replaced though cos of its close ties with C, and we're talking abt decades of codes being maintained so these languages go and rust were made to make development easier not to totally erase c++
Re: Why I Am Stepping Into Rust by kiddie(m): 2:04pm On Jul 18, 2020
InfinityFabric:


1. Haha, Rust compilation time is worse. Do u even read anything, Rust compilation speed is one of the downsides. Are you comparing "Hello, World" ?

2. What a moronic argument! C++ is an ISO (try to learn what that means) standardized, they typically don't write softwares in those rooms. They write papers.
Pkg man should be something the community does rather than a committee.
C++ now has modules which enable better package management implementation.

3. So u made an argument and u still destroyed it. C++ has modules, period!

4. What does this even mean ?


More like: I just want to ride on the Rust Evangelism Train by all means. BTW, it's the ISO STANDARD COMMITTEE.
- They've been more than successful with the introduction of C++11.
- You probably can't differentiate a C++98 from a C++20, because if u can u won't be saying this crap.


Of course it's here to stay. But what will it stay as ? Maybe a competitor to Golang in Networking and web.
Golang was supposed to be a C++ killer remember? Now it has been relegated to building networking application. Facepalm!
It had to stray away from its original goal of "system programming language", can't even write a half-decent game engine in it.

All in all, Rust like Dlang was needed as competition to C++ so the committee don't get complacent like Intel.
Between 2020 and 2026 is the last stand for Rust, if by C++26 :
- It has worse compilation to C++: Well, I predict its going to
- It less powerful generic programming to C++.
- "Memory Safety" is still the selling point

Then it's just going to be "one of the others"

I'd prefer we converse without hurling insults grin
1. You seem to be comparing Rust compile time which has an amazing compile error checker and C++ whose error checker is suboptimal. Have you seen rust error logs when users make mistakes it literally guides users to how they can make changes, this comes at a cost but it's worth it and I'm sure this would be perfected soon.

2. I guess this has been C++ pitfall. You have clang, msvc and more and when the high and mighty forces down "a standard way to write something down our throats" then various compiler developers starts scampering to implement support and then we have bad code cross-compilation.

3. Too too late we cant wait for all libraries to make the transition.

4. Show me books in C++ that teaches unit testing and benchmarking precisely especially for beginners, Rust documentation does that smiley which is one of the fundamentals of programming.

You seem to be on the defence for C++ cheesy C++98 to C++20 seem to be a very wide consistent development age for the C++ team and we pretty much haven't solved the issue of optimally using a low level language like C++ for modern computers.

Golang is meant to be a C++ killer? How? To write low level driver codes? Go has garbage collection.

Let give Rust the chance and make opensource softwares to make it fly.
Re: Why I Am Stepping Into Rust by alphatron(m): 8:26pm On Jul 21, 2020
kiddie:


I'd prefer we converse without hurling insults grin
1. You seem to be comparing Rust compile time which has an amazing compile error checker and C++ whose error checker is suboptimal. Have you seen rust error logs when users make mistakes it literally guides users to how they can make changes, this comes at a cost but it's worth it and I'm sure this would be perfected soon.

2. I guess this has been C++ pitfall. You have clang, msvc and more and when the high and mighty forces down "a standard way to write something down our throats" then various compiler developers starts scampering to implement support and then we have bad code cross-compilation.

3. Too too late we cant wait for all libraries to make the transition.

4. Show me books in C++ that teaches unit testing and benchmarking precisely especially for beginners, Rust documentation does that smiley which is one of the fundamentals of programming.

You seem to be on the defence for C++ cheesy C++98 to C++20 seem to be a very wide consistent development age for the C++ team and we pretty much haven't solved the issue of optimally using a low level language like C++ for modern computers.

Golang is meant to be a C++ killer? How? To write low level driver codes? Go has garbage collection.

Let give Rust the chance and make opensource softwares to make it fly.


Though I'm not on the whole rust train, I quite agree with your last 2 points. C++ hasn't changed much to accommodate for the newer ways we write sw.
Re: Why I Am Stepping Into Rust by Dujardin(m): 7:44am On Jul 23, 2020
Nice one OP, you did a good research.

Also note that as a software dev, the best reason to move from one language to another is; after you have done a good software requirement analysis and you need to take educated decisions on achitechural flow of the product to be delivered, then your decision will be totally based on facts.

I am currently working in a team where we use Golang, Typescript and Javascript for various microservices.
Re: Why I Am Stepping Into Rust by harryobas: 8:36am On Jul 24, 2020
Dujardin:
Nice one OP, you did a good research.

Also note that as a software dev, the best reason to move from one language to another is; after you have done a good software requirement analysis and you need to take educated decisions on achitechural flow of the product to be delivered, then your decision will be totally based on facts.

I am currently working in a team where we use Golang, Typescript and Javascript for various microservices.

I think you have a point. In my opinion, the core design goals of a software-intensive system should greatly influence the choice of programming language. For example if your design goal is performance and safety then Rust can be a good choice. If you require high scalability and concurrency then a language like Elixir should be considered.

1 Like

(1) (Reply)

Programming Vs Networking / C/C++ Doctor: Get Help In Writing C/C++ Programs / 7 Steps How To Create Android App With No Coding Skills?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 68
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.