Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-

C vs Rust

Name: Anonymous 2015-02-13 1:07

C:
int main(int argc, char **argv) {
int r;
if(argc > 1) {
r = atoi(argv[1]);
} else {
usage();
exit(EXIT_FAILURE);
}
}


Rust:
fn main() {
let argv: Vec<Result<String,OsString>> = std::env::args()
.map(|x| x.into_string())
.collect();

let r = match argv.get(1) {
Some(x) => match x.parse::<i32>() {
Ok(v) => v,
Err(_) => {
show_usage();
panic!()
},
},
None => {
show_usage();
panic!()
}
}
}


Type explosion is to be expected. Do notation could have been used to keep the control logic as clean as C, but Rust is not HASKAL and never will be anything like HASKAL and you're an asshole for wanting to write readable code you filthy shit fuck.

Name: Anonymous 2015-02-13 1:22

>>1
The rust program handles malformed integers while the c program does not.

Name: Anonymous 2015-02-13 1:45

who the fuck thought std::herpes:::::::::this or <Nigger,<DoubleNigger,Nigger<<<<<<<This>>>>>>>> was a good idea

Name: Anonymous 2015-02-13 1:52

>>2
And it could do that in a way as clean as the C version by using do notation.

Name: Anonymous 2015-02-13 2:23

Name: Anonymous 2015-02-13 3:26

>>2
Maybe the programmer shouldn't make the integers malformed? Programmer school, did you flunk?

Name: Anonymous 2015-02-13 3:32

HAHAAHHAHAAHHAHAHDAHASDHUAEGRYAHOINGRHUITRJOEAGHOIHUIOWHAWAHGUIHAAGHRAWEGRHU RUST RUST RUST THE NEW HIP LANGUAGE RUST, I CANT WAIT TIL THE COMPILE RIS MORE MATURE. IM SO EXCITED ABOUT LEARNING RUST. MAYBE TRY RUST? LOOLLOLLOLOLOLOASDFLOASKOASHOKAHFJIOAFOIJ.

Name: Anonymous 2015-02-13 7:02

>>3
Bjarne Stroustrup.

Name: Cudder !MhMRSATORI 2015-02-13 15:05

For even more WTF, look at the code the compiler generates.

Name: Anonymous 2015-02-13 15:38

>>9
We're programmers, not toilet code scrubbers.

Name: Anonymous 2015-02-13 17:22

>>10
A good programmer knows the entire spectrum from machine code to high level abstractions.

Name: Anonymous 2015-02-13 17:35

>>11
No, a good programmer never wastes time on low-level machine bullshit.

Name: Anonymous 2015-02-13 17:50

>>12
Go the fuck back to your gay Javashit apping brocrowd

Name: Anonymous 2015-02-13 18:18

Cudder is all talk and one fizzbuzz.

Name: Anonymous 2015-02-13 19:16

>>12
This is how we get cargo cults.

Name: Anonymous 2015-02-14 4:00

>>15
Low level programming is a cargo cult for most. Parroting conventional wisdom from decades past is easy; measurement is hard.

Name: Anonymous 2015-02-14 8:39

>>16
This is how we get cargo pants.

Name: Anonymous 2015-02-14 10:02

>>16
dumbass

Name: Anonymous 2015-02-14 10:20

>>13
Dumbass.

Name: Anonymous 2015-02-14 13:55

>>22
dubass

Name: Anonymous 2015-02-14 20:11

I'll never use an SJW language. Fuck Rust.

Name: Anonymous 2015-02-14 20:32

>>21
SJW language
lol check 'em

Name: Anonymous 2015-02-14 20:58

Soft Jewish Woman

Name: Anonymous 2015-02-14 21:27

Smoke Jazzy Weed

Name: Anonymous 2015-02-14 21:45

Sniff Jealous Wood

Name: Anonymous 2015-02-14 21:56

Sussman's Juvenile Wife

Name: Anonymous 2015-02-14 22:19

Shitposting Jizz Waltzers

Name: Anonymous 2015-02-14 23:25

Snide Jamaican Wildlife

Name: Anonymous 2015-02-14 23:30

Selfish Judgmental Wankers

Name: Anonymous 2015-02-15 3:34

Stop Judging Wankers

Name: Anonymous 2015-02-15 7:34

>>15
Low level programming is a cargo cult for most. Parroting conventional wisdom from decades past is easy; measurement is hard.

Name: Cudder !MhMRSATORI 2015-02-15 13:36

>>31
measurement is hard.
As hard as typing dir or ls -l?

Name: Anonymous 2015-02-15 14:11

exit(EXIT_FAILURE);
AYFKM

Name: Anonymous 2015-02-15 21:30

Cudder is all talk and one fizzbuzz.

Name: Anonymous 2015-02-16 0:15

>>32
As hard as choosing benchmarks that repeatably measure the impact of an optimization on the entire system in which it is used, and nothing more (such as the impact of the benchmarking method itself).

Name: Anonymous 2015-02-16 2:48

Is Rust the future?

Or will it simply corrode as a language ha ha ha

There are two possibilities:

1. Rust will become a true Systems Language, and will be able to surpass c / c++ in areas where they are truly necessary ( device drivers, embedded etc )

2 It will die, because there are better alternatives available if you want abstractions.

I personally hope the first case will become reality.

Name: Cudder !MhMRSATORI 2015-02-16 2:54

Rust has the potential to be the best language since FORTRAN 77.
Too bad it doesn't have GC, which is ESSENTIAL for us 21st Century Programmers.

Name: Anonymous 2015-02-16 3:02

D > Rust > JS > Go > Haskell > OCaml > C > Python > Ruby > Lua > Perl > Bash > HTML > Java > C++ > C# > .NET

Name: Anonymous 2015-02-16 3:14

>>36,37,38
go back to reddit/hackerniggers//g/

Name: rindolf the stdfish 2015-02-16 3:19

>>39
dont 4get ##programming on irc.freenode.net :)

Name: Anonymous 2015-02-16 3:25

>>37
Doesn't Rust have optional GCC through one of its @ pointer type?

Name: Anonymous 2015-02-16 8:36

>>41
It has GC via the RC and ARC types ((atomic(?)) reference counted) but the linear type system is clearly better than GC, and I'm pretty sure cdr was being facetious when shim said it is essential.

Name: Anonymous 2015-02-16 8:37

>>39
You forgot LtU.

>>41
No, @-pointers were removed and the planned GC was never implemented. You can use Rc<T> but I don't think there's a cycle collector.

Name: Anonymous 2015-02-16 8:44

oh and what's up with everyone converting to reference counting to 'get away from the GC'

refcounting is a form of GC and is far, far slower than a proper GC, and there's no real proper way to defer cleaning up refcounting for an 'opportune' time like with a 'real' GC unless you... introduce a 'real' GC.

The idea that malloc/free has no overhead is absolutely ridiculous too, as if GCs suddenly make memory management slow. Realtime programming is done by never using anything except stack memory and preallocated buffers, GC or not.

rust feels like a meme language made by people who have never really done any form of low level programming

t. someone who writes embedded software for medical devices in pascal for a living

Name: Anonymous 2015-02-16 8:55

The only people who shill Rust are people who haven't actually used it.

Yes the safety mechanisms are great in theory.

Yes we need a modernized version of C++.

But try to actually write something bigger than FizzBuzz in the fucking language and you'll quickly see why it'll never take off: Working in Rust is a bitch. It's inconvenient, has convoluted non-intuitive syntax and is just simply not fun.

Name: Anonymous 2015-02-16 8:58

>>44
I don't know why you would think that. We know RC is a form of GC, so there's no "getting away from GC" in using RC. RC is a cheap way of GC-ing select pieces of data without having to irreversably munge the whole damn runtime to use GC everywhere.
Therefore Rust's GC is "oh, if you insist you really want GC, here's something". Plus Apple have been using RC'd GC for years.

Name: Anonymous 2015-02-16 9:01

>>45
I agree. 95% of using Rust is wrestling with the godawful module/crate system.

Name: Anonymous 2015-02-16 9:25

The guy who was trying to make an OS in Rust gave up, and switched to the Nim language.

https://github.com/ckkashyap/rustix/issues/8

>>47
Like SJWs trapping you with their political correctness, Rust traps you in its boilerplate bureaucracy.

Name: Anonymous 2015-02-16 9:26

>>48
Nim is full of leaky abstractions. I wouldn't use it.

Name: Anonymous 2015-02-16 10:07

>>48
there were multiple guys doing that and at least one lady

Name: Anonymous 2015-02-16 10:47

Low level programming does not make you a good programmer. Write good strong software instead of checking for null pointers or buffer overflows.

Name: Anonymous 2015-02-16 21:58

>>51
What?

Name: Anonymous 2015-02-16 22:34

>>44,48
Rust is handicapped because it is a Mozilla project. All posturing to the contrary, making the language suitable for use in unhosted applications like kernels does not add a lot of value for Mozilla. Mozilla isn't writing kernels, they're writing a browser and they want a simpler safer alternative to C++ for that purpose. Once that is understood it should no longer be surprising that things like decoupling from libc are in fact a complete mess in Rust.

This is a sad situation if you're actually looking for a practical alternative to C in non-userland code, because there really is a lot of room for improvement there.

Name: Anonymous 2015-02-17 23:30

Rust is unarguably better than HTML.

Name: Anonymous 2015-02-17 23:42

You know what's even better than both Rust and HTML? check'em!

Name: Anonymous 2015-02-17 23:48

The solution, as always is Lisp Machines

Name: Anonymous 2015-02-18 0:07

>>54
Bullshit.
My HTML code runs faster and is more readable than Rust could ever be.

Name: Anonymous 2015-02-18 0:35

>>57
Prove it, nigger. Post code & benchmarks.

Name: Anonymous 2015-02-18 6:19

>>53
It's not so bleak. The libc business is something you can work out and will probably become saner in the future if people actually want to use it that way. If you're targeting ARM http://zinc.rs probably has you covered already.

Name: Anonymous 2015-02-18 7:14

>>59
will probably become saner in the future if people actually want to use it that way

If so it will be the first Mozilla project I know of to have that success.

That link gives me some hope though - the principal author is bang on about the potential benefits global optimization can bring in this space. I am completely sick of having to pamper C compilers and their Byzantine unit-at-a-time linkage model. (And don't any of you dare bring up inlining as a solution - that's like conflating remission with metastasis).

Name: Anonymous 2015-02-18 9:11

If so it will be the first Mozilla project I know of to have that success.

If you don't hate ES, I would count it as a success in that area. If you do hate it, I can see how you'd see it the other way (eg. wanting a bytecode.)

If you check the committers for zinc.rs you'll find that most of them also have contributions to Rust. The Rust team has generally sided with making this kind of thing possible (and pleasant though it's not exactly a priority.)

Name: Anonymous 2015-02-18 12:18

>>53
Hey, this is pointless to say because you won't listen and you don't care, but Rust isn't a Mozilla-controlled project like Firefox. Mozilla sponsors Rust by hiring people who contribute to the project, so that they'll put as much energy as possible into further contributions. The actual development process is very transparent and there's no special status for Mozilla-employed contributors over random people with a lot of spare time. What matters is that you know your shit and you can write words and code to back it up.

Name: Anonymous 2015-02-18 15:33

>>62
Well, that's bullshit.

Signed,
Not >>53

Name: Anonymous 2015-02-18 15:39

>>61
I'm ambivalent on ECMAScript - I just didn't count it as a victory for Mozilla per se because it was already gaining ground when Netscape still existed.

>>62
I know what an open source project means. Having a lot of paid developers on the project confers influence and it's quite naive to maintain otherwise.

Name: Anonymous 2015-02-23 8:24

fn main() {
let r = match std::env::args().map(|x| x.to_string()).nth(1) {
Some(x) => match x.parse::<i32>() {
Ok(v) => v,
Err(_) => panic!("Argument must be an i32."),
},
None => panic!("No arguments were given."),
};
}

Name: Anonymous 2015-02-23 8:49

dubs get

Name: Anonymous 2015-02-23 9:33

Name: Anonymous 2015-02-23 10:54

Who is that shitter who keeps posting /prog/ to Reddit?

Name: Anonymous 2015-02-23 10:56

>>68
I think it's this guy: >>67

Name: Anonymous 2015-02-23 12:14

>>69
Negative. I noticed my shitpost was posted to the Rust subreddit by someone who works on Rust and Servo and decided to gloat. They hid the story immediately and I can't decide whether I feel ^ ^ or ; ; about that.

Name: Anonymous 2015-02-23 13:19

>>3
Haha, enjoy your <::>::<>::<>::><><::><::<>::-itis.
Haskell's syntax is so much better.

Name: Anonymous 2015-02-23 14:55

You do not need to annotate most types; I can't tell if this is b8 or you are actually this ignorant, because you are misrepresenting idiomatic rust with extreme prejudice. Just because you have not learned the language yet does not mean you can bash on it (in fact, quite the opposite…)

#![feature(env)]

use std::env::{args, set_exit_status};

fn main() {
let r = match args().nth(1) {
Some(a) => a.parse::<i32>().unwrap_or(0),
None => {
show_usage();
set_exit_status(1);
return;
},
};
}

Name: Anonymous 2015-02-23 15:51

>>72
imperative diarrhea

Name: Anonymous 2015-02-23 17:30

>>72
main :: IO Int
main = do
args <- getArgs
maybe (return 1) (read >>> return) $ listToMaybe args

Name: Anonymous 2015-02-23 18:12

>>74
[1 of 1] Compiling Main ( anus.hs, interpreted )

anus.hs:3:11: Not in scope: `getArgs'

anus.hs:4:26:
Not in scope: `>>>'
Perhaps you meant one of these:
`>>' (imported from Prelude), `>>=' (imported from Prelude)

anus.hs:4:40: Not in scope: `listToMaybe'
Failed, modules loaded: none.

Name: Anonymous 2015-02-23 18:42

>>75

Optimize your prelude!

Or add

import Control.Category
import System.Environment
import Data.Maybe


to the top.

Name: Anonymous 2015-02-23 19:13

>>76
Control.Category
Just use (.), check 'em!

Name: Anonymous 2015-02-23 19:16

>>77
No. I like writing left-to-right, because I am not a Jew.

Name: Anonymous 2015-02-23 20:43

>>78
Add this to your prelude
(&) :: (b -> c) -> (a -> b) -> a -> c
(&) = flip (.)

it's the only good thing from the lens library.

Name: Anonymous 2015-02-23 22:17

>>79
that's for object oriented faggots who can't learn a single new thing

Name: Anonymous 2015-02-23 22:54

>>80
How is flipped function composition related to OOP?

Name: Anonymous 2015-02-23 23:31

>>81
Write some code that uses it and the answer will be staring you in the face.

Name: Anonymous 2015-02-23 23:58

>>82
Objects followed by methods are not function composition, ``faggot''.

Name: Anonymous 2015-02-24 0:13

>>83
not understanding this most basic thing

Name: Anonymous 2015-02-24 0:30

>>84
That isn't what he said!

Name: Anonymous 2015-02-24 18:58

>>82
Are you talking about chained method calls, where methods of foo all return foo? Because that's not function composition.

Name: Anonymous 2015-02-24 19:05

>>79
You drunk or something? You wrote the type for (.), not (&).

Name: Anonymous 2015-02-24 19:11

>>80
No, you idiot, it's for those who like readable code. Haskell is riddled with direction-inverting operators like

<- -- Hebrew
>>= -- White
<< -- Hebrew
($) -- White
(.) -- Hebrew


that make expressions impossible to decode because the control flow in them starts in an unobvious place and changes direction several times. So I just find it saner to choose one direction and settle with it instead of having to visually parse unreadable shit like

x <- (f g) . (h . j. z $ i) $ y >>= return (f . m << negro)

Name: Anonymous 2015-02-24 19:41

>>79
Moreover, the lens (&) is just reversed function application

(&) :: a -> (a -> b) -> b

https://hackage.haskell.org/package/lens-4.7/docs/Control-Lens-Lens.html

Name: Anonymous 2015-02-24 19:46

Name: Anonymous 2015-02-24 20:00

>>90
This isn't flip (.), this is OOP-style method application and it will not work in point-free style.

Name: Anonymous 2015-02-24 20:44

>>90
Why didn't they call it (|>)? It's pictographic and they even point out that's what Ft-hoocrtpoe uses for it. Caml |> O does it too.

Name: Anonymous 2015-02-24 20:52

Name: Anonymous 2015-02-24 21:12

>>93
That's a really silly reason, considering that & ought to be an even more frequently taken name.

Name: Anonymous 2015-02-24 21:17

>>93
What a waste. That's just a specialized form of something like a & and seq and they wasted multiple combinators on this junk.

Name: >>95 2015-02-24 21:18

s/and seq/append/seq/g

Name: Anonymous 2015-02-24 22:05

░░░░░░▄▀▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒█
░░░░░█▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█
░░░░█▒▒▄▀▀▀▀▀▄▄▒▒▒▒▒▒▒▒▒▄▄▀▀▀▀▀▀▄
░░▄▀▒▒▒▄█████▄▒█▒▒▒▒▒▒▒█▒▄█████▄▒█
░█▒▒▒▒▐██▄████▌▒█▒▒▒▒▒█▒▐██▄████▌▒█
▀▒▒▒▒▒▒▀█████▀▒▒█▒░▄▒▄█▒▒▀█████▀▒▒▒█
▒▒▐▒▒▒░░░░▒▒▒▒▒█▒░▒▒▀▒▒█▒▒▒▒▒▒▒▒▒▒▒▒█
▒▌▒▒▒░░░▒▒▒▒▒▄▀▒░▒▄█▄█▄▒▀▄▒▒▒▒▒▒▒▒▒▒▒▌
▒▌▒▒▒▒░▒▒▒▒▒▒▀▄▒▒█▌▌▌▌▌█▄▀▒▒▒▒▒▒▒▒▒▒▒▐
▒▐▒▒▒▒▒▒▒▒▒▒▒▒▒▌▒▒▀███▀▒▌▒▒▒▒▒▒▒▒▒▒▒▒▌
▀▀▄▒▒▒▒▒▒▒▒▒▒▒▌▒▒▒▒▒▒▒▒▒▐▒▒▒▒▒▒▒▒▒▒▒█
▀▄▒▀▄▒▒▒▒▒▒▒▒▐▒▒▒▒▒▒▒▒▒▄▄▄▄▒▒▒▒▒▒▄▄▀
▒▒▀▄▒▀▄▀▀▀▄▀▀▀▀▄▄▄▄▄▄▄▀░░░░▀▀▀▀▀▀
▒▒▒▒▀▄▐▒▒▒▒▒▒▒▒▒▒▒▒▒▐

Name: Anonymous 2015-02-24 23:48

░░░░░░░░▄▄▄▄▄
░░░░░░░░▀▀▀██████▄▄▄
░░░░░░▄▄▄▄▄░░█████████▄
░░░░░▀▀▀▀█████▌░▀▐▄░▀▐█ Have u ever
░░░▀▀█████▄▄░▀██████▄██ went fast?
░░░▀▄▄▄▄▄░░▀▀█▄▀█════█▀
░░░░░░░░▀▀▀▄░░▀▀███░▀░░░░░░▄▄
░░░░░▄███▀▀██▄████████▄░▄▀▀▀██▌
░░░██▀▄▄▄██▀▄███▀░▀▀████░░░░░▀█▄
▄▀▀▀▄██▄▀▀▌████▒▒▒▒▒▒███░░░░▌▄▄▀
▌░░░░▐▀████▐███▒▒▒▒▒▐██▌
▀▄░░▄▀░░░▀▀████▒▒▒▒▄██▀
░░▀▀░░░░░░▀▀█████████▀
░░░░░░░░▄▄██▀██████▀█
░░░░░░▄██▀░░░░░▀▀▀░░█
░░░░░▄█░░░░░░░░░░░░░▐▌
░▄▄▄▄█▌░░░░░░░░░░░░░░▀█▄▄▄▄▀▀▄
▌░░░░░▐░░░░░░░░░░░░░░░░▀▀▄▄▄▀
░▀▀▄▄▀

Name: Anonymous 2015-02-24 23:50

>>98
No.

Name: Anonymous 2015-02-25 0:24

>>99
Nice dubs.

I believe I got dubs too!

CHECK EM

Name: Anonymous 2015-02-25 0:27

>>97
Cool Doctor Who meme, Superwholockian.

Name: Anonymous 2015-02-25 0:42

>>101
What are you talking about, palindrome-kun?

Name: Anonymous 2015-02-25 1:04

JACKSON 5*20+3 GET

Name: Anonymous 2015-02-25 19:03

>>100-99
Double dubs!

Name: Anonymous 2015-02-27 18:48

Take malloc and free out of C, add some static analysis for bad pointer usage and you have 98% of the benefit of Rust

Name: Anonymous 2015-02-28 4:13

>>105
Take malloc and free out of C, add some static analysis for bad pointer usage
What is C++ new/delete and smart pointers?

Name: Anonymous 2015-02-28 11:36

>>106
new/delete are malloc/free + constructors/destructors respectively. Smart pointers look like they incur unavoidable runtime overhead.
Also you should really check your grammar.

Name: Anonymous 2017-01-19 14:25

>>9
Here's the assembler code generated by rustc for the standard Hello World program:

core::fmt::Arguments::new_v1:
push rbp
mov rbp, rsp
mov rax, rdi
mov qword ptr [rbp - 24], rax
mov qword ptr [rbp - 32], r8
mov qword ptr [rbp - 40], rcx
mov qword ptr [rbp - 48], rdx
mov qword ptr [rbp - 56], rsi
mov qword ptr [rbp - 64], rdi
mov qword ptr [rbp - 16], 0
mov rax, qword ptr [rbp - 64]
mov rcx, qword ptr [rbp - 56]
mov qword ptr [rax], rcx
mov rdx, qword ptr [rbp - 48]
mov qword ptr [rax + 8], rdx
mov rsi, qword ptr [rbp - 16]
mov qword ptr [rax + 16], rsi
mov rsi, qword ptr [rbp - 8]
mov qword ptr [rax + 24], rsi
mov rsi, qword ptr [rbp - 40]
mov qword ptr [rax + 32], rsi
mov rdi, qword ptr [rbp - 32]
mov qword ptr [rax + 40], rdi
mov rax, qword ptr [rbp - 24]
pop rbp
ret

drop:
push rbp
mov rbp, rsp
mov qword ptr [rbp - 8], rdi
pop rbp
ret

example::main:
push rbp
mov rbp, rsp
sub rsp, 64
lea rdi, [rbp - 56]
lea rcx, [rip + ref.0]
xor eax, eax
mov r8d, eax
mov rsi, qword ptr [rip + example::main::__STATIC_FMTSTR]
mov rdx, qword ptr [rip + example::main::__STATIC_FMTSTR+8]
call core::fmt::Arguments::new_v1
lea rdi, [rbp - 56]
call std::io::stdio::_print@PLT
add rsp, 64
pop rbp
ret

example::main::__STATIC_FMTSTR:
.quad ref.2
.quad 1

ref.0:

str.1:
.ascii "Hello, World!\n"

ref.2:
.quad str.1
.quad 14


This is from the compiler explorer site, on my Linux VM the output is even more horrific (to the point that it's too large to post here). In both cases I'm pretty sure it's the latest version of the compiler, 1.14.0. I'm not that experienced with assembly, but it looks to me like it's using 64 bytes of stack space, which is ridiculous for such a trivial program.

For comparison, GCC 4.4.7 with optimization off produces the following Hello World code:

.LC0:
.string "Hello, World!"
main:
push rbp
mov rbp, rsp
mov edi, OFFSET FLAT:.LC0
call puts
mov eax, 0
leave
ret


>>82,84
OOP is based on partial application, not function composition. Converting a.hax(&a, 5) (C style) to a.hax(5) (C++ style) is essentially an example of partial application. You take a binary function, and use partial application to bind the self-reference argument to the parent object to create a unary member function.

>>86
It would be function composition if the language had some way to define the chain as a new function. Mathematically speaking, f(g(5)) isn't function composition, it's just using the function g with the argument 5, and then using the result as the argument to the function f. Now, if you instead did something like h(x) = f(g(x)), that is function composition, because you're defining a chain of functions as a new function. Likewise, m.move_north().move_east() isn't composition, but something like
movable movable::move_northeast() {
return this->move_north().move_east();
}


would be.

>>106
Static analysis means it's done at/before compile time. Smart pointers are basically a form of runtime GC. Rust's main selling point is that the features that make it ``safe" are all done at compile time, thus causing no run-time penalty.

Name: Anonymous 2017-01-31 3:45

Lets see these rust guys implement diffoubly linked lists

Name: Anonymous 2017-01-31 3:46

trips upcoming

Name: ▄︻̷̿┻̿═━一 2017-01-31 3:47

THESE 2nd AMENDMENT TRIPS

Name: Anonymous 2017-04-29 18:56

Rust is very fast.

C:
#include <stdio.h>

int main()
{
int total = 0;
for (int i = 0; i < 100000; i++)
{
for (int j = 0; j < i; j++)
{
total += (j * j == i) ? j : 0;
}
}

printf("%lu\n", total);
return 0;
}
50085
real 8.25
user 8.25
sys 0.00

fn main() {
let mut total: i32 = 0i32;
for i in 1..100_001 {
for j in 1..i {
total += if (j*j) == i {j} else {0i32};
}
}
println!("{}", total);
}
50085
real 2.61
user 2.61
sys 0.00

And it's fair to claim that Rust enforces memory safety unlike C or C++. Reason why C/C++ programs are so vulnerable. The example in the OP just goes to show Rust handles errors better and it trains the programmer to do so.

Rust has a decent dev environment. The cargo is a very good project manager, Rust language server is the combination of Clang format, Clang complete and CPP check, with more features like snippets etc. And lastly, the Rust compiler is very impressive. For a language that's 2 years old it certainly helps produce fast, optimized and safe binaries that C never did. Rust compiler is like GCC+CPP check combined.

So FUCK YOU. Stay confined in your bubble world of baby duck syndrome while you can, I just got sick and tired of edgy C tards like you. No wonder C is dying.

Name: Anonymous 2017-04-30 2:18

Rust would be good if it didn't look like C++.

Name: Anonymous 2017-04-30 11:26

>>113
at least it doesn't look like lisp.

Name: Anonymous 2017-05-01 20:47

>>112
Rust: let mut total: i32 = 0i32;
Symta: Total = 0

Code less, create more.

Name: Anonymous 2017-05-01 21:32

>>115
Symta
Nice shitpost.

Name: Anonymous 2017-05-01 21:57

>>115
Rust has more backing.

Name: Anonymous 2017-05-13 17:14

The future is bright!

Name: Anonymous 2017-05-13 23:17

>>1
At least Rust has figured out how to eliminate the need for significant whitespace in nested generic type declarations.

>>115
I'm not familiar with Symta, however not having to declare variable types means either that you don't know for sure that your variable is represented as a 32-bit signed integer, or that the language uses implicit typing rules which can hurt readability. Either way, it's not really a truly ``synonymous" statement to the Rust variable declaration. I do think having to specify the variable type both in the variable declaration and in the literal being used to initialize the variable is ridiculous. Something like let mut total = 0; is understandably dangerous, since nowhere is the actual data type of the variable explicitly stated. But either let mut total: i32 = 0; or let mut total = 0i32 should be fine. Otherwise you're just being needlessly redundant.

Don't change these.
Name: Email:
Entire Thread Thread List