Can Rust replace the C programming language for things like kernels, microcontroller etc.?

Can Rust replace the C programming language for things like kernels, microcontroller etc.?
If not, why?

Other urls found in this thread:

github.com/redox-os/ralloc
servo.org/
pastebin.com/UAQaWuWG
manishearth.github.io/blog/2016/08/18/gc-support-in-rust-api-design/
twitter.com/NSFWRedditImage

Can it? Probably
Will it? No way

It can, but it won't.

It can, it likely will in some niches, unlikely in anything big or popular.

Can o:XML replace the C programming language for things like kernels, microcontroller etc.?
If not, why?

what is this

>Can Rust replace the C programming language for things like kernels, microcontroller etc.?
Yes, check out Redox for a working example of an operating system written mostly in Rust.

It's better to compare Rust to C++ imo as for some things ASM/C/Fortran will never die.

>Can ____ replace the C programming language
No. The answer is always no. Whatever language you're asking about, it's still no. Forever.

You can't get lower level than C and still be cross platform. You can't get higher level than C and still be close to the metal. So now your language does exactly the same things as C, but isn't C. What good is it?

Take your memes somewhere else.

>You can't get higher level than C and still be close to the metal.
You don't know what you are talking about.

yes but probably not. also like half the code would be tagged unsafe anyways so really the benefits of rust would be dubious.

...

No.unwrap().way.unrwrap().will.unrwrap().it.unwrap().ever.unwrap()

nigger do you even know a single thing about Rust?

does rust have gui libraries
does rust have networking libraries
if so, sign me up

can somebody answer this?

rust will become abandonware and oxidize which is quite ironic

>gui
There are bindings, but it's not baked into the official Rust framework. You have to use cargo to load it.

>networking
Yes

Has rust even implemented its own alloctor yet, or is it sill using jemalloc?

It can, but no one will spend millions of man hours re-implementing all sorts of infrastructure in the latest meme language.

COBOL is still around...

Can Rust replace anything? Yes. But I don't think it will.

It will be used where it is used, and nothing will replace it either.

>GUI libraries
The GUI landscape for Rust is currently utter and absolute shit, the language is lacking some things which would make GUIs usable, unless someone comes up with some different way to do things.

The same issue is present with implementing the DOM, too soon if that's your target.

>networking libraries
Yes, they're pretty mature and getting better all the time.

What's the point of implementing its own allocator when it can use jemalloc?

Regardless, someone is working on a memory allocator in Rust called ralloc.

No until the autists die out and use something else other than C

>You can't get lower level than C and still be cross platform
Assembly

>You can't get higher level than C and still be close to the metal
You can't get deeper in the ocean if you're above water

You can't exactly write an allocator in a garbage collected language.

Most operating systems use some kind of libc to handle sys calls. Also TCP/IP is implemented in C so you need C wrappers to do networking. Basically someone is going to have to design a C-less operating system to be able to finally put C to rest.

>Assembly
>Crossplatform

gr8 b8 m8

ಠ_ಠ

yeah. What does 'replace' mean? C is already too heavily used to be "replaced" and die. For new projects, sure, it might. It's better than C for sure.

>Basically someone is going to have to design a C-less operating system
C is THE language for writing operating systems. How are you going to write an operating system without using the language for writing operating systems?

ask redox

Operating systems have been written in lots of languages besides C, youre just a basement dweller who believes everything you read on /dpt/

Not one of them was successful

It won't any time soon.

People want to program microcontrollers imperatively.

I can't imagine how you could get them to switch to a multiparadigm language. Would have to be a damn clever library + compiler combination, I imagine. Not Rust.

some version of CP/M was used on about every personal computer from the late 70s to the mid 80s.

every IBM OS until unix decimated the OS market

go back to your fizzbuzz

Probably eventually. It'll take a long time though.

Rust's more of a replacement for C++ than C.

>What's the point of implementing its own allocator
being able to completely bootstrap is pretty essential for a language to be able to implement a kernel in, lest it ends up 90% assembly.

Part of what makes C and C++ so powerful is that they don't rely on any magic library code. In fact, 99% of the C++ standard library is written in C++. Can Rust say the same? Will it ever be able to? Doubtful.

>Basically someone is going to have to design a C-less operating system to be able to finally put C to rest.
There have been noble attempts to do this. I would be very excited if it is done.

Nothing will EVER replace C.

You can write an operating system in virtually every language, a single proof of concept does not mean it's a *good* replacement

>Rust on 2K of RAM

No. Rust isn't some C# type of bloat, but it's not for microcontrollers, especially on the lower end.

You know that rust does not have a GC ?

I really like this thread. Can a clever man give a real good explanation ?

Thanks ''''''''Henry'''''''

There is: github.com/redox-os/ralloc

Is rust multiparadigm? I thought it was mainly procedural.
Are traits making rust oo or just interface oriented?

s/Assembly/LLVM IR

It's Multiparadigm. Traits are similar to Haskell's typeclasses and are sort of like interfaces.

You can still easily ignore that and write in a purely procedural way.

operator ? is almost finished iirc

Rust doesn't have a GC, go be ignorant somewhere else.

>>for everyone saying you can write an os in any language

Please be my guest to write an operating system in scratch. Go on.
On a more realistic note, could you really write an os in Python? JS?

>magenta os is built with c, c++ and dart
>fuchsia's kernel (magenta) is built with c and (a subset) c++

is rustlang kill?

No. Rust primary reason for existence is to be memory- & thread-safe, so that you write browser engines in it, which is why it's development happened symbiotically with the Servo project: servo.org/

That you're able to write an OS in it is just a consequence of it's manual memory management capabilities.

*so that you can write

the moment rust has proper QT bindings or even a native library.
i will switch to it exclusively.
cant live without QT anymore.
how can other gui frameworks even compete anymore?

Google != Mozilla

>Please be my guest to write an operating system in scratch. Go on.
It's not that hard actually. You only need a few days. Writing an OS =! writing a good OS.

>especially on the lower end.
This, OP. If you can't use threads and dynamically allocated memory, it's not worth the trouble.
At that point you might as well use a 'better C' like Ada or Zig.

As much as Qt is the best GUI framework, I don't see much sense in using a GUI in another than its native language. Rust community should implement something between Qt and Tk with native, idiomatic Rust APIs.
Bindings to something this complex are always subtier and a grave for efforts.
For example, PyQT offers APIs for custom widgets, but as soon as you implement a sufficiently complex widget it will become slow.

Also, I don't like that the Qt dev team focusses so much on QtQuick and neglects the normal widgets.

With libcore, 2K of RAM in Rust is do-able.

pastebin.com/UAQaWuWG

You're moving the goalposts. Fact: If Rust wasn't dead, any new OS project would be written in it instead of C/C++. Checkmate, SJWs.

>Judging a language by how many OSes are written in it
Weak bait

Also, is there a kernel that's written in pure C++?

Yes, it can.

A fair amount of the code would have to be tagged unsafe, but if not all of it is, it's still an improvement.

There's Haiku, isn't there?

No because nobody can be arsed to live up to the compilers expectations, and if you're going to wrap everything in unsafe blocks you might as well just go for C.

Only retards wrap everything in unsafe {}.

The only things you can do in unsafe blocks in addition to safe Rust are the following:

1. Access or update a static mutable variable
2. Dereference a raw pointer
3. Call unsafe functions

That's it. If you can't build abstractions on top of that, you really shouldn't be programming in the first place.

>the moment rust has proper QT bindings
better
QT should be re-coded in Rust rather than put bindings on a gui framework that is coded in C++

>or even a native library.
this requires the operating system to be redesigned to use Rust natively

>i will switch to it exclusively.

what is ffi

Foreign function interface, e.g. calling code written in C from Rust and vice versa.

does rust compile into native assembly or does it use some byte-code virtual machine bullshit

Native assembly via LLVM.

Now that abort on panic is implemented one of the major obstacles is gone.

I'm still annoyed that there's no way to tell Rust that you're writing single threaded code so global variables are safe.

>2016

Still using programming to get computers to do things, only /g

I just use Facebook

My nigga

>LLVM IR
At least that's vaguely portable.

LLVM is a meme

>Rust is a bigger failure than you ever thought it would, Stevey-pie.
>Remember like a year ago when I told you that Rust was on its way downhill if ANSI standardization wasn't pursued?
>Crazy how I'm always right, and how anti-capitalist deviant weirdos like you are always wrong.
>Mozilla is going down as well. Give it another year or two, Firefox will crumble, funding will dry up, they'll probably want to hang on to "earners" like you that will work for nothing because they don't know any better but big corps will probably pick up some of the more sane talent in the meantime.
>Things we've learned from Rust will either be used to make gcc better, or create a new systems language that people actually want to use, that is S T A N D A R D I Z E D, and developed by a more ethical group of people.
>Adios, maricón

What ever happened to standardization for languages. I can think of only a couple that have one.

manishearth.github.io/blog/2016/08/18/gc-support-in-rust-api-design/