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

Will C/C++ ever Rust away?

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: 182
Thread images: 22

File: 1492044643301.jpg (307KB, 1500x2000px) Image search: [Google]
1492044643301.jpg
307KB, 1500x2000px
Since the 1970’s C (and later its derivatives like C++) have become the main programming languages used in systems and platform programming, but is that about to change?

C/C++ came to dominate over other languages because it exceeds the 80/20 rule; with well written C/C++ you can get well over 80% of the efficiency of hand crafted assembly language in less than 20% of the development time. However every C/C++ programmer has seen their ‘perfectly’ crafted and tested program crash at the most embarrassing time possible, due to some unexpected issue in memory allocation or mishandling of a pointer.

So is there an alternative that can reduce this? An alternative that might relegate C/C++ to very limited areas of the industry, in the same way as we see assembly language used today? We have seen many new languages pass by without really displacing C/C++ as the systems programming language, but is it possible that Rust might be the real giant killer?
>>
ctd
Before trying to answer this question we need to understand a little of what the Rust programming language actually is.

Rust is designed to be a ‘safe, concurrent, practical language’ and it is supported by an open (and friendly) community. Rust is sponsored by Mozilla Research, so it has a strong backer and it is unlikely to disappear through lack of support. We at Cambridge Consultants have been working with Rust for a little while, and indeed my colleague Jonathan Pallant gave a positive talk on it in October of last year.

The initial Rust development started back in 2009, with the first stable release appearing in 2015, and a number of updates are released each year. Rust provides a number of high level constructs found in many scripting languages, but it is statically typed and compiled so it can execute as fast as any native language.

As a programmer, who sometimes still uses assembly code to get that extra speed, I have to admit that I was sceptical; you simply can’t use a ‘safe’ language in some areas of system programming. However when I started looking at Rust I found this language design philosophy was applied in a very practical way; what Rust means by ‘safe’ is that the default behaviour is the safe option, but still the programmer has the power to override this where it is necessary.
>>
A trivial example of this is that in C/C++ all variables are mutable by default and you add the const keyword to make them immutable; in Rust all variables are immutable, and you add the mut keyword to make them mutable. The C/C++ programmer in me says that’s a lot more typing, but actually it’s just a small example of a different, safer mind set which you find in the Rust language design. This goes on to having a language keyword – ‘unsafe’; which tells the compiler to release some restrictions in that specific block of code. This keyword also flags areas of the program which need to be checked in more detail during code review and testing; something which is normally achieved by comments in C/C++.

Another area where Rust is helpful is that it handles underlying memory allocation and release of objects, and ensures this is done in a safe consistent way. Again, when I originally saw this I was sceptical, since most languages do this with garbage collectors which cause issues in real time systems. Rust is designed to use reference counting and scoping to implement this in the same way as we would in C/C++. However because it’s part of the language, the compiler can check and catch a number of issues at compile time, rather than finding them from the core dump.

In such a few words I can only start to scratch the surface of the language, and I haven’t even started to describe the infrastructure (such as the package manager Cargo), but I hope I’m sharing a little of the exciting possibilities that this new language might open up.
>>
The Rust language looks like it has a good design, based on looking at the real work of system programmers, and then providing a set of tools in the language to implement code in a safe way. Rust has passed the first hurdle of being able to build its own compiler, and there is work on using Rust on embedded devices, which is starting to show an interesting potential.

However these are very early days, and Rust has a way to go. For example, the ability of Rust to be used to write an operating system or a complex application for the smallest of devices currently supported by C, is yet to be proven. It’s only when Rust is used in anger in such applications that we can truly understand both the full extent of its potential, and its limitations.

Having watched the rise of C/C++, it seems to me that Rust is currently in the position that C was in during the early 1980’s. At that stage the only ‘specification’ available was ‘The C Programming Language’ by Brian Kernighan and Dennis Ritchie, which had been published in 1978. While C was widely used, the formal industry acceptance was only confirmed by the publication of the C89 standard, more than a decade after that first informal specification.
>>
>this meme thread again
>>
I like Java.
>>
>>59881743
Java is useful for android development
>>
>>59883319
There's Java embedded as well.
>>
The world needs easy to use concurrent languages. Rust provides none of them.
>>
>>59884009
Yes you are wrong
https://doc.rust-lang.org/book/concurrency.html
>>
You really just wrote this right now?
>>
>>59884044
I never said Rust didn't have concurrency support. Rust has poor concurrency support: no green threads and poor support for CSP. Those two are crucial nowadays.
>>
>every language that isnt C/C++ is implemented in C/C++

C/C++ arent going to be dying any time soon considering the fact that literally every other language is implemented in it
>>
>>59880205
Once you have a full Unix-compatible OS written entirely in Rust and it takes over the server and embedded devices markets and completely pushes the BSDs and Linux and OS X and iOS and everything else in the market written in C out, we can talk.

There's no "case" until then, you have to make the killer app and it's a Unix.
>>
>>59884405
>every language that isnt C/C++ is implemented in C/C++
Whoever you are quoting is a total computer illiterate
>>
>>59884595
Name one high level language that is not implemented at some level using C++/C
>>
>>59884614
1. C/C++ are high level languages themselves
2. Rust
>>
>>59884614
Point to me where Java uses C or C++
>>
>>59884628
All java virtual machines and bytecode compilers are implemented in C/C++ fool

>>59884619
The rust compiler is made in C/C++
>>
>>59884619
rust just uses llvm. which is C++

>>59884628
JVM
>>
1. The languages are called C and C++. They are two separate and distinct languages; please do not refer to them as C/C++. C++ is not even a proper superset of C, and with new releases of each language, they are growing far apart.

2. Default immutability is not a good thing.

3. C++ has been doing RAII long before Rust has. Don't go bragging about it like it's some unique language feature of Rust. It's a nice feature, but it isn't a point over C++.

>>59884580

They already have a Unix OS written in Rust called Redox. It hasn't taken over anything yet, since those markets are saturated. There isn't a reason to switch from Linux to anything else.

>>59884614

Pretty much every language not dependent on a virtual machine uses a self-hosted compiler. Haskell's compiler is written in Haskell and compiles to machine code. The same is true for Go, D, Ada, Rust...
>>
>>59884696
>>59884706
I said language, not compiler. Rust has a compiler written in OCaml as well. The RustC is written in Rust. LLVM has been forked by them.

By your logic C is written in C++, since both GCC and LLVM is written in C++, not C
>>
>>59884728
>move-the-finish-line posting

you never even said "language"
>>
>>59884728
>>59884741

The word used was "implementation", which can be interpreted as a compiler or interpreter/VM, depending on the language.
>>
>>59884741
How does it feel to prove yourself retarded?
https://github.com/rust-lang/cargo/tree/master/src/cargo/core
https://github.com/rust-lang/rust/tree/master/src

https://github.com/rust-lang/rust/tree/master/src/librustc
>>
>>59884759
>C is implemented in C++
Good to know

https://github.com/rust-lang/rust/tree/master/src/rustc
>>
>>59884762
>implement rust binding to llvm
>write the rest in rust, interfacing with the rust/wrapped C++
yea dude
>>
>>59884786
Rust compiles to LLVM IR. LLVM is written in C++, Not the Rust language.

And as I said before, Rust has an OCaml compiler too, does it mean Rust is ""implemented"" in OCaml and C++?
>>
>>59880205

C will not be replaced until Unix and all its derivatives are replaced. The OS and the language reinforce each other. All Unix system calls are defined in C, so systems programming necessitates knowing C. This means C is the common language of all systems programmers, so it is socially easiest for any project with more than half a dozen developers.

>>59884405

This is a stupid meme that means as much as pointing out how the original C compilers were written in assembly.

Yes these languages were originally written in C, but all serious languages eventually write a self-hosting compiler.
>>
File: 1463049351362.png (39KB, 1021x492px) Image search: [Google]
1463049351362.png
39KB, 1021x492px
>le every language is """"implemented"""" in C(ancer)(++)

Is this the latest meme?
>>
>>59884818
offended rust shiller
>>
p... please use rust!!!
>>
File: 1485110373241.png (8KB, 507x104px) Image search: [Google]
1485110373241.png
8KB, 507x104px
>>59884824
>get rekt
>"offended rust shiller"
You need to get better at this
>>
>>59884831
you realize that the language shown on the repo listing is just the most-used and does not show the actual percentages. which show that they are just java/rust rapped C or C++.
You really think a Java VM just runs on another Java VM and so on forever?
>>
>>59884840
That's JDK, not JVM
>>
>>59884831
>java standard library made in java
nice one dude
Every context that runs your javacode is on a C++ made VM.
Beyond the VM java is just syntax and bytecode specifications

http://hg.openjdk.java.net/jdk7/jdk7/hotspot/file/tip/src/share/vm/prims/jvm.cpp
>>
>>59884852
>>59884851
>>
>>59884804
>but all serious languages eventually write a self-hosting compiler.
Why? C is implemented in C++. What's wrong with it?
>>
>>59884854
what do you think the C++ standard library is made in. Assembly?
Of course a java library is made in java.
Java itself is implemented and actualized in C or C++ based software
>>
show me one high level language that is totally untouched by C or C++
>>
>>59884873
Haskell, Rust, Ada, Ocaml, Idris, Pascal and the list goes on
>>
Rust is nice, but when is this grand exodus going to happen? Also, what's wrong with C? It's a damn fine language even after all this time.
>>
>>59884885
C is stagnant, too small and does not address memory safety
>>
File: chrome_2017-04-14_02-08-15.png (12KB, 1472x95px) Image search: [Google]
chrome_2017-04-14_02-08-15.png
12KB, 1472x95px
>>59884879
None of these languages are untouched by C++ or C

Rust has so much C and C++ in its implementations and so do Haskell and ada and so forth

most of which drag in C/C++ libraries and just wrap over them the rest of the way.

try again
>>
>>59884879
>Haskell
>Untouched by C or C++
https://en.wikipedia.org/wiki/Glasgow_Haskell_Compiler
>>
>>59884900
That's a compiler, not a language. Are you dense?
>>
>>59884879
>OCaml
>Untouched by C or C++
https://en.wikipedia.org/wiki/OCaml
>>
>>59884892
Rust's /src has nothing written in C
>>
>>59884892
>Ada
>Untouched by C or C++
https://en.wikipedia.org/wiki/Ada_(programming_language)
>>
>>59884908
kek the desperation
>>
>>59884914
>>59884917
>>
>>59884908
Even the haskell standard definition mentions C, even if it's pretty well contained.
>>
>>59884921
What desperation?
https://github.com/rust-lang/rust/tree/master/src
>>
There is not one language that has not has its virginity taken by C or C++ within its core implementation.

Except BrainFuck.
>>
>>59884889
>stagnant
C is not water.

C is stone.
>>
>>59884936
Compiler is not the same as the language. You can write any compiler in any language
>>
>>59884937
C is cancer
>>
>Pretty much every leading implementation of today's high level programming languages are made in C and/or C++

>Hipsters using these languages feel so betrayed that they resort to "RIGGED" desperation such as >>59884940 >>59884908

>The rust evangelism strike force loses its ringer
>>
File: poopoopeepee.jpg (13KB, 275x183px) Image search: [Google]
poopoopeepee.jpg
13KB, 275x183px
P-PLEASE USE RUST
>>
>>59884940
yeah, they're not the same, but the language doesn't do shit without an implementation you dumb fuck
>>
>>59884952
I accept your defeat, anon
>>
File: 1485202181749.jpg (56KB, 700x700px) Image search: [Google]
1485202181749.jpg
56KB, 700x700px
ITS NOT FAIR

C/C++ BULLS FUCK OFF
>>
>>59884958
Again, you can write any compiler for any fucking language in any fucking language. Language is not the same as the compiler you fucking dipshit
>>
>>59884962
You have to be 18 to post here
>>
>>59884969
>implements python in jython
>java vm is C++

>implements brainfuck interpreter in python
>cython uses C
>uses jython
>java vm uses C and C++

>implement javascript in ruby
>ruby VM and compiler in C

>implement brainfuck interpreter in rust
>rust compiler involves C code and C++ LLVM
>>
>>59884969
Well a language can be defined without ever writing a line of code. This discussion is meaningless if we're not discussing implementation.
>>
>>59884969
tell me you retarded cunt

how are you supposed to run a language you don't have a compiler for?
>>
File: 7CsOm.jpg (95KB, 782x1022px) Image search: [Google]
7CsOm.jpg
95KB, 782x1022px
>>59884978
THERE IS NO ESCAPE FROM THE C
>>
File: 1477336907923.jpg (147KB, 2038x1505px) Image search: [Google]
1477336907923.jpg
147KB, 2038x1505px
>C.ucks getting BTFO
Everytime
>>
File: 4323546.gif (839KB, 450x402px) Image search: [Google]
4323546.gif
839KB, 450x402px
>>59884978
H-HOW DO I ESCAPE C

WHAT LANGUAGE IS PURE
>>
>>59884983
Languages are not executable you computer illiterate fucktard. How can you run a language?
>>
>>59884983
Rust has multiple compilers
>>
>>59884999
all of which have had their virginity taken by C and/or C++
>>
>>59884978
What if I write C compiler in B?
>>
>>59884999
Rust has no compilers. It piggybacks on LLVM.
>>
>>59885007
And?
>>
File: BLACKED.png (160KB, 350x350px) Image search: [Google]
BLACKED.png
160KB, 350x350px
THERE IS NO ESCAPE FROM C OR C++
>>
>>59885012
Rust has no compilers? What is LLVM?
>>
>>59884994
don't avoid the question you stupid fuck

and you're calling sb illiterate but you can't understand that running a language means running code written in that language.

>>59884999
oh, so bootstrapping's the answer? nice. What language did you use to run the bootstrap? come on, say it out loud.
>>
>>59885022
R U S T
U
S
T
>>
>>59885020
http://lmgtfy.com/?q=llvm
>>
>>59885022
>Codes "run"
Codes are not executable you toddler. Codes are compiled into machine codes. It's called a compiler. Fuck off, why are you here?
>>
>>59885020
LLVM uses Clang and GCC for compilation. Rust only 'compiles' to LLVM IR.
>>
>>59885042
LLVM does not use GCC.
>>
File: Mv495.png (284KB, 1008x1341px) Image search: [Google]
Mv495.png
284KB, 1008x1341px
>>59885042
#NOTMYCOMPILER
>>
>>59885042
Clang uses LLVM for compilation, not the other way around, dumbass
>>
>>59885042
>LLVM uses Clang and GCC for compilation. Rust only 'compiles' to LLVM IR.
That's just plain wrong
GCC and LLVM don't have any direct interaction.
And Clang uses LLVM to compile (it's the C frontend for llvm) not the other way around.
>>
>>59880205
C/C++ isn't a language.
C is a language.
C++ is a language.
Their syntax is similar, but they are not the same language.
The problems with one language is usually not the same for the other.
Change takes time.
You don't see big projects change the programming language, because that is a lot of work, usually for no reason.
Changing from one api to another is a huge ordeal, stuff like upgrading major version on a dependency is really painful.
Best case, you will get some new projects to use a new language.

But change is painful, nobody wants to do it and it is always possible to have bugs in an application.
>>
>>59885047
>>59885017
>>59884992
>>59884984
>>59884962
How old are you? Honest question.
>>
>>59885042
Your typical C toddler
>>
>>59885039
don't make yourself look more like an idiot by trying to correct my terrible grammer, I know that you stupif dumbass. Also, there is no fucking difference if the code's compiled when we're talking about what to implement the compiler for the language in

also, asnswer the fucking question >>59884983 nce and for all

>>59885029
>>59885056
>>59885043
https://en.wikipedia.org/wiki/Bootstrapping_(compilers)
>llvm is written in C/C++
>llvm has to be compiled to be used
>>
>this thread

C is a disservice to intelligent programmers. It has almost 0 features that a modern and intelligent programmer uses to be productive. Since C is such a timesink, it's popularity is falling more than any other languages in the market.
C is dying and it should die ASAP. C programmers are actually retards in general. C is a small language to grasp, exactly the kind of shit that makes things retard friendly.
C has no advanced features like C++ does.

But as a newfag you are kinda in the right direction. C is for newbies. Think of it this way:
During ancient times, counting to 10 was a big deal and a person who could count to 10 was considered to be "wise".

Fast forward a few century counting to 10 is so trivial we teach this to toddlers. Now toddlers appreciate the vast "knowledge" of counting to 10 while matured brains are busy with modern technologies.

C is from stone age and the people who still preach it is like overgrown toddlers that can't learn advanced things.
C doesn't have delegates
C doesn't have resizable arrays
C doesn't have strings
C doesn't have string concatenation
C doesn't have namespaces
C doesn't have exception handling
C doesn't have closures in the standard
C doesn't have unit tests
C doesn't have Function overloading
C doesn't have memory safety of any kind
C doesn't prevent memory exploits and has no bounds and runtime checks
C doesn't have dynamic method loading/creatin
C doesn't even have generics and templates
C doesn't have meta programming
C doesn't have mixins
C doesn't have higher order functions
C doesn't have contract programming
C doesn't have inner classes
C doesn't have function literals
C doesn't have array slicing
C has a very limited support for implicit parallelism
C doesn't even have string switches

C is a cancer that plagues the modern software industry. If you want guaranteed memory exploits and security vulnerabilities in your program with timesink development period then use Assembly, not C.
>>
>>59885082
Are you having a mental breakdown, C tard?
>>
>>59885086
Ayy C toddlers rekt
>>
wtf i hate c now
>>
>>59885050
Whoops, you're right. The Rust compiler generates LLVM IR for LLVM to compile. Clang is just another front end.
My point still stands: Rust still has to piggyback on LLVM.
>>
>>59885086
Excuse me, I have a question


How will C(ucks) ever recover?
>>
>hello world in rust takes 11 megabytes

DROPPED
>>
>>59885109
>Rust still has to piggyback on LLVM.
What do you mean, re tard C tard?
>>
>>59885128
>>59885128
>doesnt know what the LLVM is
>calls another a retard in the same sentence
>>
>>59885126
>C toddler doesn't know what static linking means
Clockwork. I always knew C is for retards
>>
>>59885128
Rust only supports LLVM. I don't like such dependency.
>>
>>59885133
Yeah, LLVM is a compiler. RustC uses LLVM. What's your issue here? C tard?
>>
>>59885145
>LLVM is a compiler
kek
>>
>>59885094
no I'm just drunk

>>59885086
nice bait
>point out things C doesn't have
>recommend asm
kek

>>59885128
it means Rust doesn't translate itself to machine code, it uses llvm to get there

>>59885135
>static linking
>not using dy(n)libs

>>59885145
>llvm
>compiler
KEK
>>
File: 1463711941015.jpg (56KB, 300x360px) Image search: [Google]
1463711941015.jpg
56KB, 300x360px
>>59885086
>Write a C program
>People laugh at me every time a new exploit is found in the github
>can't refactor because C is garbage
>mfw
>>
>>59885145
what is LLVM made in

SAY IT OUT LOUD

S P E L L I T O U T

your rust """compiler""" is just a front-end for another C++ software to do the actual dirty work

its no better than .net shit that all "compiles" into the same bytecode
>>
File: 1464994481528.jpg (233KB, 503x662px) Image search: [Google]
1464994481528.jpg
233KB, 503x662px
>>59885086
>>
>>59885165
C++, C is also implemented in C++. What's your point, autistic C toddler?
>>
>>59885162
>exploits
>found on github
at least you're making me laugh
>>
File: 1473433985584.jpg (106KB, 593x578px) Image search: [Google]
1473433985584.jpg
106KB, 593x578px
>>59885086
C tards BTFO
>>
>>59884992
Lambda calculus
>>
>>59885189
>C implemented in C++
my sides
>>
File: 1465151157570.jpg (5KB, 205x246px) Image search: [Google]
1465151157570.jpg
5KB, 205x246px
>>59885193
>mfw I can only know exploits from people yelling at me on github because C compilers never gave me any warning
>>
>>59885207
Yeah. According to your "logic", C compilers (GCC and Clang/LLVM) are written in C++. So C is now "implemented" in C++.
>>
>>59885086
>2017
>Still falling for the C(ommunism) meme
C is a poorfags' marxist language
>>
File: 1476139711293.jpg (56KB, 945x482px) Image search: [Google]
1476139711293.jpg
56KB, 945x482px
Who uses C anymore, let it die quietly. Good riddance.
>>
http://esr.ibiblio.org/?p=7294
http://esr.ibiblio.org/?p=7303
>>
>>59885086
> C doesn't have delegates
Whats the difference to function pointers?
> C doesn't have resizable arrays
> C doesn't have strings
> C doesn't have string concatenation
Interdependant and a library feature, no language support required (ever seen strcat?)
> C doesn't have exception handling
In the are where C makes sense, no exceptions is actually good.
> C doesn't have Function overloading
This is what gives us the actual usable FFI interface. Since all overloads require the weird JNI way to search for functions in the runtime, or the C++-ish name mangling.
> C doesn't have dynamic method loading/creatin
That one is actually done by the linker/efi loader
> C doesn't even have generics and templates
C11 has, but they are horrible
> C doesn't have higher order functions
kinda has with function pointers, but no closures makes it very limited
> C doesn't have inner classes
Forward declared opaque structs?
> C doesn't have array slicing
C doesn't have a well defined array in the standard, so no shit.
If you wrap a pointer + length, slicing is the easiest thing to do

> C doesn't even have string switches
"even" you do realize, that that's a rather nontrivial feature?
Do we want to hash? do linear compares? Can we switch on just the first char?
Most of the time some domain knowledge will let you do things on par/better than the compiler.
>>
File: 1477518642597.jpg (78KB, 340x314px) Image search: [Google]
1477518642597.jpg
78KB, 340x314px
>>59885245
>that damage control
Sad

Come back when C has strings
>>
>>59885244
Anonymous on 2017-01-13 at 18:55:45 said:

Rust is definitely in the rapid-expansion phase (for relative definitions of rapid); the notion of general blessings of which crates are best suited for which tasks is one that is on many people’s minds (and crates.io is working on a means of showing this), but the Rust ecosystem isn’t yet at a point where that’s the case for a large number of crates. There are a handful of cases, like regex and serde, but the most prominent case at this particular moment, tokio, is nowhere near ready to commit to being the lingua franca of Rust’s async story.

Rust’s team is also specifically *not* aggregating such crates into the standard library, since that freezes them far more than does saying “these are the community-recommended crates for these purposes”. The community-standard crates will eventually become a stable tier below the standard library, but for now everything’s still growing.

Which is exciting, if you’re in a position not to be put off by that, but definitely off-putting if you’re in a position where stability is more necessary.
>>
>>59885206
that's a notation method orientated for computable functions. the closest language implementation there is to it is Lisp

>>59885211
name three exploits you could cause in C and if they're not just overflowing/memracking you have a point. Otherwise, your C is shit.

>>59885219
1. LLVM isn't a compiler
2. LLVM is written in both C and C++
3. gcc is written in C and there even might be parts in asm
4. I wasn't the one that said that, I'm just laughing my ass off at you twelve years old talking about this fantasy language of yours
>>
>>59885264
Both GCC and Clang are written in C++, idiot
>>
>>59885252
what's a string if not a sequence of bytes? Why represent it as anything else when that takes additional memory?
>>
File: 1491106502199.png (315KB, 1876x559px) Image search: [Google]
1491106502199.png
315KB, 1876x559px
>>59885264
ayy lel
http://seclists.org/oss-sec/2017/q1/503
>>
>>59885278
>what's a string if not a sequence of bytes?
Did I say otherwise? Where is my string type?
>>
>>59885264
>3. gcc is written in C and there even might be parts in asm
Not true anymore, they switched to c++ a while ago. Even for the C compiler bits.

>>59885252
Nice argument you got there about all the other plain wrong things you listed.

The standard library in C is way to minimal (doesn't define threading/nice arrays/a few other things) but all those are easy to import if you really need them.
>>
>>59885284
do you understand what a security exploit (((in your program))) is?

>>59885272
>>59885291
last time I compiled gcc myself it was written in C. I guess it's not 2006 anymore.

>>59885291
>muh types
>>
>>59885086
>c doesn't have delegates
it has function pointers
>c doesn't have resizable arrays
it does if you create one with malloc()
>c doesn't have strings
it does if you create one with malloc()
>c doeesn't have string concatenation
you can create a string_concat vararg function for said type
>c doesn't have namespaces
you can prefix everything yourself
>c doesn't have exception hanlding
you return a nonzero integer
>no closures
who cares
>unit tests
I genuinely don't care
>function overloading
just call your function something else
it's a non-feature
>no memory safety
true
>no bounds checks
true
>dynamic method loading/creatin
???
>generics or templates
actually it does through macros
>metaprogramming
good riddance
>mixins
i really, really don't care
>higher order functions
you can write higher order functions
>contract programming
this has to be a joke
>inner classes
?
>function literals
it's just syntactic sugar
>array slicing
in what context?
>C has a very limited support for implicit parallelism
as opposed to what?
>C doesn't even have string switches
you never need string switches in practice
>>
>>59885307
>last time I compiled gcc myself it was written in C. I guess it's not 2006 anymore.
I know you don't do any programming. It was obvious.
>>
>>59885291
 struct string { char *storage; }; 


>>59885278
These days the bytes version is actually quite bad, you want something that can properly handle unicode glyphs.
Which is annoying.
>>
>130 replies
>20 posters
>most of the posts are rust shills
Really makes you think.
>>
>>59885316
>i really, really don't care
Classic sour grapes
>>
>>59884254
>CSP
>crucial
fuck off
>>
>>59885324
you can do that as well, but you'd need an array of shorts

>>59885318
that doesn't have any logic, lol. I just don't compile gcc since 2006 because there's no reason to. Why would I do so in this day and age?
>>
>>59885333
>he refutes your whole post
>take one point out of that whole post and strawman him with it
Classic rust shill
>>
>>59885284
A
FUCKING
DOUBLE-FREE

C programming should be completely outlawed
>>
>>59885333
>caring about mixins
>forgetting you can install libraries
>>
>>59885352
What else should a kernel be written in?
>>
>>59885361
Rust or ADA
>>
>>59885361
assembler. Which is basically non-portable, processor dependant C.
>>
>>59885344
>you can do that as well, but you'd need an array of shorts
Acutally 3 byte (will be padded to 4) these days.
Microsoft ran into a brick wall where their utf-16 version couldn't do everything anymore, so the current UCS-2 (iirc) is kinda multibyte aswell (2 or 4).
>>
>>59885367
>Rust
>kernel takes up 7 GB
No thanks.
>>
File: 1461861988209.png (100KB, 551x1380px) Image search: [Google]
1461861988209.png
100KB, 551x1380px
I would personally love to use a FLOSS operating system written in safer languages like Rust.
>>
>>59885391
Educate yourself
https://en.wikipedia.org/wiki/Static_build
>>
>>59885361
Common Lisp
>>
>>59885388
yeah, you're right, forgot we were at four already. Although it's all emojis anyway lmao

>>59885405
nice meme
>>
>>59885423
>3 minutes
>no replies
off to sleep I go
>>
>>59885405
haskell is superior to lisp
>>
>>59884614
>lisp
>smalltalk
>>
>>59885471
Lisp is more practical IMO.
>>
>yfw rust shills are posting their bullshit in a web browser made in C++, running on an OS made in C
my sides
kill yourselves fags
>>
No, because everyone learns C and C++ in CS.
Nobody actually uses Rust outside of few projects.
Rewriting things in Rust will cost a shitload of money and you need developers that can write Rust and a lot of time.
You can write much safer C code but most projects like the Linux kernel is expanding at such high rate that there are bugs coming faster than they can fix them.
https://matt.sh/howto-c
http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf
>>
>>59885544
It also uses JS and Python. What's your point?
>>
>>59884892
Pascal is pure~
>>
>>59885126
Try it in NodeJS or Electron and you'll wish you only had 11mb of shit linked in...
>>
Programmers are always anti-progress. I've spent 20 years mastering bytes manipulations and you can't? haha what a fag you should sit down, learn it and SUFFER like I did
>>
>>59886557
>Programmers are always anti-progress.
Times have changed.
>>
Go has a better shot at beating out C/C++ than Rust.
Go's garbage collection makes it slower, sure, but atleast it offers safe pointers.
Rust would never be able to offer safe pointers unless it also takes up garbage collection.
So all the benefits of Rust as a language end up being used in unsafe code blocks, which is really questionable. I don't know if speed is really enough to justify it.
Why not just right your normal code in Java (where it is also OOP) and when you need low level stuff like pointers, use C?
>>
>>59887902

Go's garbage collection disqualifies it as a viable alternative. You cannot use a garbage collector in a kernel.
>>
>>59884985
where is the evidence? Literally every argument put forth has been shot down, C and C++ are everywhere, there isn't one solid convincing piece of proof in this entire thread stating otherwise
>>
>>59888760
Theoretically you are wrong
Practically, yes you are correct
>>
>>59887902
> Rust would never be able to offer safe pointers unless it also takes up garbage collection.
So you don't know Rust, yet you have an opinion on it, I see.
>>
>>59889003
I know Rust 100% senpai, shit lang
>>
>>59889020
So you must know Rust offers safe pointers aka references without garbage collection.
>>
C will be the fastest non-assembly language for a long time, since all the low-hanging, most mid-hanging and many high-hanging optimization fruits have been already picked by compilers like gcc or clang.
Lack of memory safety argument is weak, because C has hundreds of external tools for static and run-time analysis, like valgrind, or stack canaries, heap canaries added by compilers and so on. which make it quite safe. Yes, Rust has such features internally, which means they are mandatory by default and take up cpu cycles. External tools for C are always optional (but any sane project should use them). However using an external tool in most cases does not slow down your production code, which can be without debug symbols, instrumentation, etc.
>>
File: 1492094982786.png (499KB, 944x720px) Image search: [Google]
1492094982786.png
499KB, 944x720px
>muh buffer overflow
You should always check user input and manually terminate it after x bytes.

>muh features
Syntactic sugar. You should collect a series of functions that implement the features you want in the same way your .bashrc file becomes more useful over the years.

>muh huge program is hard to maintain
You aren't following the unix way.
>>
>>59889472
>Muh checking user inputs
C actively prevents you from doing that since it does not have any unit tests

>Muh syntactic sugars
Syntactic sugars are not a bad thing, it's the only reason people use C instead of ASM

>Muh Unix way
No one follows the Unix way, it's 2017
>>
File: golang.sh-600x600.png (53KB, 600x600px) Image search: [Google]
golang.sh-600x600.png
53KB, 600x600px
Soon
>>
File: leafman.jpg (56KB, 750x563px) Image search: [Google]
leafman.jpg
56KB, 750x563px
>>59890933
>No one follows the Unix way, it's 2017
>>
>>59891750
Name 3 software that follows unix philosophy
>>
>>59880205
Keep your shitty click bait "journalism" blog posts to your self.
>>
>>59892130
You can fuck right off my thread if yo don't like it
>>
>>59892058
plan 9 echo, more, sed without extensions
>>
>>59892330
Nice 2017 software there. Do you have trouble having a coherent conversation?
>>
>>59890933
>No one follows the Unix way, it's 2017
But is that a good thing or a bad thing?
>>
>>59892649
It's a good thing, Unix way is a dead end.
>>
>>59892502
They are all used in 2017 by servers and research OSes.
>>
>>59889076
References aren't good enough for a low level language. You need raw pointers, which are unsafe.
Go has safe raw pointers.
>>
>>59880213
>supported by an open (and friendly)
Fuck off SJW
>>
>>59893377
what is a """""raw pointer""""", gotard?
>>
>>59893808
https://doc.rust-lang.org/book/raw-pointers.html
Thread posts: 182
Thread images: 22


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