[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

[Advertise on 4chan]


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: N.png (14 KB, 673x467)
14 KB
14 KB PNG
simple words to kill a fan boy/girl
>>
>>82637005
There are no girls involved with rust, only failed beta males coping with inceldom through HRT
>>
>>82637033
fpbp
>>
>>82637033
im an transbian and this is so false like you chuds have no clue
>>
>>82637051
please explain, i will listen
>>
>>82637005
let's do this for every language.
>>
>>82637005
In Haskell you can implement the fisher yates shuffle using a mutable array
>>
>>82637005
how do you implement doubly linked list?
>>
>>82637189
with code
>>
>>82637005
whats the secret word? "faggot"?
>>
>>82637189
We implemented a double link list in rust with algorithms and coding
>>
>>82637189
inline assembly
>>
>>82637051
There was a majority of troons as speakers at the last Rustcon. Not even a plurality or just "wow that is a lot of degenerates"... No. A fucking majority. I like Rust, but holy hell. It is really at the vanguard of failed white men in tech chemically castrating themselves and claiming to be diverse.
>>
>>82637189
give me a reason to, first.
>>
File: 1619213221016.webm (395 KB, 854x480)
395 KB
395 KB WEBM
>>82637051
>>
>>82637288
Implement malloc on an embedded system.
>>
>>82637051
>transbian
Kek is this real?
>>
File: 1625627494316.jpg (150 KB, 934x572)
150 KB
150 KB JPG
>>82637051
>>
>>82637288
>be OP
>make fun of haskell for no double link list
>>how do you do a double linked list in rust?
>why would i want to do that?
>>
>>82637329
the term has existed for at least 10 years now.
they're universally hated by men and (lesbian) women alike.
>>
>>82637149
show it, nigger.
>>
>>82637480
data List a = Link (List a) a (List a) | None

go p [] = None
go p (x:xs) = let ret = Link p x (go ret xs) in ret

makeList [] = None
makeList xs = go None xs
>>
>>82637362
top midde two?
>>
>>82637189
pub struct Node {
value: u64,
next: Option<Box<Node>>,
prev: Option<Box<Node>>,
}
>>
>rust is so shit the only way to make it seem less shitty is to lie about and attack other languages
No wonder no one uses it.
>>
>>82637784
>
>>
>>82637784
>pub
that is very economica-
>Option<Rc<Ref<Cell<Node<
WWWWWTTTTTTTTTTFFFFFFFFFF
>>
>>82637831
>cnile cant handle algebraic types
>>
>>82637849
meanwhile you have that linked list implementation.
>>
>>82637849
>algebraic types
ok I'll make another thread about this
>>
>>82637941
no dont
>>
>>82637967
>algebraic data type
make a List (singly linked!) in your enum
>>
>>82637784
now implement a list traversal with this data type: 1. efficiently (i.e. no recursion) 2. without using unsafe
>>
>>82638194
At that point i would just use C++
>>
>>82637591
Here's a library for shuffling vectors, which contains the Fisher Yates shuffle and a few others:
https://hackage.haskell.org/package/perfect-vector-shuffle

Here's a simpler implementation:
module Main where
import System.Random
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as MV

main :: IO ()
main = putStrLn "Hello, Haskell!"

shuffleIO ls = do
v <- V.unsafeThaw (V.fromList ls)
shuffleVecIO v
V.toList <$> V.unsafeFreeze v

shuffleVecIO v = go (MV.length v - 1)
where
go n | n < 1 = pure ()
| otherwise = do
MV.swap v n =<< randomRIO (0,n)
go (n-1)
>>
>>82637784
cool html bro
>>
>>82637259
No wonder Rust is so Cultish.
>>
File: 1621062760078.png (625 KB, 1418x796)
625 KB
625 KB PNG
>>82637005
std::collections::LinkedList<T>

Let's see a C hashmap lmao
>>
>>82637329
Yeah, its the Chris Chan strategy to get pussy.
He failed tho.
>>
>>82637005
in haskell this is just
import System.Random

fisherYatesShuffle = go
where
go [] = pure []
go xs = do
let len = length xs
i <- randomRIO (0, len - 1)
let x = xs !! i
xs' = filter (/= x) xs
occ = occurence x xs
ys <- go xs'
insertN occ x ys

occurence x = length . filter (== x)

insertN 0 _ xs = pure xs
insertN n e xs = do
xs' <- insertN (n-1) e xs
insert e xs'

insert e xs = do
let len = length xs

go [] _ = []
go (x:xs) i
| idx == i = x : (0,e) : go xs i
| otherwise = x : go xs i
where
idx = uncurry const x

insert' = tail . unindexify . go (indexify (0:xs))

i <- randomRIO (0, len)
pure (insert' i)

indexify xs = zipWith (,) [0 .. length xs - 1] xs

unindexify = map (uncurry (flip const))
>>
File: 1598897333411.png (71 KB, 509x423)
71 KB
71 KB PNG
>>82637033
>>
File: 1548028757486.gif (1.55 MB, 410x306)
1.55 MB
1.55 MB GIF
>>82637362
>watch the 4chan post rate drop to zero
>because anons never click anything except submit
>>
File: 1615484954576.jpg (33 KB, 488x563)
33 KB
33 KB JPG
>>82637051
>transbian
>>
>>82637005
https://doc.rust-lang.org/std/collections/struct.LinkedList.html
>>
>>82639062
>in haskell this is just
>this is just
>just
>>
>>82637033
fpbp fuck rust trannies
>>
>>82637608
dont trust women with too much makeup
you can make a monkey look pretty with enough cake decor on its face
god forbid you get a son and he comes out disfigured
or wake up every morning to a terrifying sight
also the girl (?) in the middle left is using an insane amount of filters, a red flag
>>
>>82637608
yeah i forgot
yes ur correct, top middle two are biological women
the joke is it is obvious
>>
>>82638510
cargo-cultish, even
>>
Just use the ST monad
>>
>>82637051
Rapehons are why troons have a bad rep
>>
>>82637329
Nice Guys / Incels, just transform in trannies for get female gf, miserably fail or rape females and end up dating with other trans woman.
>>
>>82637033
>There are no girls involved with rust, only failed beta males coping with inceldom through HRT
fpbp, seethe, cope and dilate Rusties.
>>
>>82637362
i can't tell which are bio women because everybody looks like a tranny, even the ones with too much makeup
am i simply /g/ay, bros?
>>
File: _qT3HjJO_400x400.jpg (25 KB, 400x400)
25 KB
25 KB JPG
Now second edition of Programming Rust begin co autor by a tranny.

THANKS RUST.
>>
>>82637005
How do these 2 languages cause so much seething? Are they really that much better than everything else?
>>
>>82642839
Two useless languages for feeling better than other people without do anything useful.
>>
>>82643366
Cope
>>
>>82638564
#include "hashmap.h"
>>
>>82640607
hehe
>>
>>82643909
>doesn't exist
lmao NO NO NO cisters we got too cocky
>>
>>82637005
I love how both of these “gotchas” are trivial for anyone who is mildly familiar with either language



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

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.