What method to install Rust on Ubuntu 20.04?

I want to install Rust on Ubuntu 20.04.

The Rust people say to use their curl command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

But some Ubuntu people say to use: sudo apt install rustc

Anyone wish to offer a suggestion on what method they recommend? (Maybe it makes no difference?)

4 Replies

I’d use the first method.

rust is updated much more often than the Debian/Ubuntu apt packagers get around to updating the apt package.

With the fist method you get these updates when they’re available. With the apt package you only get updates as often as the packagers decide to update the package.

— sw

Steve: Thanks for the update.

After spending a day studying the Rust language I think I'll just stick to plain old C for what I want to do. I can't seem to get my head around the syntax of Rust… it is worse than the old Objective-C.

If you need huge performance and excellent memory management in an embedded program for some device Rust is great, but for simple applications without need of GUI, Rust does not bring anything to the table… except greater complexity, IMO. Size-wise I think they compile to about the same footprint.

C++ is an option but it too is overkill for what I want to do. (I've never bought into the object-oriented methodology but I'm probably in the minority.)

Thanks again.

I agree that the Rust syntax is complicated. This is largely due to the requirement that you specify semantics exactly…semantax. For most humans (and those that grew up on C/C++), that’s a huge headache. I'm told bye those that don’t have that baggage the syntax is pretty natural.

GUIs are not a part of languages per se… Adding them to annything always makes that thing 2 orders of magnitude more complicated. Look what X, X Toolkit and Motif did to C…

I liked C++ before it got loaded up with templates, 10000 different kinds of pointers, etc. Now it’s just complicated. I’m probably missing the point here though (wouldn’t be the first time)…

Have a look at go. The syntax is very C-like. It supports garbage collection (so no null pointer bugs) & it's screaming fast. If you don’t need speed-of-light performance, check out luajit. I’ve been using it to write custom rules for rspamd

lua is amazingly expressive and easy to understand…kinda like what perl would be like if there was a requirement that someone else had to be able to figure out your code just by looking at it (e.g., no long strings of punctuation representing operators). luajit sacrifices some later language features for really good performance.

— sw

P.S. There's an old canard that any random string of English punctuation is a valid perl program. If you've ever had to support, enhance or fix someone else's perl program, you know that's true. If you've ever written a perl program, put it on the shelf and then come back to it after about 3 months or so, you know that's true.

Some 25 years ago in the early days of CGI I messed with Perl (and, of course, had the "Camel" book!) but I never much liked it. For me, PHP was easier and did all I needed to do.

I wrote this around 2001. It is now dormant and not maintained but it still works. It is about 100,000 lines of PHP.

https://www.jaya123plus.net/pub456a/logingo.php

I'm not familiar with Lua and from what I understand people truly love or truly hate Go. I've looked at it and I like it better than Rust but still prefer tried and true C and/or C++ for what I do.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct