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

/rust/

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: 166
Thread images: 21

File: fibonacci.png (28KB, 1096x724px) Image search: [Google]
fibonacci.png
28KB, 1096x724px
C is dead.
>>
>>61308282
How many numbers?
>>
File: Hooky_patrick.jpg (76KB, 400x300px) Image search: [Google]
Hooky_patrick.jpg
76KB, 400x300px
>>61308282
NO ITS NOT YOU FUCKIGN MOUTH BREATHER C IS ALWAYS KING YOUR STUPID IMAGE COULD BE 100% MADE UP FOR ALL WE KNOW, AND EVEN IF IT IS A COMPARISON OF 3 PROGRAMS THAT GENERATE FIBONACCI NUMBERS IT IS IMPOSSIBLE TO COMPARE CROSS LANGUAGE THE ONLY USEFUL THING YOU COULD DO IS TRY TO LOOK AT THE ASSEMBLY OF C AND RUST
>>
File: 1480008365960.jpg (63KB, 633x758px) Image search: [Google]
1480008365960.jpg
63KB, 633x758px
>finally learn C after /g/ convinced me it was the only relevant language to learn
>already deprecated
>>
1. how many
2. what algorithm
based on these 2 I can even make js the fastest.
>>
>>61308282
The funny thing with these benchmarks is it depends on implementation, so just wait until someone writes a better loop in C99 that has aliasing guarantees using the restrict keyword.
>>
Rust does that fancy type checking or whatever so its faster than C which doesn't IN THIS PARTICULAR BENCHMARK okay
>>
classic asm.js, constantly 2.5x slower than native C...
>>
>>61308494
no it isn't you fucking cock eating sperglord
>>
>>61308282
Cool, I was going to learn Rust any way.
>>
>>61308510
recursive for C
memoization for rust
rust is superior desu =^.^=
>>
>>61308282
A certain OO programming teacher I knew did demos where Java outperformed C, so this isn't very surprising.
There's always some small niche where you can do crazy shit.
>>
>>61308763
Java would never be faster than C unless you actively gimp C
>>
>>61308652
>recursive Fibonacci
Holy shit why?
People are taught this in school as the worst possible use of recursion.
>>
>>61308789
A lot of work went into Java to make the performance not suck as much, and if you know the tricks it does you can properly optimize.
>>
>>61308763
Except it's not the same thing at all with Rust. The very nature of Rust allows it to be a direct competitor to C in terms of performance. In fact, being faster than C is one of their goals.
>>
>>61308863
Rust was always targeted at C++
>>
>>61308763
>>61308844
Why are u so retarded ? How can u be this dumb? C is 1:1 translated to ASM without any overhead. If you did both implementations the same then C would blow java/rust/c++ twice fold.

Please stop using your brain. It's pulsing too much braindamage
>>
>>61308887
you seriously do not know what you're talking about
>>
>>61308887
>>61308887
>If you did both implementations the same then C would blow
>java
yes
>rust
not necessarily
>c++
not always
>>
File: .png (27KB, 634x622px) Image search: [Google]
.png
27KB, 634x622px
c,rust,every other shit ultimately completely BTFO
>>
>>61308887
First day on /g/? You don't know shit and it's so obvious that you're trying to fit in.
>>
>>61308887
> C is 1:1 translated to ASM
no, there's almost always some kind of optimization done. not even -O0 is 1:1 translated to ASM
> without any overhead.
there is always overhead, (e.g. _start )
>>
>>61308887
>C is 1:1 translated to ASM without any overhead.
This is the stupidest thing I have read all week. Congrats.
>>
>>61308973
No there isn't. Not if you use a proper compiler like Intel XE

>>61308988
Really? How is this statement false? Do you see any overhead when looking at C asm output? Now look at rust.
>>
>>61308988
Clearly you haven't been to the GPU threads.
>>
>>61308887
https://doc.rust-lang.org/1.8.0/book/inline-assembly.html
rust is as low-level as C you dumbfuck
>>
>>61309004
just because your mother did crack while being pregnant with you doesn't mean you should do crack too. you seriously fucked up your brain
>>
>>61308887
Do you even know what Rust is?
https://github.com/pravic/winapi-kmd-rs
>>
>>61309046
So having ability to do inline ASM is low level? How much to they pay you to shill this trash language?

>>61309061
No hate on me please, just because I can handle low level C instead of needing a compiler to check my mem moves/reads for me.
>>61309065
Yeah Rust is SJW garbage with "move semantics" "pattern matching" and other bloat overhead.
>>
>>61309121
Masks are off.
>>
>>61309121
Do you have PTSD from the night your mother dropped you?
>>
>>61308558
I doubt there would be a place where the compiler would have to account for aliased pointers in whatever fibonacci function they used.
>>
>>61309152
No but I have high enough IQ to be able to code in C without needing training wheels for something as trivial as software dev.
>>
It's always the same story with C manlets

>I'm SMARTER than the compiler, I don't NEED any help, all of you are just sux

It would be adorable if it isn't pathetic
>>
>>61309190
https://en.wikipedia.org/wiki/Dunning–Kruger_effect
>>
>>61309224
>>61309270
Nice projection
>>
Just learn Racket instead.
>>
>>61309289
yeah okay buddy
>>
>>61308494
>>61308571
>already deprecated
its been deprecated for YEARS, senpai
>>
>>61309270
Sorry but I've read entire Intel software dev/arch manuals + other 20 C books. You can't touch me with your SJW crap.
>>
>>61309311
>look at me I'm so smart I have to tell people how many books I've read to prove it
https://en.wikipedia.org/wiki/Dunning–Kruger_effect
>>
>>61309311
You're either a troll or a genuine idiot. Based on your performance here I'm leaning towards the latter.
>>
>>61308282
Post code
>>
>>61309332
No i'm just stating that instead of telling everyone else they are dumb you should accept reality and realize you have broken legs so you need to use wheelchair.

Is your brain incapable of saving variables/their lifetime in your mind? Do you really need compiler to do that for you? Seriously?
>>
>>61309311
You're mentally ill. Seek help.
>>
>>61308934

>using non-ascii characters in your source
>>
>>61309367
filtered
>>
>>61309358
qft
>>
Article from 2015 made by Node.JS developer

https://blog.risingstack.com/how-to-use-rust-with-node-when-performance-matters/
>>
>>61308652
>using different algorithms
yeah, the test was not biased at all

fuck off with that turd language
>>
>>61308282
How is your transition going?
>>
>>61309311
>Sorry but I've read entire Intel software dev/arch manuals + other 20 C books
and yet understood none of it. it's not even funny anymore, but really really sad
>>
Still waiting for that source code.
>>
>>61308494
iktfb
>>
File: ss-2017-07-11-00-57-18.png (37KB, 357x493px) Image search: [Google]
ss-2017-07-11-00-57-18.png
37KB, 357x493px
>>61308887
will C ever recover?
>>
>>61310990
Remind me, which language is the kernel you are running written in?
>>
>>61309190
>without needing training wheels
Bwahahahahahahahahahahaha
>>
>>61308887
>C is 1:1 translated to ASM without any overhead.
This is of course not true and hasn't been true for over 20 years.
>>
>>61311008
nice deflection faggot
>>
>>61311055
>deflection
Sure, I'll deflect, once you post the source code of those benchmarks.
>>
>>61311074
https://github.com/kostya/benchmarks/blob/master/matmul/matmul.c
https://github.com/kostya/benchmarks/blob/master/matmul/matmul.java
>>
File: 1460154926343.gif (2MB, 278x186px) Image search: [Google]
1460154926343.gif
2MB, 278x186px
>>61311085
>>
File: this_is_the_real_one.png (30KB, 1078x726px) Image search: [Google]
this_is_the_real_one.png
30KB, 1078x726px
>>61308282
>>
>>61311085
nice malloc u got there.nice ymm/zmm intrinsics, I see a lot of "register" keyword usage.

This is baby C, like someone who barely got hello world to work.
>>
File: 1499691108398.jpg (91KB, 550x750px) Image search: [Google]
1499691108398.jpg
91KB, 550x750px
>>61308282
this is high quality. whoever made this knew what they were doing.
>>
>>61311386
Its a real blog post by some node.js dev. https://blog.risingstack.com/how-to-use-rust-with-node-when-performance-matters/
>>
>>61308325
However many it takes to see the minute differences.
>>
>>61311085
If you read Agner Fog's 1st manual for C/ASM optimization he solves this problem with some bitmasking and simd ymm instructions which results in C being 45X faster (yeah 45 times)
>>
>>61311008
Yeah, don't you see the chart? Clearly the kernel should be written in Numpy bruh.
>>
>>61311427
>Agner Fog

You meant that AMD shill?
>>
>>61309367
>2017.2
>ascii
>>
File: redox.png (44KB, 343x407px) Image search: [Google]
redox.png
44KB, 343x407px
>>61311008
>Remind me, which language is the kernel you are running written in?
Rust?
https://github.com/redox-os/kernel
>>
>>61308887
I understand your point, but you picked wrong words.

1) You can program in whatever language you want but eventually it's translated to native assembly language of this cpu.

2) Unlike Java or Python, with C, the abstraction is minimal, C was known as portable assembly and the translation is fairly straightforward, almost 1:1 what >>61308887 means.

3) 99% of the assembly programmers cannot write a better assembly code than an optimizing C compiler produces for the same algorithm. (with the same selected instruction subset).

I program in C and x86 assembly since 2017 and as much as i try, gcc -O2 always outperform my direct assembly code.

So with the same algorithm and same cpu and the same instructions, if Rust is faster than C, it's by definition a flaw of C compiler. Because C is lower level than rust so the conversion (compilation) is more straight forward.
>>
>>61308494
It's not like learning C takes longer than a weekend at most. The standard library literally fits on a postcard. No excuse for any programmer not to know it.

As for learning how to program in it securely, might as well give up before even starting.
>>
>>61311622
>since 2017
wow, you must be an expert.
>>
>>61311622
fixup:
>I program in C and x86 assembly since 2007
>>
>>61311642
it's 2 am here dude :)
>>
>>61311622
>C is lower level than rust
Not true. Where are you getting this shit?
>>
>>61311622
>Because C is lower level than rust
This is how I know you don't know what you're talking about. Anything that can be programmed in C can be programmed in Rust. Operating systems and drivers are already being worked on with nothing but Rust and assembly.
>>
>>61311622
an entire kernel was written in rust and you're trying to tell me C is lower level? the fuck are you on?
>>
>>61311622
>Because C is lower level than rust so the conversion (compilation) is more straight forward.
Why don't C babbies do any research before crying on /g/?
>>
>>61311622
embarrassing post to be honest family
>>
>>61311622
>You can program in whatever language you want but eventually it's translated to native assembly language of this cpu.
Not every language is compiled, moron.
>C
>almost 1:1 with assembly
This hasn't been true for decades.
Your third point is true though.
>>
>>61311663
>>61311678
>>61311695
when i say lower level i didn't mean you cannot do the same things with the rust, it's a compiled systems programming language, you can do anything with it.

what i mean is, C was designed in a way that making a compiler for it is easier than many other languages.

- it only has data types that directly corresponds to the underlying machine. it doesn't have string type for example. floating point is included later when the machines supported it.
- it only has operators that directly corresponds to the underlying machine.

there are many other design choices in C that compilers and underlying machines were in mind.

in that sense, C is lower level than Go or Rust or D. it's not about the ability, my point is that C is translated to assembly much easier and more straight forward.
>>
>>61311789
Okay, so you're completely changing the definition of the term "low-level" (which has been used for a few decades) for your own benefit and expecting us all to go along with it. Got it.
>>
>>61311785
>Not every language is compiled, moron.
i wrote that sentence this is in mind.

there are some hardware that can run java bytecode directly, but in almost any case, the native assembly code(machine code actually) is what's running.

for interpreted languages like python, it's the interpreter, for bytecode languages like java it's the VM, nevertheless eventually it's the cpu specific machine code that runs.
>>
>>61311785
>Not every language is compiled, moron.
it still holds for interpreted languages. the interpreter has to send instructions to the cpu in the end
>>
>>61308791
>Holy shit why?
Why not? It's language's fault for not having memoization, not theory
>>
>>61311821
that's not true, the real definition of low level is how close programming languages abstractions to the underlying instruction set of cpu.

a programming language with string data type as primitive type and operator like + to concat strings is higher level by definition.

it was never about the ability.
>>
https://insights.stackoverflow.com/survey/2017#most-loved-dreaded-and-wanted
We did it!
>>
>>61311821
https://en.wikipedia.org/wiki/Low-level_programming_language
>>
>>61309428
>node js developer
dropped
>>
>>61311644
>10 years
wow, so impressive
>>
File: fib.jpg (17KB, 313x235px) Image search: [Google]
fib.jpg
17KB, 313x235px
>>61308282
this takes 1.5s. but how many fib numbers you want?
>>
>>61311789
there are types of optimizations not possible in C, even now you must pray to St. Dennis Ritchie that the compiler decides to turn optimizations on for a section of code without deleting your error handlers from UB because the language isn't expressive enough to handle that case
>>
File: 1496706640099.jpg (61KB, 646x484px) Image search: [Google]
1496706640099.jpg
61KB, 646x484px
>>61308887
>C is 1:1 translated to ASM without any overhead.
>>
>>61312059
That's pretty bad. A well written D code, in my machine, computes fib(5000) in 0.01s
>>
>>61312410
Also,
>>
>>61312483
That's 50000
>>
>>61312534
>>
Rust is just such a horrible piece of shit, that even if it where 2 times faster than C, I would never use it.
I tried to learn it, but then I realized it just sucks.
Who ever thought Rust was a good idea, really?
It was clear from the start, that the dumb faggots at mozilla who have been ruining firefox for the last 5 years could never design a good programming language.
>>
>>61312556
What's so bad about it?
>>
>>61312569
too complicated for him
>>
>>61312583
People hate what they don't understand
>>
>>61312556
i wouldn't mind it being spun off from mozilla to keep the social justice at a tolerable level
>>
>>61312583
>>61312569
Lol, I program in C and Haskell.
I don't think the joke that is rust is "too complicated" for me to program in, but the problem actually is that the language is too complicated for me to want to program in it.
I'd rather program in a simple and yet "good to program in" language, rather than Rust.
I looked into the language because I thought the syntactical sugar would make low-level more fun, but it didn't matter much when all the foundational concepts in Rust are horrible to begin with.
>>
>>61312410
fib(5000) takes 0.004 secs on mine lol
>>
>>61312709
>>61312547
>>
>>61312696
>Functional in low level
Nice one
>>
File: 543.gif (3MB, 320x240px) Image search: [Google]
543.gif
3MB, 320x240px
>>61308282
/rust/ or /elixir/? I make web apps and web app accessories.
>>
>>61312711
dont understand the image. explain it.
>>
>>61312752
>web apps
elixir
>>
>>61311842
>it's the language's fault for not having memoization
memoization is just as much of an "optimization" as recursion, and you can definitely do it explicitly.
>>
>>61312723
wow, nice reading comprehension.
never did I say haskell is what I consider low language.
With your idiocy it's no wonder you need Rust to enforce its stupid restrictions on you to not produce segfaults.

>>61312752
elixir 100%
Erlang is (probably) the best thing ever for servers, and elixir is just erlang with a different syntax.
Rust is shit for this, just like its shit in general.
Go would be another alternative.
>>
>>61312709
Is that using pypy? You do realize pypy does not implement full python, right?
>>
>>61312780
>I looked into the language because I thought the syntactical sugar would make low-level more fun, but it didn't matter much when all the foundational concepts in Rust are horrible to begin with.
Is English even your primary language?
>>
>>61312766
>>61312780
thanks bros, i was leaning that way, but /rust/ works with WebAssembly and I'm not sure if /erlang/ does.

it'd be nice to make games in-browser
>>
>>61312778
There are many optimizations that happens in compile time that you don't do manually.
>>
>>61311540
Sure....
>>
>>61311540
Nice
>>
>>61312810
No, but still please explain what is wrong about the sentence.
I don't see it. Maybe a comma is missing or something.
>>
>>61312811
everyone assumed you were talking about the server-side, which is where elixir would be used. client-side is another story
>>
>>61308282
Someone, make this using python and sending the load to the GPU through CUDA.

It should pwns rust and C.
>>
File: chart.png (22KB, 1096x724px) Image search: [Google]
chart.png
22KB, 1096x724px
>>61308282
>>
>>61309649
>>61309360
It's a lot more serious than just autism.
>>
>>61312852
yeah, i guess i should probably learn both.

what kind of fun things can i make with rust that aren't web-apps though? i'm retarded and just curious what kinds of things people who program actually produce.
>>
>>61312854
>It should pwns rust and C.
Okay, pajeet
>>
>>61312885
>i'm retarded and just curious what kinds of things people who program actually produce.
https://github.com/trending/rust?since=monthly
>>
>>61312885
You can make anything in any language.
Rust is pretty much good for nothing. (except maybe making sure that pajeets don't cause segfaults all the time, or having strings)
If you want to program client side, just learn javascript.
If you don't like dealing with it, typescript is an alternative that is just as viable.
>>
>>61312979
You are basically the only butthurt autist ITT that's not contributing to anything.

Are you mad that haskell never caught on?
>>
>>61312979
>except maybe making sure that pajeets don't cause segfaults all the time, or having strings
Sign me up
>>
File: Screenshot_2016-09-28_18-59-18.png (127KB, 1043x651px) Image search: [Google]
Screenshot_2016-09-28_18-59-18.png
127KB, 1043x651px
c developer here.

all my electronics and controllers still rely on it, probably moreso than assembly.

Many if not all of the machines I build will run on it for the foreseeable outcome of my time on earth.

none of them will run on javascript aside from fancy webuis for interfaces which still rely on real work being done in C.

I have engineered CAD objects to use the Fibonacci sequence, however I see few practical applications of it in software.
>>
>>61308282
so? you can write this in ASM in fewer lines than even C and it'll crush it in terms of run time

>>61308887
>being this wrong
Enjoy your wasteful push-pops fag
>>
>>61308494
>he spent his time learning C
>when he could have been learning the highly technical and limitless javascript
LOL
>>
>>61312979
typescript is good shit, you can do some wacky crap with mapped types now
>>
>>61313003
What are you on about?
I only program Haskell because it's fun to program.
And how am I mad? I just dislike the shilling a mediocre language like Rust gets constantly.

>>61313008
Too bad that no pajeets will end up using it, because Java or Go (or a lot of other languages) deliver the same promises, without being horrible to learn and/or to program in (from a pajeets perspective).
>>
>>61313072
>no pajeets will end up using it
Just sign my shit up, senpai
>>
>>61313080
>Systems programmers won't use it
>Pajeets won't use it
Who actually will end up using it though?
>>
>>61313072
>And how am I mad?
You are the only person who's been actively shitposting on a thread about a language you don't like.

Go write your "low level" shit with your "fun to program" toylang
>>
>>61313096
Non-autists. Where is the login screen?
>>
>>61312556
>>61312696
>>61312780
>>61312979
>>61313072
#T R I G G E R E D
>>
>>61313096
10% system programmers
90% trannies to write the CoC

according to benchmarks a Rust CoC is nearly 30% more sensitive and open, no other language can compete
>>
>>61313098
>shitposting
I am discouraging people from using a language which I actively dislike. How is that shitposting? Please answer without being salty.
I don't even understand why you are so emotionally invested in Rust.

>Go write your "low level" shit with your "fun to program" toylang
This doesn't make sense.
Even if haskell is a toy-lang, never did I say I use it to write low level shit.
For low level shit I use C, which isn't a toy-lang, and which will never be superceded by Rust.

>>61313128
It's funny to me how you can misinterpret something like that.
I am actually laughing at the retards who get seriously invested in a shit language like Rust.
Oh, I know. I forgot to post smug-anime girl pictures, so you know that my intention was to trigger people.

>>61313104
>Non-autists.
So non-programmers and people who would just use Java or Go instead.
You make no sense.
>>
>>61313207
>Please answer without being salty.
oh the irony
>>
>>61313207
Just installed Rust. What IDE should I use?
>>
>>61313244
Why do you need an IDE?
>>
>>61313244
Uninstall Rust, install VR headset drivers instead.
>>
>>61313250
I don't suffer from autism
>>
>>61313225
No answer? Fine, then don't try to be mad.
You know, you can just stop replying to me.

>>61313244
Use eclipse.
>>
>>61313207
>THIS Triggered
Oh boy you are going to have a stroke.
>>
>>61313244
i think rust nightly + vscode is the only editor with working code completion and such
>>
>>61313244
IntelliJ
>>
File: 1468485447823.jpg (2MB, 2000x2000px) Image search: [Google]
1468485447823.jpg
2MB, 2000x2000px
>>61313207
Rust!
>>
>>61313284
Nice. Thanks!
>>
File: retard.jpg (29KB, 380x302px) Image search: [Google]
retard.jpg
29KB, 380x302px
>>61308652
Wow. That's like saying a hammer is shit because you try hammering the nail with the bottom of the handle instead of the hammer head.
>>
File: fifteen_keks.jpg (61KB, 540x509px) Image search: [Google]
fifteen_keks.jpg
61KB, 540x509px
>>61309392
Haha, this kid is so mad.
>>
>>61313456
You don't even need to look at how retarded Rust is,
just take a look at its users and propagators (examples in this thread).
Or it's CoC, really...
>>
>>61308494
Nigga C is incredibly small
>>
>>61313498
Did you just recover from your seizure?
>>
>>61313529
You are violating the Rust Code of Conduct in the following respects:
>Please be kind and courteous. There’s no need to be mean or rude.
>Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
>Please keep unstructured critique to a minimum.
Please be so kind and follow the Rust Code of Conduct while promoting Rust in the future. Thank you.
>>
>>61313575
meant for >>61312556
>>
File: (you).png (73KB, 250x164px) Image search: [Google]
(you).png
73KB, 250x164px
>>61313252
>>>/v/
>>
>nobody discussing rust itt
dead language.
>>
File: slowpoke_pokemon.jpg (27KB, 600x655px) Image search: [Google]
slowpoke_pokemon.jpg
27KB, 600x655px
>>61308282
C was dead the moment C++ (a far superior language to C) was born.
Thread posts: 166
Thread images: 21


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