Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

What Do You Think About the Rust Programming Language?

raindog308raindog308 Administrator, Veteran

I needed to write a utility for my own use and decided to try out Rust, since all the cool kids are using it.

I found it a nice language to work in.

I've seen a lot of comments about how Rust's memory management, ownership, borrowing, etc. was hard to wrap your brain around but as an old-time C programmer, I'm used to pointers, referencers, stack, heap, etc. so I didn't find these topics at all challenging. You learn a few rules and that's it. Explicitly marking variables as mut is nice.

I think if you were coming from something like JavaScript, then yes, Rust would be mind-blowing. Coming from C or golang or both in my case, Rust is more of a different dialect than a whole new world.

I remember a comment from jwz about Java years ago:

"Java doesn't have free(). I have to admit right off that, after that, all else is gravy. That one point makes me able to forgive just about anything else, no matter how egregious."

I agree - manual memory management is a pain point I prefer to avoid.

The println! macro is quite nice, as it catches printf issues at compile-time rather than run-time. The more I've programmed, the more I've appreciated this approach (and statically typed languages in general for this reason).

I haven't gotten into async stuff yet, but perception is that golang is more pleasant for that, given that it's an add-on to Rust. Rust does tend to make big binaries like golang, but not so big that I remotely care.

I was surprised that std is so poor. For example, no random number generator. If you want that, you need to use the rand crate, which is third party. Seems like a lot of things are third-party crates, which in this age of supply chain attacks, makes me nervous.

My code is probably not idiomatically correct at this point and it was just an initial project, which I could have written in Python or golang. But I think I'll play with Rust more going forward.

«1

Comments

  • LeviLevi Member

    Just use Go. I find rust ugly syntactically and hard to read.

  • fredo1664fredo1664 Member

    I write Ada code for fun since I no longer do that at work, so I never really saw the point (for me) of trying yet another "safe" language. And Ada allows me to escape the curly bracket languages, which is nice sometimes. Although if I did not have Ada I would probably have given Rust a try.

    What kind of tools do you make in Rust?

  • raindog308raindog308 Administrator, Veteran

    @Levi said: ugly syntactically

    if err != nil {
        return err
    }
    
    Thanked by 1TrikeLike
  • stable_geniusstable_genius Member
    edited May 28

    Rust feels heavy, too much cargo I suppose. It must be quite good, I'm sure of that, it's probably GREAT just NOT TOO GREAT.

    If only it were lighter! Its significant weight holds it back.

  • raindog308raindog308 Administrator, Veteran

    @fredo1664 said: I write Ada code for fun since I no longer do that at work, so I never really saw the point (for me) of trying yet another "safe" language. And Ada allows me to escape the curly bracket languages, which is nice sometimes. Although if I did not have Ada I would probably have given Rust a try.

    IIRC @jsg is an Ada guy, too. @jsg how do you feel about Rust?

    @fredo1664 said: What kind of tools do you make in Rust?

    This was a utility I made for myself to analyze a huge library of images and find duplicates based on several different criteria, and also cross-check with another filesystem full of images. It could have been written in Python or Perl...heck, I probably could have written it in Bash if I really wanted to. Was really just an excuse to try out a new lang.

    Thanked by 1fredo1664
  • fredo1664fredo1664 Member

    @raindog308 said:

    Was really just an excuse to try out a new lang.

    Famous last words.

    Thanked by 1raindog308
  • LeviLevi Member

    @raindog308 said:

    @fredo1664 said: I write Ada code for fun since I no longer do that at work, so I never really saw the point (for me) of trying yet another "safe" language. And Ada allows me to escape the curly bracket languages, which is nice sometimes. Although if I did not have Ada I would probably have given Rust a try.

    IIRC @jsg is an Ada guy, too. @jsg how do you feel about Rust?

    @fredo1664 said: What kind of tools do you make in Rust?

    This was a utility I made for myself to analyze a huge library of images and find duplicates based on several different criteria, and also cross-check with another filesystem full of images. It could have been written in Python or Perl...heck, I probably could have written it in Bash if I really wanted to. Was really just an excuse to try out a new lang.

    Perl is sexy!

    Thanked by 1raindog308
  • rpqurpqu Member

    My answer is this

  • slowserversslowservers Member, Host Rep

    I haven't written any Rust, but will say that I am appalled by Rust's memory usage and build times. It's so high that a lot of 32 bit x86 packages can't be built natively. You're looking at 4GB+, maybe 8GB or more to build certain projects like Firefox. Build is also very slow and intensive.

    You do get some nice features for that, but I don't like how once-adequate hardware is becoming obsolete, largely because of Rust.

    I think Go is a nice language to work with. Obviously doesn't give the guarantees of Rust and I've been surprised by behavior of code that's been able to compile. But it's very fast to build and feels a bit more human scale. It's technically inferior to Rust, of course, but it depends on what you're looking for.

  • @slowservers said:
    I haven't written any Rust, but will say that I am appalled by Rust's memory usage and build times. It's so high that a lot of 32 bit x86 packages can't be built natively. You're looking at 4GB+, maybe 8GB or more to build certain projects like Firefox. Build is also very slow and intensive.

    You do get some nice features for that, but I don't like how once-adequate hardware is becoming obsolete, largely because of Rust.

    I think Go is a nice language to work with. Obviously doesn't give the guarantees of Rust and I've been surprised by behavior of code that's been able to compile. But it's very fast to build and feels a bit more human scale. It's technically inferior to Rust, of course, but it depends on what you're looking for.

    Rust feels wrong, I tried to like it years ago but with no success.

  • barbarosbarbaros Member

    It’s rusty :(

    Thanked by 1Saragoldfarb
  • ailiceailice Member

    What Do You Think About the Rust Programming Language?

    I kinda like it and using it for mostly time of my personal project and $WORK.

    Working on high concurrent also freedom of memory corruption and its not like some big chunk C++ codebase and still have some big degree of performance was huge point.
    (I know optimization can be called by some senior C/C++ but its not on case on every project)

    Speaking about built-in tool like you can build html to explore offline was something rarely see and hopefully there other language doing it.

    And yes rust compile-time was have pretty many task like RAII, Lifetime, Borrow Checking, Trait and etc also LLVM was making optimize runtime make it more slower-and-slower, but the idea you kinda lift some heavy-work but have kinda par with other system programming which nice to have imo.

    Thanked by 2oloke yoursunny
  • raindog308raindog308 Administrator, Veteran

    @Levi said: Perl is sexy!

    I learned all the Unix shell/text utilities (sed, awk, etc.) and then was introduced to Perl and it was magic. It's still the fastest way to write text-manipulation code. Python can do everything Perl can do, but Perl is both faster and quicker to write when it comes to text-handling code.

    I'm probably the only person on the planet who learned OOP through Perl. Damien Conway's book.

    I can't defend learning it in 2026 but I'll probably be writing one-off sysadmin scripts in it until I die.

    Thanked by 3whynotlearn Levi rcy026
  • LeviLevi Member

    @raindog308 said:

    @Levi said: Perl is sexy!

    I learned all the Unix shell/text utilities (sed, awk, etc.) and then was introduced to Perl and it was magic. It's still the fastest way to write text-manipulation code. Python can do everything Perl can do, but Perl is both faster and quicker to write when it comes to text-handling code.

    I'm probably the only person on the planet who learned OOP through Perl. Damien Conway's book.

    I can't defend learning it in 2026 but I'll probably be writing one-off sysadmin scripts in it until I die.

    Cryptic perl one-liners from stackoverflow still haunts me to this day. Hehe, shell fork bomb!

  • x1archx1arch Member

    @raindog308 said:

    @Levi said: ugly syntactically

    > if err != nil {
    >     return err
    > }
    > 

    Why not? It's not necessary, you could write your own functions without error return, just a result. It's up to you. Go code you could read easily, but some gays contrive to write incomprehensibly. They are so talented! XDDDD
    What you prefer?

    try {} catch {}

    ?

  • 384_cz384_cz Member

    Rust is a good replacement of Python, but the C programming language is still better for lower resource requirements
    Slow compile times and ugly syntax are Rust problems too

  • rcy026rcy026 Member
    edited May 28

    @raindog308 said:

    @Levi said: Perl is sexy!

    I learned all the Unix shell/text utilities (sed, awk, etc.) and then was introduced to Perl and it was magic. It's still the fastest way to write text-manipulation code. Python can do everything Perl can do, but Perl is both faster and quicker to write when it comes to text-handling code.

    I'm probably the only person on the planet who learned OOP through Perl. Damien Conway's book.

    Hear hear, a man of culture I see.
    Way back during the 90's I used Perl for practically everything in Solaris running on Netra hardware, and when that book came out it really changed the way I did things. I'm pretty sure I still have a copy of it somewhere.
    We used to call it "play perl", as in "we need to convert these mailfiles to maildir format, can someone play perl on it?"

    I can't defend learning it in 2026 but I'll probably be writing one-off sysadmin scripts in it until I die.

    True, I would not learn Perl or advice anyone else to use it today, but I still use it sometimes and it still works for me.

  • PuDLeZPuDLeZ Member

    What Do You Think About the Rust Programming Language?

    I think it's the perfect language to rewrite core open source things in so you can change the license!

    Thanked by 1stable_genius
  • stable_geniusstable_genius Member
    edited May 28

    @PuDLeZ said:
    What Do You Think About the Rust Programming Language?

    I think it's the perfect language to rewrite core open source things in so you can change the license!

    Surprisingly, the bots seem to love rust.

  • raindog308raindog308 Administrator, Veteran

    @x1arch said: but some gays contrive to write incomprehensibly

    image

    Thanked by 1x1arch
  • SaragoldfarbSaragoldfarb Member, Megathread Squad

    Someone made a rust joke yet?

  • minioptminiopt Member

    I tried Rust a few years ago for a small project, nothing complicated so I didn't run into particular issues besides the borrow checker screaming at me as I was learning, expected though.

    At this point in time Rust has been officially adopted by Linux and Tor so I think that shows it's mature enough. But it doesn't seem to be great for game development though: https://loglog.games/blog/leaving-rust-gamedev/

    Also like with any other package manager Cargo could get targeted by a supply chain attack. Maybe Rust is still too niche to be an interesting target for attackers but it could happen.

  • @raindog308 said:

    @Levi said: ugly syntactically

    > if err != nil {
    >     return err
    > }
    > 

    I was scrolling and knew exactly what langauge you were talking about when i saw this one

    Thanked by 2rpqu x1arch
  • yoursunnyyoursunny Member, IPv6 Advocate

    We are studying Rust.
    Excerpt from Deep Atlantic Storage: Rewriting in Rust blog post regarding the motivation:

    Why Rust

    I choose to study the Rust programming language because:

    • Rust is one of the major system languages that I do not know.
    • Rust, just like Go, is a memory safe language, apparently now a national security issue.
    • Rust, unlike Go, does not have a garbage collector.
    • Rust, unlike Go, does not have a nil pointer.

    The last point is particularly important.
    In Go, I often find myself writing a method with pointer receiver:

    type Counter struct {
        V int
    }
    
    func (cnt *Counter) Increment() {
        cnt.V += 1
    }
    

    The pointer receiver is required, if the method needs to modify a field on its receiver.
    However, more often than not, I forget to check whether the receiver itself is a nil pointer, even in production code.
    If the above function was called like this:

    var cnt *Counter
    cnt.Increment()
    

    It would experience a panic at runtime:

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x46f383]
    

    In contrast, Rust's rigid rules can prevent writing such careless code.
    A function/method is allowed to modify its arguments, including self, only if the argument is passed as a mutable borrow, signified with the mut keyword.
    Moreover, a borrow can only be created from a real value, allocated in either the stack or the heap.
    It is generally impossible to have a nil or NULL pointer, or a borrow that points to invalid memory.
    This different, as I perceive, elevates Rust to have a higher level of memory safety.

  • x1archx1arch Member

    @yoursunny said:
    We are studying Rust.
    Excerpt from Deep Atlantic Storage: Rewriting in Rust blog post regarding the motivation:

    Why Rust

    I choose to study the Rust programming language because:

    • Rust is one of the major system languages that I do not know.
    • Rust, just like Go, is a memory safe language, apparently now a national security issue.
    • Rust, unlike Go, does not have a garbage collector.
    • Rust, unlike Go, does not have a nil pointer.

    The last point is particularly important.
    In Go, I often find myself writing a method with pointer receiver:

    type Counter struct {
        V int
    }
    
    func (cnt *Counter) Increment() {
        cnt.V += 1
    }
    

    The pointer receiver is required, if the method needs to modify a field on its receiver.
    However, more often than not, I forget to check whether the receiver itself is a nil pointer, even in production code.
    If the above function was called like this:

    var cnt *Counter
    cnt.Increment()
    

    It would experience a panic at runtime:

    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x46f383]
    

    In contrast, Rust's rigid rules can prevent writing such careless code.
    A function/method is allowed to modify its arguments, including self, only if the argument is passed as a mutable borrow, signified with the mut keyword.
    Moreover, a borrow can only be created from a real value, allocated in either the stack or the heap.
    It is generally impossible to have a nil or NULL pointer, or a borrow that points to invalid memory.
    This different, as I perceive, elevates Rust to have a higher level of memory safety.

    For this case, GOphers usually use function constructor NewCounter() *Counter, which return valid Counter object and you could use it safety. It's not a bug, just read go tour where described nuances of the language.

  • yoursunnyyoursunny Member, IPv6 Advocate

    @x1arch said:
    For this case, GOphers usually use function constructor NewCounter() *Counter, which return valid Counter object and you could use it safety. It's not a bug, just read go tour where described nuances of the language.

    We are obviously aware of this pattern:

    func NewCounter() *Counter
    

    However, there's nothing to enforce every Counter pointer is created from NewCounter().
    It gets even worse if Counter or *Counter is included in a larger struct.

  • x1archx1arch Member
    edited May 29

    @yoursunny said:

    @x1arch said:
    For this case, GOphers usually use function constructor NewCounter() *Counter, which return valid Counter object and you could use it safety. It's not a bug, just read go tour where described nuances of the language.

    We are obviously aware of this pattern:

    func NewCounter() *Counter
    

    However, there's nothing to enforce every Counter pointer is created from NewCounter().
    It gets even worse if Counter or *Counter is included in a larger struct.

    Yea, it could be a problem for newbies, but if programmer has at least 6 months of experience, he know this and probably fix all this cases on testing stage before send a commit. For other cases we have recover and service restart (architecture should cover cases when something went wrong). Anyway you will find and fix the problem after fist panic, instead of rust, when log and stack in console could have no any information about real problem. I faced with it when wrote backend runner in Tauri, the problem was in one place, but in log I got the problem in another place, which absolutely not related with problem code, it's madness. I faced with the same problems in C when you have no Idea where real problem happened, that's impossible in Go.

  • vicayavicaya Member

    @raindog308 said: I was surprised that std is so poor. For example, no random number generator. If you want that, you need to use the rand crate, which is third party. Seems like a lot of things are third-party crates, which in this age of supply chain attacks, makes me nervous

    Standard library is usually poor (using rng as an example) in most languages, including mature ones like C/C++, Java, and go.

    OTOH, syntax is less of an issue in the era of agentic coding. Once you get used to the syntax (for reviews), esp. the traits gymnastics, it hit the right spot for safety, perf, and expressiveness.

  • yoursunnyyoursunny Member, IPv6 Advocate
    edited May 29

    @vicaya said:

    @raindog308 said: I was surprised that std is so poor. For example, no random number generator. If you want that, you need to use the rand crate, which is third party. Seems like a lot of things are third-party crates, which in this age of supply chain attacks, makes me nervous

    Standard library is usually poor (using rng as an example) in most languages, including mature ones like C/C++, Java, and go.

    OTOH, syntax is less of an issue in the era of agentic coding. Once you get used to the syntax (for reviews), esp. the traits gymnastics, it hit the right spot for safety, perf, and expressiveness.

    C++23 standard library is very powerful.

    In the old days circa 2006, our favorite standard library is the .Net Framework.
    We wrote all the data structure homework in C++.Net, because the syllabus said C++ and we complied with the requirements.
    We were printing the binary tree in XML while other students were dealing with printf.

    Rust standard library doesn’t have XML or JSON.
    Sigh.

  • raindog308raindog308 Administrator, Veteran

    @vicaya said: Standard library is usually poor (using rng as an example) in most languages

    That may be true in an absolute sense because there are thousands of programming languages, but these languages have rng without installing anything else:

    • Python
    • Perl
    • Java
    • C
    • C++
    • C# (according to my googling - have never used it)
    • Golang
    • JavaScript
    • PHP
    • Ruby (according to my googling - have never used it)
    • Awk
    • bash
    • Common lisp
    • COBOL
    • FORTRAN

    @vicaya said: including mature ones like C/C++, Java, and go.

    I'm not sure why you say C doesn't have it...it's in stdlib.h

    Golang has math/rand

    In Java it's in java.util

    Etc.

    By "standard library" I mean "first-party libraries that are installed with the development environment". Maybe you mean something else.

Sign In or Register to comment.