[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]

If you rustfags want to replace C so hard, then why havem't

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: 30
Thread images: 3

File: rust.png (56KB, 1200x1200px) Image search: [Google]
rust.png
56KB, 1200x1200px
If you rustfags want to replace C so hard, then why havem't you written a compiler from binary yet?
>>
File: 1485751467489.png (119KB, 420x420px) Image search: [Google]
1485751467489.png
119KB, 420x420px
>this is what C-ucks consider decent b8
>>
>>59342428

desu we just want the world to be a little memory-safer than we left it.

MEMORY
E
M
O
R
Y
>>
>>59342757

> Memory-safer by destroying everything else and rebuilding all over again from scratch because muuh static analysis XDDD

kys
>>
>>59342757
Serious question though,

If it's all about compile time analysis, why not just improve the C compiler or something?

Is there some fundamental technical challenge to this? I mean, maybe there could be some optional (for backwards compatibility) keywords to add so we can get the same thing.

I don't really know C++, but I've seen some people talking about atomic or something. Why can't C have a compile time thing like that?
>>
>>59342428
Need a bigger b8, C toddler. Fuck off.
>>
>>59345404
>If it's all about compile time analysis
It's not. Does C even have lifetimes and borrow system?
>>
File: 1454259991251.gif (2MB, 588x470px) Image search: [Google]
1454259991251.gif
2MB, 588x470px
>>59342428
>>59345404
>>59345437
WHAT IS SELF-HOSTING TOOLCHAIN

seriously what the fuck op google it
>>
>>59342757
Until you fuck up your compiler. This is why CHERI is being done. Please support that kinda shit for your compiler and in your compiler
>>
>>59345404
In a word, because that would no longer be C, so why not go the whole way and also improve the language without being tied to legacy bullshit? C says program X is valid. The analysis says program X SHOULDN'T be valid because it has bugs. Refusing the program would no longer be C. Accepting the program would change nothing over C.
>>
>>59347040
Cool, is this the script you used?
echo -e "WHAT IS\n$(cat /usr/share/dict/cracklib-small | awk "NR==$(echo $(echo $RANDOM \* $(wc -l /usr/share/dict/cracklib-small | awk '{ print $1; }') / 32767 | bc -l) | sed -e 's/\(.*\)\..*/\1/')" | tr '[:lower:]' '[:upper:]')\n\nseriously what the fuck op google it"
>>
>>59345404
>Is there some fundamental technical challenge to this? I mean, maybe there could be some optional (for backwards compatibility) keywords to add so we can get the same thing.
Backwards compatibility IS the whole challenge.

A "safer C dialect" already exists. It was called Cyclone. It tried very hard to be a drop-in C replacement, but it failed anyway. Nobody used it and its creators abandoned it. Please go ahead and repeat their mistakes if you think you're smarter than them.
>>
>>59349432
Cyclone was great, and it's a clear inspiration of Rust's, along with Ada.

But you're right, for all the shit people give the Rust compiler over how overly protective it is, it's much more suited to you understanding what the hell is going on than Cyclone ever was, and that's mostly because the language is designed around the idea of lifetimes and borrowing.

Ada's still pretty good these days, but it's missing quite a lot of features and can't do the fast low level shit that C can, unlike Rust.
>>
>>59349490
Also doesn't ada only support either manual memory management or GC?
>>
>>59349490
Ada is still able to express some things that Rust currently can't. Numeric dependent types might change this.

>>59349573
GC was always considered an optional feature, and none of the major implementations included it.
>>
>>59349573
Interesting, it seems to depend on the implementation. I'd would have guessed that this is something set in the standard and/or at language level, but according to SO that doesn't seem to be the case. Weird.

Then again, in case somebody uses Ada they probably know what they are doing, so the standard isn't the only line of defense.
>>
>>59349618
As far as I know the most recent version of the standard states the GC must be provided by the implementation but must not(?) be enabled by default.
>>
>>59349598
>Ada is still able to express some things that Rust currently can't.
Yep, and hopefully that won't last, but Ada has a suprisingly huge backing from the computer scientist community in addition to military applications (where it's slowly getting replaced by C++ from what I hear).

If all goes well, Rust can be an Ada that can also be a C if you need it to. But whatever happens it seems we live in times where memory safety (and safety in general) is a very real concern and people beyond state actors will want to run code that's provably safe.

I used to think that Haskell and other pure functional languages might see the light of day because of those security issues, but static analysis might be the way to go here.
>>
>>59349644
So, it's some inane feature that's going to be ignored, like in most C++ compilers?

Anyway, Adacore wanting to rake in mad cash with GNAT explains why GCC has an Ada compiler and LLVM has not, except for DragonEgg, which appears to be semi-dead.

How comes GCC has a frontend for FORTRAN?
>>
>>59349656
Haskell is a miracle of static analysis in its own way, but at the same time it has its own stupid problems. The default behavior of the language, ie. the stuff it falls back on when the optimizer fails, prevents it from ever being used where C is king.
>>
Anyone have any speed comparisons of rust vs c on 8 bit microcontrollers
>>
>>59349684
RMS and friends wanted to have a free compiler for most languages around really bad.

There just isn't the same demand for a new Ada compiler now.
>>
>>59349701
Does LLVM have backends for 8-bit microcontrollers? Last I checked, it didn't.
>>
>>59349720
there's compilers for 8 bit PIC and Atmel
>>
>>59349684
>>59349707
If your compiler doesn't pass certification, you're not legally allowed to use the name Ada.
>>
>>59349701
In practice, C and Asm just dominates the 8 bit mc game with tons of custom proprietary things in the way of a competitor.

I've looked around for benchmarks, but nobody seems to have dedicated the hardware and time to it.
>>
>>59349745
Yea I could not find anything.
The compiler is all that really matters right?
>>
>>59349800
Sadly no.
If you want to do things in a productive manner with those MCs, you either need to use the provided libs or the direct memory interfaces.

In practice you could probably use Rust's easy interfacing with C libraries, but I haven't tried it so there might be pitfalls unknown to me.

In theory, if you can produce a binary and read the documentation for your specific arch, you can do anything.
>>
>>59342428
Eat your own dog food. Write the compiler in the target language
>>
>>59349061
That's not a word, nigga, that's a short paragraph.
Thread posts: 30
Thread images: 3


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