Interesting article.
There is a YouTube video talking about it too.
It talks about rewriting GNU Coreutils in Rust.
Interesting article.
There is a YouTube video talking about it too.
It talks about rewriting GNU Coreutils in Rust.
That is a relatively modest goal. They should achieve it .
The oxidiser
tool should help to avoid package issues, because it standardises substituting a rust version for a C version.
I hope it is going to be a completely open-source effort, including the oxidize tool?
We dont want to have proprietary Ubuntu core utilities.
Rust code tends to be longer than the equivalent C code… you have to do more explicit declarations.
and
I dont like the rust syntax… it lacks readability.
Here is what I mean…
In every sane language a variable is something that varies… but not in rust… variables in rust are immutable by default… ie they are constants.
so, in every line of code if you want a variable to vary, you have to precede its name rith ‘mut’. That results in unreadably long codd lines.
Rust precedes every expression with the keyword ‘let’. More redundant words on every line… surely the ‘=’ symbol is enought to tell the compiler it is a replacement statement?
Then there is the ‘:’ which goes after a variable name and explicitely sets its type (eg x: i32)… I dont want type definitions muddled in with code logic… definitions and declarations should all be away from the code body.
It seems to me rust is designed to make the programmer work harder. It should be the opposite.
I can agree with Rust code being kind of ugly. It’s a relatively new language. They could have started with something more human readable surely. I’ve never tried to invent a language, but I’d try for something more readable for sure.
Yeah,
Even Fortran and Cobol have a better syntax than Rust.
Julia is nearly as bad as Rust.
I dont get what these modern language designers think they are doing?
It is not all bad today. Python and R are quite readable.
So is Nim. It would have been a better choice than Rust for linux.
The most readable language ever would have to be Pascal. Wirth was a genius at languages.
It’s been so long I wouldn’t recognize Pascal. I took it on cards in college. From memory, I thought it looked similar to C. Lots of punctuation and braces and brackets and parenthesis. Right? There is no need for all that punctuation. Look at Python.
As a mostly COBOL programmer I never understood everyone’s reaction to the white space in Python. We were always taught to code like that for readability in any case.
Still my favourite clean clear code
Could I do it today not sure.
I like html but it’s not really progressing
With C readability depends a lot on how you write code.
It can be clear or really obscure. C is very flexible.
I suppose I have got used to punctuation.
The semicolons on C are indeed redundant… they just let you cram out whitespace.
Braces versus END statements… I dont care which. They are both readable
I just want to be able to see the control flow logic… uncluttered by definitions or declarations or formats or casts or tricky #defines.
I looked. It uses : and indentation. That means indentation is not just for show, it is essential.
nim is the same.
I like it… very clean.
That’s kinda hilarious - to me anyway - in 1994 I had a lecturer at Uni - he asked what code was more “readable” than “C” - and someone stupidly, near the front row - piped up and said “Pascal” - and this lecturer lambasted their argument - and he was 'murican (too long ago to have picked up if he was a Canuck or a Seppo [rhyming slang “seppo” is short for “Septic Tank” rhymes with “yank”]) - but the lecturer would speak with a “frog in his throat” all the time - he sound like f–king Kermit the Frog… I could never take that lecturer seriously… Needless to say - I didn’t like him and failed “C” (the whole “unit” was “C” and “C++”).
I gave up - I found assembler more friendly than “C”…
– edit –
I did used to use PovRAY raytracer - version 1 and 2 - the object raytracing description language was very “C” like - and I got my head around it… No idea why I couldn’t get my head around “C” programming…
Being a Pascal and Modula-2 child, after many years of professional experience, I had to revise my initial disgust for the C language.
Any good coder can write human-readable code if he takes his job seriously.
I simply cannot say anything about Rust, there never was a necessity to look into.
It depends what sort of problem you try to code.
That lecturer has killed your motivation, and the students question was on the ball. Pascal is a good intro to C… it teaches all the same concepts.
Another way into C might be Nim… It looks like C with a Python syntax…, I have not tried it.
and
@abu is right
You need to learn from good clean code, not from stuff laden with tricky #defines or slack structure.
Agreed. The preprocessor is a real door to hell.
I haven’t coded in Rust, but a few months ago I read the entire Rust book. It was fascinating. So many interesting concepts for safe programming. Some of them are really counterintuitive, like the rules for assignment and mutability, but they do make sense. They just require a new way of thinking. I wish I had a large program that needed writing so I could try it in Rust.
Yes, that is the only way to become proficient.
I think I would try Julia rather than Rust, but that is only because it suits my statistical work.
There is an O’Reilly book on Rust programming too… do you recommend that?
Which book is better for a starter with experience in other languages?
I haven’t read the O’Reilly Rust programming book, sorry.
I just saw this one today. It’s a pretty good read and not too long.
I think they should implement rust apps as a set of parallel packages that you can choose with update-alternatives.
By taking the dropin approach, they are removing choice.
Other distros may do it differently.
The article says they are giving the option to easily switch back to the standard version.
so we’ll be able to make use of the Debian alternatives system for the transition.