LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-06-2019, 08:22 AM   #1
naf90
LQ Newbie
 
Registered: Mar 2019
Posts: 2

Rep: Reputation: Disabled
rust vs c: future of systems programming


Hi guys, I have a question regarding a paper that I’m undertaking in relation to low level development. Hypothetically speaking what if Linux was written in rust as opposed to C? What advantages would it have? Would it a difference performance/ security wise? I know that the question is redundant but if Rust was available back then would it have been a viable option to develop Linux? As I know that C has always been the choice for low level development due to it ‘doing everything well’, but rust also has many benefits which have been highlighted by developers. Thank you for assistance.

Naf
 
Old 03-06-2019, 09:05 AM   #2
Myk267
Member
 
Registered: Apr 2012
Location: California
Posts: 422
Blog Entries: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by naf90 View Post
Hi guys, I have a question regarding a paper that I’m undertaking in relation to low level development. Hypothetically speaking what if Linux was written in rust as opposed to C? What advantages would it have? Would it a difference performance/ security wise? I know that the question is redundant but if Rust was available back then would it have been a viable option to develop Linux? As I know that C has always been the choice for low level development due to it ‘doing everything well’, but rust also has many benefits which have been highlighted by developers. Thank you for assistance.

Naf
You might want to read around about Redox https://doc.redox-os.org/book/introd.../why_rust.html
 
1 members found this post helpful.
Old 03-06-2019, 09:07 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Your question seems rather general, and I'd like to know more about your personal opinions, especially since you are writing this paper. Such as what are these benefits highlighted by developers?

I personally have always felt about all the bells and whistles that purveyors of many other languages promote, that all of those can be available in C, and it depends how you write your code.

The way the code is designed and written, and the standards adhered to, are what make a software design a quality one.

If someone decided to write an OS using Rust, and some are, I feel they'd find things which they needed to establish conventions for, so as to avoid problems with a large body of code that is written by, and maintained by, a very large community.

To answer your total question of:
Quote:
Originally Posted by naf90 View Post
Hypothetically speaking what if Linux was written in rust as opposed to C?
There still would be a group of people spearheading the project, they still would have standards for testing, coding styles, and acceptance criteria before they would allow introductions of new code into the OS. In short, it would be highly the same, just in a different language.
 
1 members found this post helpful.
Old 03-06-2019, 04:32 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120

Just goes to prove there is nothing you can think of that hasn't been thought of already. No matter how whacky.
 
Old 03-07-2019, 03:22 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
rant
What if they stop fooling with ways to avoid assembly? I'd prefer a pure assembly OS like menuetOS that has the support like Linux.
end of rant.

Things kind of go with the tide. Doubt they will get rid of C soon. Doubt much would change overall. You'd have to assume that people who were writting back when in C would have had basically the same training to do the same tasks in any other language.
 
Old 03-07-2019, 08:37 PM   #6
anon033
Member
 
Registered: Mar 2019
Posts: 188

Rep: Reputation: 13
My Thoughts

Quote:
Originally Posted by naf90 View Post
Hi guys, I have a question regarding a paper that I’m undertaking in relation to low level development. Hypothetically speaking what if Linux was written in rust as opposed to C? What advantages would it have? Would it a difference performance/ security wise? I know that the question is redundant but if Rust was available back then would it have been a viable option to develop Linux? As I know that C has always been the choice for low level development due to it ‘doing everything well’, but rust also has many benefits which have been highlighted by developers. Thank you for assistance.

Naf
This is my personally opinion and there are likely others who may know more than me on this topic. I feel that the advantages are minimal to none, keep in mind things like Rust and Go are really all in all built off and forked from C. Typically the reasons they are used is due to it being "easier" to manage things like memory. However this isn't true. They are merely designed to do a lot of that for you, think of them as a more featured version of C. All in all I believe that systems will continue to be (and should be) written in C. There is no reason to switch. While there are many different views in regards to programming languages I personally think that languages built off of C, such as C++, C#, Rust, Go etc. can't do anything that can't be done with C. This is my personal opinion on this topic and there are likely many much more qualified people who can speak on this topic, but C isn't like Assemble. C is portable, fast (one of the fastest languages out there) and extremely flexible. I don't think it is going anywhere anytime soon, especially in lower level system development and computer engineering.
 
Old 03-08-2019, 12:10 AM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,726

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Another 2 cents

Neither C nor Rust is "low level development" I think of C as a 2 1/2 generation language.

Low level to me means machine language, or at least assembler.
 
Old 03-08-2019, 05:14 AM   #8
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Quote:
Originally Posted by scasey View Post
Neither C nor Rust is "low level development" I think of C as a 2 1/2 generation language.

Low level to me means machine language, or at least assembler.
I think that's a good way of putting it. C often gets lumped in with the other 3GLs, but I'm not sure that is a correct classification for a language that doesn't have a string type and requires you to do so much memory management.


I haven't paid much attention to Rust yet, I'm still waiting to see whether it gets any traction or turns out to be just another flavour of the month.
 
Old 03-08-2019, 06:35 PM   #9
anon033
Member
 
Registered: Mar 2019
Posts: 188

Rep: Reputation: 13
Quote:
Originally Posted by scasey View Post
Neither C nor Rust is "low level development" I think of C as a 2 1/2 generation language.

Low level to me means machine language, or at least assembler.
I plan to learn Assembler as well someday. I find lower level development fascinating.
 
Old 03-08-2019, 06:53 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I come from a different universe - for several decades I did nothing but (IBM) assembler. Over time the pool of people that could dried up, and so did the employment opportunities as customers (and IBM) moved to other languages.
I have no interest in learning x86 assembler in depth - the various compilers can optimise code for various chipsets better than I could ever contemplate. Even the interpreted languages (LUA for example) are amazing.
 
Old 03-08-2019, 07:27 PM   #11
anon033
Member
 
Registered: Mar 2019
Posts: 188

Rep: Reputation: 13
Quote:
Originally Posted by syg00 View Post
I come from a different universe - for several decades I did nothing but (IBM) assembler. Over time the pool of people that could dried up, and so did the employment opportunities as customers (and IBM) moved to other languages.
I have no interest in learning x86 assembler in depth - the various compilers can optimise code for various chipsets better than I could ever contemplate. Even the interpreted languages (LUA for example) are amazing.
I have a huge respect for those who worked in lower level and helped make computing what it is today. Mind if I ask what part of development you worked in? Was it BIOS and Firmware or compilers?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rust vs C: future of systems programming naf90 Linux - General 1 03-06-2019 08:48 AM
future of programming, programming jobs, programming languages? detr Programming 17 08-01-2016 03:46 PM
LXer: Programming in Rust LXer Syndicated Linux News 0 08-24-2014 03:30 PM
LXer: Mozilla's Rust programming language at critical stage LXer Syndicated Linux News 0 07-03-2014 07:00 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration