[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Can Rust replace the C programming language for things like

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 79
Thread images: 4

Can Rust replace the C programming language for things like kernels, microcontroller etc.?
If not, why?
>>
Can it? Probably
Will it? No way
>>
>>56133107
It can, but it won't.
>>
It can, it likely will in some niches, unlikely in anything big or popular.
>>
File: oxml.png (3KB, 151x64px)
oxml.png
3KB, 151x64px
>>56133107
Can o:XML replace the C programming language for things like kernels, microcontroller etc.?
If not, why?
>>
>>56133550
what is this
>>
>>56133107
>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.
>>
>>56133107
>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.
>>
>>56133699
>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.
>>
File: 1456792752488.png (531KB, 2992x2992px) Image search: [Google]
1456792752488.png
531KB, 2992x2992px
>>56133699
>>
>>56133107
No.unwrap().way.unrwrap().will.unrwrap().it.unwrap().ever.unwrap()
>>
>>56133699
nigger do you even know a single thing about Rust?
>>
>>56133107
does rust have gui libraries
does rust have networking libraries
if so, sign me up
>>
>>56133879
can somebody answer this?
>>
rust will become abandonware and oxidize which is quite ironic
>>
>>56133879
>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?
>>
>>56133107
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.
>>
>>56133879
>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.

>>56134041
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.
>>
>>56133107
No until the autists die out and use something else other than C
>>
>>56133699
>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
>>
>>56134041
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.
>>
>>56135875
>Assembly
>Crossplatform

gr8 b8 m8
>>
>>56136573
ಠ_ಠ
>>
>>56133107
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.
>>
>>56137513
>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?
>>
>>56137780
ask redox
>>
>>56137780
Operating systems have been written in lots of languages besides C, youre just a basement dweller who believes everything you read on /dpt/
>>
>>56137855
Not one of them was successful
>>
>>56133107
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.
>>
>>56137890
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
>>
>>56133107
Probably eventually. It'll take a long time though.
>>
>>56133107
Rust's more of a replacement for C++ than C.
>>
>>56134431
>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.
>>
>>56137513
>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.
>>
>>56133107
Nothing will EVER replace C.
>>
>>56133605
You can write an operating system in virtually every language, a single proof of concept does not mean it's a *good* replacement
>>
>>56133107
>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.
>>
>>56136573
You know that rust does not have a GC ?
>>
I really like this thread. Can a clever man give a real good explanation ?
>>
>>56136573
Thanks ''''''''Henry'''''''
>>
>>56134041
There is: https://github.com/redox-os/ralloc
>>
>>56137915
Is rust multiparadigm? I thought it was mainly procedural.
Are traits making rust oo or just interface oriented?
>>
File: reimuwhat.png (412KB, 600x500px)
reimuwhat.png
412KB, 600x500px
>>56135875
s/Assembly/LLVM IR
>>
>>56140195
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.
>>
>>56133850
operator ? is almost finished iirc

>>56136573
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?
>>
>>56141316
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: https://servo.org/

That you're able to write an OS in it is just a consequence of it's manual memory management capabilities.
>>
>>56141728
*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?
>>
>>56141316
Google != Mozilla
>>
>>56141179
>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.
>>
>>56133107

>>56139635
>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.

>>56141793
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.
>>
>>56139635

With libcore, 2K of RAM in Rust is do-able.
>>
>>56133699
http://pastebin.com/UAQaWuWG
>>
>>56141728
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.
>>
>>56143475
>Judging a language by how many OSes are written in it
Weak bait

Also, is there a kernel that's written in pure C++?
>>
>>56133107
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.
>>
>>56143674
There's Haiku, isn't there?
>>
>>56133107
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.
>>
>>56145252
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.
>>
>>56141793
>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.
>>
>>56145510
what is ffi
>>
>>56145772
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
>>
>>56145821
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
>>
>>56146443
I just use Facebook
>>
>>56146650
My nigga
>>
>>56140220
>LLVM IR
At least that's vaguely portable.
>>
>>56145832
>>56147567
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
>>
>>56147904
What ever happened to standardization for languages. I can think of only a couple that have one.
>>
http://manishearth.github.io/blog/2016/08/18/gc-support-in-rust-api-design/
Thread posts: 79
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.