[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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: file.png (626 KB, 1036x1158)
626 KB
626 KB PNG
go lost, here is the why:

full self hosted llvm free (ie not using llvm at all but cranelift instead) rust toolchain : 2.25M sloc
160k lines of code for cranelift
2M for rust
and some more for the backend linking the two.
total 2.25M.

full go toolchain : 2.3M toolchain

on top rust has more feature.
rust does more in less code.

rust wins.

previous thread >>103553290
>>
It could've been over, anon. You could have let it die.
>>
File: file.png (232 KB, 777x227)
232 KB
232 KB PNG
>>103569313
sloc proof
>>103569153
>>
>>103569323
i'm going to bed soon, my plan is to let them seeth overnighht lol
>>
File: naked pepefrog.png (217 KB, 655x599)
217 KB
217 KB PNG
>>103569313
You keep posting under the unstated assumption that Cargolift supports 100% of Rust features out of the box but I don't believe that's true.
>>
>>103569313
Bruh, just let it go. Holy shit.
>>
File: file.png (34 KB, 883x171)
34 KB
34 KB PNG
>>103569341
it does all the feature that matters for functionality and i know that for sure because i was able to build a lot of public projects using it for testing.

i've also been able to build the company project i've been working on for the past 9 months even though i never tried to build it using cranelift.

give me a single repo cranelift will completly fail to build.
>>
>>103569345
i'm powered by autism sorry.
and i got tired of the constant go shill thread, this lang seriously needs to die.
>>
>>103569345
also, > let it go
nice play on words lmao.
>>
File: 1733584956826689.png (66 KB, 382x540)
66 KB
66 KB PNG
>>103569336
hopefully rust will finish compiling by the time you wake up
>>
>>103569376
it can build big projects in < 0.5s on a 8yo computer, and that's without even using the cranelift backend, you don't know what you are talking about.

also i rather spend an extra 100ms compiling than an extra month writing boilerplate or worse having to deal with someone else's buggy go boilerplate.
>>
File: go 2.jpg (111 KB, 444x691)
111 KB
111 KB JPG
>>103569370
>this lang seriously needs to die.
Rust will die first.
>>
>>103569405
there is not a single thing go can do rust cannot, the opposite isn't true however.

seeth with your garbage collecting language.
>>
>>103569313
Very nice. Let's see the compile time
>>
anyway you guys can read the previous thread,
any language is better than go, yes even shitty java or cursed php.

good night.
>>
>>103569376
>>103569419
>>103569383
most time is spent linking and not compiling anyway, which can be made 10x faster by using mold as a linker.
>>
File: GOD5wk6XsAAbRV4.jpg_large.jpg (228 KB, 2048x1966)
228 KB
228 KB JPG
>>103569416
>there is not a single thing go can do rust cannot
Go isn't about programming language theory, or even design. It's about software engineering. Your inability to understand this is why you are unable to see the beauty in the simplicity of Go. You are the lone wolf "wild west" programmer that most people fear having as their colleague.
>>
>>103569405
also you know what, i don't care if rust die, heck i'd sacrifice rust for go to go with it.
>>
>>103569443
i understand this, my point is that rust is better in all metrics that matter, it's a much more practical language, you can do more with less time and code.
the compiler argument prooves that.

rust is a less error prone and more productive language.

the only reason to use go is to hire cheap pajeets.
and that i can admit, is a pro for go.

also no, i work with collegues, and we mostly use python, c++ and rust, i do most of the rust stuff there, we can all agree that go is garbage tier.
>>
File: lff.gif (192 KB, 632x640)
192 KB
192 KB GIF
>we mostly use python, c++ and rust
>>
>>103569443
so much beauty in if err != nil bullshitery.

a language that can't even do iter map and filter.
>>
>>103569475
can't disclose more about the business, but we are so far ahead of all competition it's not even fun.
>>
File: 1575813903633.jpg (8 KB, 249x249)
8 KB
8 KB JPG
>>103569476
>a language that can't even do iter map and filter.
https://github.com/robpike/filter
Behold. You have been graced by the glory of Rob Pike with official apply and reduce libraries.
>>
>>103569485
>>103569475
also nasdaq registered
>>
>>103569313
>on top rust has more feature
c++ has more feature than rust
c++ wins
>>
>>103569490
my bet is that you still can't make a function that takes a stream as input, apply modifiers to it and returns the modified stream.

and if you must know, a stream is not vector, think of it like an iterator where the data is still comming.

so the stream returned by the function may be consumed some place else in many different ways, including stuff like for_each_concurrent().
>>
>>103569501
except it doesn't and it has many pitfals and memory corruption issue.

even if you are a gopher you can at least admit that rust is a better c++.

i don't see it as a replacement to c however.

the thing is go tried to do a better c and made something that's worse, and it can't compete with c++ either.
>>
File: MakeYourRustFaster.png (126 KB, 784x625)
126 KB
126 KB PNG
dont worry rustys, there's endless tools for speeding up compile times!

And this next one will definitely work!
>>
>>103569524
> 2022
> youtube

ok mate, you can 10x default incremental build time by just using mold as a linker, separating your code into different crates if it makes sense for them to be individual modules.
and then you can use cranelift for fast debug builds.

huge codebases can incremental build in < 0.5s on a 8yo cpu.
>>
>>103569523
True, Go is replacing C++, C# and Java in our company. All three have more general usage than C++ or C so that is not a bad thing anon.
>>
>>103569501
>>103569523
tell me when c++ has metaprogramming such that you can parse the ast with the language itself and output modified ast.

it's not as powerful as lisp's metaprogramming but proc_macro is pretty damn powerful.

you can even do stuff like build time static type checks on a database if you wished to do so.
>>
>>103569537
honestly i just was cursed to have to work with a shitty go codebase in a previous job and it made me hate the language.

"well" written go is honestly not that bad although still not a fan but my issue is that the language make it easy to write terrible go.

i've yet to find rust codebase that were as bad as the go one i had to work with (exluduing the ones that were made bad on purpose as a joke).
>>
>>103569490
also, no good documentation provided.
with rust you have autogen documentation of top notch quality and easily searchable.
>>
>had green threads and channels years before go even existed
>had interfaces and no classes years before go even existed
>had errors as data years before go even existed, and actually got them right
>has a self-hosted compiler that's actually good
yep, I'm thinking haskell won
>>
>>103569570
i'm the thread OP, but i can agree with you, haskell is much better than go.

not a fan of having a gagillion haskell dependencies installed whenever after i wanna install a single haskell program.

anyway, i'd take haskell over go any day.
>>
>>103569523
Rust tries to compete with bith C++ and C as well. Neither are going too well.
>> C
Rust in the Linux kernel is getting so much pushback that rust devs quit. To the point that Linus is bitching about it.
>> C++
Despite the meaningful improvements Rust has not made much leeway here either.

Additionally stuff like Zig seems to be gaining traction as well, so this focus on complex code syntax and semantics by Rust will probably bite it back in the rear soon.
>> Python
Is popular partly because of its simple syntax, Go is not much different, and that is likely the reason behind Go's steady adoption rate compared to rust.
>>
>>103569534
>default rust is 10x slower. you have to jump through 3rd party circus hoops to fix it.
why is it my job to fix the fucking language
>>
>>103569594
Though I'm personally interested in seeing rust grow despite my preference for Go.
More competion in languages is always good, and it pushes the big buys (Java, C#, C++) to actually do meaningful improvements
>>
>>103569594
> C
ther kernel argument is eh imo, as much as i like rust i don't think it has its place in the linux kernel, mixing language is almost always cursed.
though you couldn't even make a good attempt at it with go so that does say something.

> C++
it has though, tons of things is being ported and even more newly things are being made.

regarding zig, i like it but i think it's more of a better c than a better c++.

> python

i don't think i have an use case where i'd use go instead of python or rust.

if it's something serious i'd use rust, if it's a simple small script i'd use go.

only reasons would be a library i need that exist only in go, but even then i'd probably just do ffi because i don't want to have to deal with go for the whole project.
>>
>>103569604
default uses your system linker, which yes is not the fastest.

what even is your point, they just didn't want to add an extra dependency because the linker already comes with llvm.

it's trivial though, just install mold and set it as your linker.

the issue is not with the language, linking is not done by rust.
>>
>>103569617
that i could agree on.
though there are cases in history of languages being a bad example others follow.

it took a while to recover from the damage java had done on programming languages design.
>>
>>103569570
do you now the way of the monad ?
>>
>>103569523
it does
c++ has two metaprogramming methods, rust only has one
c++ templates are turing complete, rust macros are not
c++ has classes and inheritance and sum types, rust only has sum types
c++ has generics with and without traits, rust only has generics with traits
c++ has module system and headers, rust only has module system
c++ supports getting a version of an integral type which is the fastest, smallest, etc. rust does not
c++ has pointer arithmetic rust does not
c++ has implicit type coercion rust does not (u can even define ur own)
c++ has static allocation rust does not
c++ has custom allocators and fallible allocation, rust does not
c++ has exceptions, rust does not
c++ has contracts, rust does not
c++ has two type systems, rust has 1
c++ has 3 ways to make product types (struct, class and template)
rust has pattern matching? many implementations in c++ (https://raw.githubusercontent.com/BowenFu/matchit.cpp/main/include/matchit.h)
rust has ast macros? templates are more featureful way to achieve the same thing
rust has turing complete gadt? c++ template types are turing complete too
>memory corruption issue.
rust has this too in unsafe code
better to use formally verified c where memory corruption matters, rather than either

c++ support more platform. rust only cover llvm (all other backend dont target other platform)
cfront on many platforrm like plan 9, and proprietary c++ compilers in use by some government and corporation for their own thing

u mad rust? c++ dominates rust. maybe i corrupt your safe code for fun, running on same cpu i fuck your bytes. bye bye mr rust ;-)
>>
>>103569549
>ou can even do stuff like build time static type checks on a database if you wished to do so.
that is insane desu
>>
File: average go programmer.jpg (210 KB, 1254x1080)
210 KB
210 KB JPG
>>103569569
>with rust you have autogen documentation of top notch quality and easily searchable.
https://pkg.go.dev/robpike.io/filter
>>
>>103569569
what if i want to use a different format or want a feature it doesnt have like changing fonts or embedding images?
>>
>>103569443
enums are not present, hence there is no compile-time enforcement of exhaustive switches and such. Rust has this. this prevents bugs where you miss conditions. this is very useful if you add an element to an enum that has a switch ran on it in 10 different locations.
errors are returned as values, but there is no compile-time linkage of the error to the possibly-existing result. you can check for an existing error and then continue to use the undefined value. you might claim that this is useful in some cases, such as where you return a partially-modified value, where the error needs to be resolved to continue, but this could be accomplished via enums in Rust, where the enum indicates error state. once again, the Rust compiler would enforce these conditions at compile-time.
mutexes and other synchronization primitives are not linked to the values they guard at compile-time, meaning you might just forget to lock a value's corresponding mutex prior to mutating it, resulting in bugs that might only happen once a year. Rust forces you to protect shared values with some synchronization primitive, and it forces you to use them. these bugs go away entirely.

Go is gimped in order to be easily understood by noob programmers that are just getting started. their eyes bleed when they see functional concepts such as Rust iterators which allow for trivial data transformation pipelines (that can also be combined with other pipelines exposed by libraries in order to maintain linear looping over data while performing numerous operations).
I am not here to entirely shit on Go, I would definitely rather write in Go than C, but when Go programmers call it better than Rust, it is simply incorrect. Rust is a VERY well designed language with much thought put into it by programmers that have been doing this shit for decades.
>>
File: 1.png (331 KB, 1344x1400)
331 KB
331 KB PNG
>>103569733
>enums are not present,
Iota.
Did not read the rest of your post BTW.
>>
>>103569685
>c++ has two metaprogramming methods, rust only has one
nope we got both macros and proc_macro, that's 2.
if you don't count templates.

rust proc_macros are, you can even do network io within a proc_macro if you so desire.

> headers:
oh yea, the thing everyone wants removed.
> c++ has implicit type coercion rust does not (u can even define ur own)
yes it has, from that i know you are not a rust user

you can do let a = Vec::new()
and then a.push(12), from that it'll infer the type.

> c++ has exceptions, rust does not
rust has something better which is error backpropagation, "?" is a much better pattern as it forces you to handle all error cases.

> c++ has contracts, rust does not
it does, and we got even better stuff like formal verification instrumentation.
either coc of rust or prusti
https://github.com/formal-land/coq-of-rust/
https://viperproject.github.io/prusti-dev/user-guide/verify/summary.html

we also got miri:
https://github.com/rust-lang/miri

> c++ has two type systems, rust has 1

how is it a good thing exactly ?

> c++ has 3 ways to make product types (struct, class and template)
struct, enum, wrappers.

> rust has ast macros? templates are more featureful way to achieve the same thing

nope, you can process rust code with rust code and output rust code with proc macro.

you don't know what you are talking about .
>>103569685
unsafe rust is still safer than c++, you still have the borrow checkers and checks, still, most code isn't unsafe and you can focus on what is.

c++ doesn't even have streams and proper iters lmao
>>
>>103569705
i can conceide my loss on that one, still i find rust doc better.

can you locally build the doc ?

ik you can do cargo doc to build the doc for your project and all deps.
>>
>>103569716
you could make a custom doc gen for your project.
we can also embed images i've seen many crates on doc.rs that do.
>>
>>103569751
>can you locally build the doc ?
yes
>>
File: 1724622204198093.png (66 KB, 680x512)
66 KB
66 KB PNG
>>103569740
no enforcement of exhaustive checking at compile-time.
>>
>>103569740
> can't read 5 sentences
typical gophers.

actually i just realised there is no argument to be had, it's pointless to argue with a monkey.
>>
>>103569313
mindbroken rustard OP can't stop seething
>>
>>103569761
well, that's a tie on that one then.

how do you document your go code ?

in rust you can just do something like

/// this is documentation
fn foo()
>>
>>103569807
go lost the last thread, so you are the one seething.

it's not even about rust, it's about go sucking so much, i'm using rust as its contender because i had to pick one that was better than go in all aspects that matters to gophers.
>>
>>103569745
>proc_macros
fine, c++ have constexpr, that's 3. less feature les powerful
>oh yea, the thing everyone wants removed.
too bad, still thing rust doesnt have, less feature less powerful
>and then a.push(12), from that it'll infer the type.
that is not coercion that is inference. dumb fuck rust dont know even what his language features are not surprising. less feature less powerful
>rust has something better
don't care, doesnt have exceptions, less feature less powerful
>"?" is a much better pattern as it forces you to handle all error cases.
contracts do the same
>it does, and we got even better stuff like formal verification instrumentation.
thats just a different language parsing rust code..... are you dumb? not rust. less feature less powerful
>how is it a good thing exactly ?
rust has less feature therefore less powerful
>enum, wrappers
not product type, less feature less powerful
>nope, you can process rust code with rust code
with limitations. only small set of code can be evaluated. not turing complete by any means
>unsafe rust is still safer than c++, you still have the borrow checkers and checks, still, most code isn't unsafe and you can focus on what is.
don't matter, can still corrupt memory easy. no provision for logic error built into language like c++ have now. less feature less powerful
>streams
??? you stupid?
iostream, for example
>iter
what do you think "proper iter" is? hm?

anyways that is 16/16 confirmed less features. you wrong rust boy. admit ur language less powerful. maybe go back to garbage collection land mr web dev. maybe suck my cock??? lol bitch
>>
>>103569826
yeah, Go lost so bad, you had to create another thread to keep arguing against it.
this is pathetic, man
>>
File: file.png (14 KB, 526x151)
14 KB
14 KB PNG
>>103569874
seriously look up proc_macros, it's almost as powerful as lisp metaprogramming, tldr imagine they are rust functions that take rust code as input, and output rust code.

within that function you can do whatever you want within normal rust code.

> too bad, still thing rust doesnt have, less feature less powerful
what's your point exactly, a bad feature isn't a pro.

> contracts do the same
yes but it's optional, rust enforce proper error handling.

> thats just a different language parsing rust code..... are you dumb? not rust. less feature less powerful
due to the powerful macro system that can run any rust code, you can have it builtin in your code and part of the compile time check, picrel
>>
when rust boy laugh at gopher i start shaking the head. rust just worse c++.... maybe if you learn haskell like your image, then we can talk. rust is just bad haskell for idiots. not even lazy and type system is so much worse. haskell even compiles faster! lol!!
>>
>>103569874
>not product type, less feature less powerful
with limitations. only small set of code can be evaluated. not turing complete by any means

you are wrong, a proc macro can run ANY rust code, you can even do a sql request to a database or an http request within a proc macro if you so wished.

that's how sqlx optionally is able to run static checks against your database and do a compile time error in case you have rust code that's not compatible with your db schema.

> don't matter, can still corrupt memory easy. no provision for logic error built into language like c++ have now. less feature less powerful

you just don't know rust, stop trying to make arguments when you don't know what you are talking about.

> proper iter

use function chaining like map, filter etc
no c++ map doesn't count because it directly works with the data, ie you can't make a function that takes an iter as input and outputs an other modified iter, and then consume that iter somewhere else.
let alone streams, which are iter for which data is still comming (ie a tcp stream).

learn rust, become proficient at it and then try your argument again, you don't even know what proc macro is thinking it's not turing complete when you can do fucking http request and run any arbitrary rust code within it
>>
File: 1734144366708231.jpg (43 KB, 750x583)
43 KB
43 KB JPG
>>103569905
>>
>>103569892
because gopher's being real quite so i was having fun by waving their lack of response.
>>
>>103569898
>a bad feature isn't a pro.
all rust has is bad feature kek
>yes but it's optional
not when present. contract must be fulfilled
>rust enforce proper error handling.
and easy to break. contract is impossible to bypass.
>due to the powerful macro system that can run any rust code
idiot it cannot. see
https://users.rust-lang.org/t/limits-of-rust-macros/22815/2
>Macros can only expand to a limited set of complete syntactic constructs.

you dont even know ur own language. maybe u should learn rust? before pretending like its good? c++ wins and i respect gopher more than rust
>>
>>103569874
>not product type
That’s what structs are
>doesnt have exceptions
It does though, https://doc.rust-lang.org/std/panic/fn.catch_unwind.html but they’re used very rarely
You can tell a seething retarded gopher wrote all of this
>>
>>103569937
> says all rust has is bad features
> doesn't even know rust
just stop man.
> not when present. contract must be fulfilled
the use of contracts is optional...

> and easy to break. contract is impossible to bypass.
read above.
also, please tell me, i'm curious, but you won't because you don't know rust.
> >Macros can only expand to a limited set of complete syntactic constructs.

you confuse macros and proc_macro they are not the same thing nigger
https://doc.rust-lang.org/reference/procedural-macros.html
>>
File: file.png (58 KB, 893x474)
58 KB
58 KB PNG
>>103569937
>>103569950
and for reference a proc_macro looks like that
>>
go is simple language. like the faster java but also c? its cute. i dont using it ever but i think that after looking at it. better than rust which is bad c++.
>>
File: file.png (60 KB, 438x139)
60 KB
60 KB PNG
>>103569957
>>103569950
that's also how you have derive macros that allows you to automatically impl Serialize and Deserialize to your struct with 0 code.
that allows you to do stuff like that :
>>
>>103569966
you need to use something to have a good opinion of it.

be it rust or go, your opinion is irrelevant if you haven't worked with it.

i've worked extensively with both.
>>
Maybe go is good after all since it attracts all the esl pajeets like >>103569966 so that I only have to work with smart people at my haskell job
>>
>>103569970
the ability to have automatic serialization and deserialization is OP btw
have fun manually writing MarshalBinary and UnmarshalBinary methods in Go
>>
>>103569986
actually based take, i'm OP, i love go now.
>>
>>103569992
what's nice too is that it is format agnostic.
meaning if you derive Serialize and Deserialize

now you can convert your struct back and from to any format that has serde support, be it json, yaml, bincode, base64 etc...
>>
>>103569826
>that was better than go in all aspects that matters to gophers.
what about:
easy to program in?
>>
>>103570001
and of course, you can make up your own new formats with serde and they will instantly be supported by anything that derive those traits.
>>
>>103570006
read the OP post.

less sloc for more features.

go is easier to learn, but if you master both rust is defintiely an easier and more productive language.
>>
>>103570011
>go is easier to learn
this aspect matters to gophers
you lose
>>
>>103569705
>Package filter contains utility functions for filtering slices through the distributed application of a filter function.

>The package is an experiment to see how easy it is to write such things in Go. It is easy, but for loops are just as easy and more efficient.

>You should not use this package.
Based
>>
>>103570016
god he literally proposed something telling it should be used as an alternative to something that's builtin rust.
>>
>>103569947
>That’s what structs are
enum and wrapper are not struct
>but they’re used very rarely
doesnt look like exception to me. where noexcept to cuck this?

>>103569950
>just stop man.
u dont even know rust lol
>the use of contracts is optional...
and u can bypass result with error if u want
and u can write rust without ever using result
but contract cannot be bypassed when present. much safer, much better.
contract guarantee handling correct. what if handling error incorrect? rust cannot do anything or say anything. c++ can. c++ wins again!
>read above.
you read above.
>https://doc.rust-lang.org/reference/procedural-macros.html
>>103569957
its just shitty constexpr cool. c++ wins again!

>>103569976
and u dont know anything about them? i dont believe you. i think you dont know anything at all and ur just pretending all of this. but because c++ is better than the rust, you get btfo every time because c++ wins!
>>
File: file.png (113 KB, 636x116)
113 KB
113 KB PNG
>>103569970
>>103569950
you can also do stuff like that.

you can also manually impl Serialize if you so wish.
>>
>>103569986
i use haskell too bro
>>
>>103570021
He "literally" says you should just use for loops instead, wtf are you talking about?
>>
rust destroyed by c++
but it was supposed to be the killer of it.... c++ wins!
>>
>>103570027
show me how to do an http request within constexpr.

proc_macro are much more powerful and you are seething about it.
>>103570030

> and u can bypass result with error if u want
no, you cannot, but you don't know rust so what are you even trying to do.
> and u can write rust without ever using result

you cannot access the data behind a result without handling the error.

> and u dont know anything about them? i dont believe you. i think you dont know anything at all and ur just pretending all of this. but because c++ is better than the rust, you get btfo every time because c++ wins!

i've worked with c++ for over a decade, it used to be my daily driver, provided i've not updated myself after c++17 but yea, i'd not use it again, rust is just better in all things that matter.

learn rust, become good at it and then tell me you still prefer to use c++.
>>
>>103570047
for loops are not a proper replacement for iter and map, filter, chunks, zip, chain etc, let alone streams.
>>
>>103570048
someone that only knows c++ and know nothing about rust thinks c++ wins against rust.

i know both, and you are wrong.
>>
>>103570016
This is the same thing C/C++ people did with OOP, files, arrays, and a lot of other things. They make a castrated version and get people to ignore the real thing and then shout about how bad it is.
>>
>>103570062
also, they like to complain about compile time, i've seen c++ projects that takes a literal hour using all my threads to build.

i've never seen a rust project take more than 10m to fully build, let alone incremental build.
>>
>>103570006
How is go easier than rust?
>>
>>103570075
asking the good questions.
>>
>>103570075
less circumlocution to describe the same code. see any code sample comparison of the same algorithm.
>>
>>103570092
whenever i see such example, the go code is much bigger and does all kinds of bullshit and rust sometime can do that in a single oneliner.
>>
File: Socrates.jpg (375 KB, 1920x1080)
375 KB
375 KB JPG
Socrates was a gopher
>>
>>103570056
I fuckin love streams bro
Rust's iter is naturally lazy
>>
>>103570027
product types are literally structs. Dumb nigger
> doesnt look like exception to me.
That’s what panics are. The code lets you catch panics. Go should have something similar afaik
>>
>>103570101
"import solution" obviously doesn't count
>>
>>103570061
u dont even know how to make constexpr >>103570050
u dont know what type inference is
u dont know what proc_macro is
u dont know what header is
do u even know anything? u clearly dont know rust. are u maybe.... gopher?
>>
>>103570110
enum is sum type why you such a bitch? wrapper is monoid. neither are struct and i never say this shit. u r arguing against nothing. suck my cock dumb shit
>>
File: file.png (1.49 MB, 1434x857)
1.49 MB
1.49 MB PNG
>>103570108
yea, these guys just don't get it.

those two function will use google s2 cells to query scylladb / cassandra and a radius and returns you a stream of id's within that radius with their respective distance.

you can then consume it concurently like so :
futures::stream::iter(0..10000).for_each_concurrent(100, |_| async {
let r = back_geo::getnear_filter(cords, 120., &stringvec, None, &sdb).await.unwrap();
r.count().await;
}).await;


bear in mind this is code i wrote years ago when i was still learning rust, i'd do it simpler today.
>>
c++ stay winning and rust stay losing
>>
>>103570121
make an http request within a constexpr and generate code at compile time that depends of the result of that http request, i'm waiting.

auto sucks.

you don't know what proc_macro is...
i've used it in the past to make an adapter that'd bulk insert to some obscure in house proprietary databases and would just take an iter as input.
>>
>>103570153
ignorance does not make you a winner.
>>
>>103570154
lets see it then oh u wont post it because u are lying gopher
>>
>>103570180
no post what u say
post it or die like rust
u didnt because its a lie because u are a liar
c++ wins suck my cock bitch
>>
File: file.png (1.82 MB, 895x2057)
1.82 MB
1.82 MB PNG
>>103570165
see what, you can do an http request or any kind of io within proc_macro, that's a fact.
also i've posted plenty of rust code in this thread you moron.
here is some tts request code.
>>
now lying gopher deleting his post? c++ winning in weird ways
>>
>>103570208
i deleted because i made a mistake with my screenshot.
i reuploaded see>>103570200
>>
>>103570211
u still dont post it because... it is fake. idc about gay rust code. post exactly what u say and show me u writes it
>>
>>103570199
>>103570208
anyway you are losing to me because you think you can'd do network io within a proc_macro when i know that you can with full certainty.

this is your loss and your ignorance.

and you are just mad that c++ metaprogramming can't do such stuff.

come back when you can do an http request within constexpr and change the code based on the result of the request at compile time.
>>
>>103570101
Your one-liners take just as long to understand, if not more, than the 20loc equivalent.
>>
File: file.png (164 KB, 1293x1007)
164 KB
164 KB PNG
>>103570234
i don't want to create a new project just to showcase this but picrel.

you can run ANY rust code within a proc_macro function.

if you don't trust claude i'm willing to run it just for your sad little as.
>>
lol he didnt post it
one more c++ win
rust is losing real badly because it sucks worse and c++ is the coolest and has more feature and more power. gophers should learn it instead of go and rust.
>>
>>103570242
only if you are a retard.

>>103570250
are you brazilian per chance ?
>>
>>103570250
>>103570248
see.
>>
>>103570248
you dont even know rust you need ai to program for you lololololol
>>
>>103570251
>only if you are [99% of the population]
Thanks for proving my point. Programming languages shouldn't be designed around the 1% of people who have time to parse through and dissect complicated fp one-liners.
>>
>>103570255
i don't need ai to program, i've shown more than a few code example, some of which predate chatgpt.

i just used that because i don't owe you any time and you can't even look up for yourself that something as trivial can be done.

i'm not here to spoon feed you
>>
>>103570256
retards should not program.
>>
>>103570267
Too bad, bro!
>>
>>103570262
yes u do, all u posted was ai code. secret out liar gopher
>>
>>103570256
The general population can comprehend neither go nor rust lol
>>
File: file.png (265 KB, 702x539)
265 KB
265 KB PNG
>>103570274
>>103570256
>>103570281
hurr durr iters and map are so hard to understand.
>>
>>103570274
>>103570138
this is older than chatgpt.
>>
>>103570274
i'm curious, give us one of your so fabulous code.

i only used claude because it would be faster to convey my point than writting it myself and you seemed to be impatient.

to use proc macro you need to cargo init and also create a proc_macro crate, which takes a minute but i didn't feel like it only for a retard like you
>>
>>103570256
If your one-liner is incomprehensible then you can divide it up into pieces and provide a few type annotations to make things clear. Then it’s 3 or so lines and still has a much better structure than imperative control flow spaghetti
>>103570296
For the average joe? It’s possible
>>
File: gopherlook.png (10 KB, 200x120)
10 KB
10 KB PNG
>>103570296
Rust troons will justify having a 17 million LOC dependency on LLVM and compiler that is impossible to comprehend or understand in order to avoid writing this as a for loop.
var collect []int
for i := range 100 {
i *= 3
if i%4 == 0 {
collect = append(collect, i)
}
}
for i := range 3 {
fmt.Println(collect[i])
}
>>
>>103570336
you haven't read the OP i see,
LLVM is optional, you can use cranelift as a backend, in which case the total amount of code for the compiler is 1M less than go.

also that was an example, and you failed the task, because it is an iter and you are touching data directly.

now i'd like to see you passing the iter around function that modifies it and return a new modified iter only to consume it someplace else

now i'd like to see you do that with an iter over a generic type.

and lastly, use a stream instead of an iter.
think of a stream as an iterator for which the data is still comming, for example a stream of byte you recive over tcp.

with rust you can have that stream, add a bunch of function that modify it, then consume it at a whole other place with something like for_each_concurent.

the avantage of streams are that the consumer and producer of the stream are uncoupled so you can make libraries that return streams for which the users are free to use them as they see fit.
>>
>>103570352
>now i'd like to see you passing the iter around function that modifies it and return a new modified iter only to consume it someplace else
No thanks, I have real, useful software to write.
>>
File: file.png (496 KB, 1176x317)
496 KB
496 KB PNG
>>103570336
here rewrite this real function in go
and tell me your version is simpler
>>
>>103570364
I can't read this code and I'm not going to even try to bother parsing it if you can't write a language-agnostic specification.
>>
>>103570374
ask chatgpt then, and see what horseshit it is doing.

also, skill issue.
>>
File: file.png (319 KB, 993x193)
319 KB
319 KB PNG
>>103570374
you can use language agnostic specifications seamlessly in rust thanks to its metaprograming, an example of which is grpc.
you can just import a grpc schema and call functions that'll do network io as if those functions were defined in rust

in picrel, MinerServiceClient is not defined by me or a library, it's part of the grpc schema and is automatically made available as if defined struct and functions for it myself.
>>
>>103570377
>>103570387
Okay, I asked ChatGPT to translate your code into Rust. It just so happens to be 100x more readable and understandable than your line noise garbage.
// GetCommand sends a command to the specified address and returns the JSON response
func GetCommand(tp string, cmd string, parameter *string) (json.RawMessage, error) {
// Connect to the TCP server
conn, err := net.Dial("tcp", fmt.Sprintf("%s:4028", tp))
if err != nil {
return nil, fmt.Errorf("failed to connect: %w", err)
}
defer conn.Close()

// Create the command request
request := CommandRequest{
Command: cmd,
}
if parameter != nil {
request.Parameter = *parameter
}

// Marshal the request to JSON
data, err := json.Marshal(request)
if err != nil {
return nil, fmt.Errorf("failed to marshal request: %w", err)
}

// Send the request
_, err = conn.Write(data)
if err != nil {
return nil, fmt.Errorf("failed to send request: %w", err)
}

// Read the response
buffer := make([]byte, 4096)
n, err := conn.Read(buffer)
if err != nil {
return nil, fmt.Errorf("failed to read response: %w", err)
}

// Trim null terminators and any whitespace
response := strings.TrimRight(string(buffer[:n]), "\x00\r\n\t ")

// Validate the response is valid JSON
var jsonResponse json.RawMessage
if err := json.Unmarshal([]byte(response), &jsonResponse); err != nil {
return nil, fmt.Errorf("invalid JSON response: %w", err)
}

return jsonResponse, nil
}
>>
>>103570395
lmao 5x the amount of lines, if err != nil everywhere

the gopher thinks it's more readable.

maybe to someone that doesn't know rust.

i know both, and you'd think the rust version is much simpler if you knew rust as well.
>>
>>103570395
>>103570398
also your shit would take 3x as much time to write than mine.
>>
>>103570395
>>103570403
oh and your chatgpt thing is not even doing the same thing exactly, it would fuck things up on prod.
>>
File: pepe-are-you-serious.gif (82 KB, 638x616)
82 KB
82 KB GIF
>>103570398
>net.dial() vs tokio::net::TcpStream::conect(format!()).await?
But sure. Rust is more readable.

>>103570403
>>103570407
You are mentally ill.
>>
>>103570420
you just don't understand the question mark...

? means that if there is an error it should be propagated up, otherwise give the content of the result.
await is pretty straightforward.

what don't you even understand


also your fucking unmarshal lmao

if err := json.Unmarshal([]byte(response), &jsonResponse); err != nil {
return nil, fmt.Errorf("invalid JSON response: %w", err)
}

this is so much better than just "serde_json::from_str(&buffer)?"
>>
>>103570398
>if err != nil everywhere
As opposed to your code, which has absolutely 0 error handling? You are actually a genuine pathetic retard. I feel pity.
>>
>>103570395
I like the Haskell version myself. But Go looks nice.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
import Network.Socket
import Network.Socket.ByteString (send, recv)
import Control.Exception (bracket)
import Data.Aeson (ToJSON, encode, decode, object, (.=))
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
import qualified Data.ByteString.Lazy as BSL
import GHC.Generics (Generic)
data CommandRequest = CommandRequest
{ command :: String
, parameter :: Maybe String
} deriving (Show, Generic)
instance ToJSON CommandRequest
getCommand :: String -> String -> Maybe String -> IO (Maybe BSL.ByteString, String)
getCommand tp cmd param = do
let addrInfo = defaultHints { addrFlags = [AI_PASSIVE] }
addr <- head <$> getAddrInfo (Just addrInfo) (Just tp) (Just "4028")
bracket (openSocket addr) close $ \sock -> do
-- Create and send the command request
let request = CommandRequest cmd param
send sock (encode request)
-- Read and process the response
response <- recv sock 4096
let trimmedResponse = BS.takeWhile (/= 0) response

-- Decode the JSON response
return (decode (BSL.fromStrict trimmedResponse), "Invalid JSON response")
openSocket :: AddrInfo -> IO Socket
openSocket addrInfo = do
sock <- socket (addrFamily addrInfo) Stream defaultProtocol
connect sock (addrAddress addrInfo)
return sock
>>
>>103570434
it has, the question mark is error handling, it propagate the error up which.

all errors are then properly handled neatly in the same place.

it even adds and log full backtrace to it when -vvv is used with the program.
>>
>>103570360
I use this exact technique to have 3 of my libs process a big list of data in linear time (encode an element to another element, modify the encoded element, and then encode that modified element). now, you might think
>just expose atomic operations for the consumer to use in its own loop!
but no, one of those libs might consume MULTIPLE elements in order to produce ONE element, which is trivial to handle by using a CHUNK step internally within the lib.
>>
>>103570434
>>103570441
the question mark is a shortand for

match result {
Ok(r) => r,
Err(erro) => return Err(error)
}

error handling IS done
>>
File: jeet-pepe.jpg (180 KB, 1080x959)
180 KB
180 KB JPG
>>103570441
>>103570445
You are an obsessed retard. Stop making 5 posts in a row because you feel the frantic need to type our your shitbrained monkey thoughts.
>>
>>103569405
41% chance I’d say that happens soon
>>
>>103570460
shut up rajesh
>>
>>103570336
>go is easy to read
>[iterator variable] *= 3 in your path
Yea), it’s retarded. This shit will make anyone with prior experience with java or whatever do a double take.
>>
>>103570468
nah, i'm a dude, always will be
and i dislike troons, a troon would not say that.
>>103570474
so java is supposed to be a reference now ?
>>
>>103570474
i is a value that is given to me by the range loop, not the iterator variable
>>
>>103570434
>>103570441
actually that's a win, the error handling is there, but it's so seamless and simple that you didn't even saw that it was here because you don't understand the question mark operator in rust.
>>
>>103569313
Autistic as fuck. Why does my Go software make my computing life genuinely better in useful ways? Go rocks.
>>
>>103570499
because you've only tried things that are worse than go.

that doesn't make it the best option.
>>
>>103570496
No, it's because your language is so retarded and overly-designed that it's impossible to understand or parse without immersing yourself in the cult.
>>
>> GHC being a decent self hosting compiler
What kind of drugs are you on? I just checked and GHC is an absolute crapshoot it is not self contained and requires many external tools to build and port.
>> "Hadrian"
What a shitshow GHC is.
>>
The retards are in full swing, I wonder which timezone has so much free time right now
>>
>>103570520
lol, nice admission of being a retard.
>>
>>103570520
>>103570526
>>103570459
see, is it really that hard ?
don't you even undertand match / a switch case ?
>>
>>103570526
>it's not the language's fault (even though it's one of the most complicated and over-engineered languages in programming history), it's just your fault
>>
>>103570533
well if you don't know it, yes.
you guys are mediocre, i'm just gonna stop bothering.

i'll continue talking with haskell guy, he's at least interesting and know what he's doing.
>>
>>103570540
The Haskell guy said that Go looks nice. You, genuinely, have no friends, except for the other seething raging rust-tard ITT.
>>
>>103570533
>>103570540
> i don't know that technology
> why don't i understand it

also
> muh the language is complicated
> literally can't understand a switch case.
>>
File: gopher superiority.png (26 KB, 764x762)
26 KB
26 KB PNG
>>103570545
>> i don't know that technology
>> why don't i understand it
Yes, I agree. Go is superior, even though you don't know it or understand why.
>>
>>103570544
And ?
he's not exclusively a gopher.
just like i'm not exclusively doing rust, i just dislike go.

rust is closer to haskell than go is as rust is a prime citizen of FP.

go doesn't even have tail call optimization afaik.
>>
>>103570520
you are literally unable to spend even a single hour reading a fucking guide
how the fuck do you ever expect to be a decent programmer? what, you expect to be able to read a blogpost about C's Algol syntax 5 years ago and expect that to carry you throughout your entire programming career?
so fucking stupid. you are entirely unwilling to learn. you are like a woman being unwilling to learn how to check her engine's oil.
>>
>>103570558
it is better only for retards.
>>
I swear to god, the fact that the most activity in this board comes from a cuck QR code thread and a Go vs Rust dick measuring contest (I have never before seen autists measuring how many KLoC their compilers are written in)

Just use the right tool for the job. TS for Web Dev. Go for serverside. Python got ML. Rust for performant tools like browsers.
>>
>>103570567
yea i'm gonna stop talking with pajeets i think.

go is great guys, keep using it, at least i won't ever meet you at the workplace this way and i can focus on building cool shit.
>>
>>103570575
rust is nicer to work for web backend too imo.
>>
>>103570575
this is way fucking better of a thread than Mac marketing or diaper girl threads
>>
>>103570588
yea, even if we are insulting each other i mean it's 4chan, it's part of the thing.

at least here people can learn things about both go and rust by reading the thread.
>>
>>103570563
>And ?
You are a furry. You look like this.

>>103570567
Why would I spend an hour reading a guide about an unused, doomed experiment in complexity theory when I could read about a language that's actually in widespread use and powers important parts of web infrastructure? You know.... like Go.

>>103570569
"Retard" in this context is someone who's goal is simply writing software and not someone who uses a language solely out of the desire to feel superior to others.
>>
>>103570594
i'm not, my sexual life is pretty vanilla desu.

> Why would I spend an hour reading ...

just for the joy of learning, if not you'd realise it isn't that complex, and once you understand it it's quite a nifty tool in a lot of situations.

also rust is widely used, and if you come to enjoy it you could always use it more for personal project and even at the workplace.

i brought rust to my job and fixed issues we've had for years before i joined.

> "Retard" in this context is someone who's goal is simply writing software and not someone who uses a language solely out of the desire to feel superior to others.

i don't use rust to feel superior, i use it because i have more fun with it than with go, i think it's a better tool and i get the job done faster, it's less effort to put my mind into code, it just flows for me.

but gophers are so excisively pretending their language is better (when it is factually not) that i feel the need to correct them.

if you want a good example, just look at the pic of the previous thread.

sure go is simple, alright enjoy it, but don't go and pretend it's better than a language that has a lot more engineering behind it.
>>
>>103570481
yes, for better or worse, almost all programmers will have prior exposure to c++ or java or js
>>103570544
yes, but as a containment lang for pajeets, not as something I would use for work or projects myself lol
>>103570440
this haskell code is really fucking weird. are you using a tuple to return the value and the error? you have Either for that
>>103570594
if you care about widespread usage then use java. it's probably better than go in most ways these days, too. people have put in a surprising amount of work to modernize it
>>
File: 1731989351280114.gif (2.83 MB, 640x360)
2.83 MB
2.83 MB GIF
>>103570594
pic related is the average Go programmer spending 5 hours trying to figure out a subtle concurrency bug regarding a write at an invalid time
>>
>>103570638
that picture is only 1/3 accurate
- too white
- too tall
+ squatting, presumably to shit in the street
>>
File: oh no no n.jpg (127 KB, 1024x989)
127 KB
127 KB JPG
BTW rustfag has doxxed himself as working for cryptocurrency in these posts:
>>103570030
>>103569970
>>103570364 (chatgpt told me port 4028 is used for crypto mining)

Proof that Rust has no usecase outside of fucking memecoins that only serve the purpose of scamming /biz/ retards out of their money. pure ROFL fuel
>>
>>103570653
Yea, but then, i don't care that much.
>>
>>103570653
Also, i don't do mining i write software that manage hundreds of thousands of miners.
But that's only one of many things i do, i showed this because that's the most recent thing i did.
>>
>>103570509
I learned C++ first and found it less capable of creating anything I actually have interest in inventing, which is 100% serverside applications like container apps and such.

I don't see wtf else you would even made? Qt is like outdated as fuck because nobody makes GUI tools anymore, only huge enterprises where they build their own from the ground up, or Electron. So what else? Video games? No artistic talent, don't play games... kernels, drivers? Already done, not new, not novel, companies working round the clock to do the same exact thing.

Nah I just want CLI apps and server apps. There IS nothing else you can make yourself.
>>
>>103570631
>if you care about widespread usage then use java.
No thanks, I'm never writing `public static void` again when i can just func main()
>>
>>103570653
for example i shared code where i'd call a tts, that's not crypto related.

i shared other code where i'd work with geospatial data in massive amounts, also not crypto related.
>>
>>103570658
>>103570665
>>103570678
obsessed
>>
>>103570575
>right tool for the right job
brainlet meme
>>103570671
this is only relevant if you churn out a billion hello worlds instead of working on a few large applications
also apparently java 21 fixed this https://docs.oracle.com/en/java/javase/21/language/implicitly-declared-classes-and-instance-main-methods.html I don't really care because I don't write java but it is fun to see them slowly unfuck their old dinosaur
>>
>>103569313
>on top rust has more feature.
>rust does more in less code.
>rust wins.
good joke. Didn't laugh.
>>
>>103570683
i got autism and ocd wasn't that obvious
how do you think i got good at computers.

rust is only a minor subset of the cs or science related stuff i obsessed over, i'd spend my time learning all kinds of crap as a teen.
>>
>>103570683
he sounds cooler than you, faggot
post code
>>
>>103570697
the rust compiler is written in rust is less sloc and is for a language that does more thing than go for which the compiler is in go and is more sloc.
>>
>>103570696
> When Go launched, some claimed it was missing particular features or methodologies that were regarded as de rigueur for a modern language. How could Go be worthwhile in the absence of these facilities? Our answer to that is that the properties Go does have address the issues that make large-scale software development difficult. These issues include:

>slow builds
>uncontrolled dependencies
>each programmer using a different subset of the language
>poor program understanding (code hard to read, poorly documented, and so on)
>duplication of effort
>cost of updates
>version skew
>difficulty of writing automatic tools
>cross-language builds

Go was specifically created as a reaction against Java (among others). It isn't going to magically fix itself to the point where I would ever consider using it. You should also consider doing some more research into why golang is the way that it is instead of just casually dismissing it.
>>
>>103570707
Pajeet grammar detected. Opinion invalidated.
>>
>>103570701
pajeets don't do rust.
go however...
>>
>>103570717
>>103570724
also it's morning here, i'm a little tired.
>>
>>103570701
what lang is this?
>>
>>103570724
Don't be too sure about that. Pajeets are very close to being trannies.
>>
>>103570725
Take a rest dude.
>>
>>103570735
I made it (in Go, despite no longer liking Go btw). I am in this thread shitting on Go and likely know more Go than its defenders, lmao
a key feature of the language is its fault tolerance. I can pull the plug on the machine mid run, reboot, and continue where I left off (this account for parallelism)
>>
>>103570749
yea i think i'll do that.
you know autism and all i can get obsessed on things.

be it learning something new.
working.
or just arguing with strangers on things.

for that reason i try not to start things because ik i can end up being stuck on it for 20H's in a row.

but i got baited in the previous thread and here we are lol.
>>
>>103570769
actually i think you're mentally ill
>>
>>103570769
>>103570749
thanks
>>
In all seriousness though. I wonder how much damage the fact that Rust is the 'trans' language is going to do to it long term.
Maybe its a good thing that Rust draws them in and isolates them from everyone else. Which is why I personally hope that Rust will continue to exist for a long time.

Rust should be praised and promoted, so we can hopefully draw all the freaks away .
>>
>>103570699
>i am mentally ill and spent 1000 hours learning my special meme language, now i will spent 20 hours straight shitposting on 4chan
Yep. Mentally il.
>>
>>103570774
>>103570776
no fucking shit sherlock.
i was literally diagnosed with autism and ocd when i was a kid.

doesn't mean i don't know what i'm talking about, especially when it's something i obsessed over in the past.
>>
File: smug pepe.jpg (10 KB, 225x225)
10 KB
10 KB JPG
>>103570786
No, but it does mean I can safely ignore every single opinion you've ever expressed because you aren't neurotypical and therefore have no bearing on the rest of the population.
Gochads, we stay winning.
>>
>>103570783
i think the trans thing is a nsa psyop to keep software unsecure.

most rust users i know are not trans, but the troons are an excesively vocal minority so you mostly see them.

most engineer that do rust i know don't have much of an online presence if any.
>>
>>103570798
fair enough lol, the world of tech was built by autistic people though.

heck, i could consede on a tie where we agree rust is a better lang for autists and go for NT if you want.
although i know a bunch of NT that prefer rust too.
>>
>>103570808
>the world of tech was built by autistic people though.
No, it was built by people like Ken Thompson, Dennis Ritchie and Rob Pike. KYS zoomer
>>
>>103570814
nice cherry picking.
also, high functioning people aren't exactly neurotypical even if not autistic so that doesn't change my point.

dennis ritchie is not a pajeet.
>>
>>103570814
also i'm not a zoomer i'm from the 90's
>>
>>103570785
i generally don't spend much time on 4chan, this was an exception.

i'd say i either never use 4chan then there is that once in a year even where i'd be replying to a thread for 8H's.
>>
>>103570841
>>103570785
i'm doing other things at the same time though
also it took me less than a day to become proficient at rust.
>>
File: 1724879192817n.jpg (45 KB, 600x600)
45 KB
45 KB JPG
>he's still making 3 posts in a row because he can't keep his dumbass rust-autistic-to-rust-tranny pipeline thoughts in his head for more than 1 minute at a time
>>
>>103570849
i can post as much as i want, i don't care.
and yea i'm getting tired so mind doesn't work exactly in the same way.

posting is just ctrl+enter so pretty easy.
>>
>>103570849
also, i don't like troons, am not one and never will be, mentioned it a few times alread.

>>103570799
>>
>>103570849
>anyone smarter than me is negatively autistic
I hate humans
>>
>>103570853
>>103570863
You are a furry. You look like this.
>>
File: 1734133438383320.jpg (21 KB, 393x385)
21 KB
21 KB JPG
>>103570869
post code
>>
>>103570868
i mean i'm actually autistic but i live a pretty good life all things considered, i got a gf, i'll have kids p soon, i live in a tiny town in the mountains.

i can pay for my own expenses and life, so i'm pretty content.

>>103570869
nah, not a furry, not my thing.
already mentioned my sexual life is pretty vanilla.
>>
File: take this.png (33 KB, 1536x2048)
33 KB
33 KB PNG
>>103570875
>>103562109
>>
File: file.png (1.74 MB, 1379x1433)
1.74 MB
1.74 MB PNG
>>103570882
it's better because it doesn't use a hashmap but a vec instead, this does mean you need a more complex locking mechanism because insertion order must be preserved.
>>
>>103570890
>insertion order must be preserved.
No it doesn't.

for item := range chans.input {
if item.num == nextExpect {
chans.output <- item.val
nextExpect++

for {
if val, exists := backlog[nextExpect]; exists {
chans.output <- val
nextExpect++
} else {
break
}
}
} else {
backlog[item.num] = item.val
}
}
>>
>>103570882
>>103570890
also, the premise is retarded.
there is no reason to do async or multithreading on code that's sequential and cpu bound.
>>
>>103570895
insertion order on a vec needs to, not on a hashmap.

if you have vec a b and c
doing a, b ,c won't be the same as a, c, b.

thus you need to keep the correct order to extend your vec, thus the locking mechanism.

i could remove the complexity locking order keeping by using a hashmap instead.

but yea if you are doing task that extend a vec in parallel, you are gonna need to be sure to extend it in the right order and not swapping chunks of values.
>>
>>103570786
You don't understand. Autistic people interpret things in peculiar ways which might not really reflect reality. It's like schizophrenia but not schizo. Lots of armchair detective true crime writers have autism and do this, they make like weird bullshit connections due to autism.
>>
>>103570910
oh i fully get that.
but connections don't have to be bullshit, maybe irrelevant in some cases.
>>
>>103570909
>i could remove the complexity locking order keeping by using a hashmap instead.
Would love to see it in 8 hours when I wake up! Your code should involve 0 locking whatsoever like the Go code (although I do use a sync.map for safe concurrent access, idk the rust equiv)
>>
>>103570910
>>103570921
also autism is a box to put neuroatypicals in, but i've yet to find 2 autistic people that function similarly, all the ones i know are extremely different.
>>
>>103570929
Really? I've found them all the same. Here are some tells:

1. Dragonball Z
2. Anime
3. Sonic the Hedgehog
4. Brony / furry stuff
5. WWE fandom
6. Pokemon

I've found all autists to fall into the same tropes.
>>
>>103570928
sync.map use locking you just don't see it.
i could either make my wrapper type so that you don't see it, use a thread safe hashmap library that does it transparently.
or wrap it around the RwLock like i did.

i could also use unsafe and go around that whole thing if i wanted.

though i'm probably gonna do it tomorrow after i wake up.

reason, i went with the vec is that this way i can avoid doing the same computation multiple times (that's why there is the computation semaphore).
and i don't need to overwrite store a key value pair.

other ways would be making a struct that hold my data and send new data to it through a channel.
>>
>>103570943

1. Dragonball Z
nope, never saw it
2. Anime
when i was a teenager yes, not much as an adult
3. Sonic the Hedgehog
never got that
4. Brony / furry stuff
definitely not my thing
5. WWE fandom
what is that
6. Pokemon
played it as a kid but never cared that much.

i think your sample comes from discord from your list.

i know autistic people that don't even into computers, legit one i know his thing is book and another it's painting, he just paint all day.

my thing is more like computers but it's gotten old.
so now i'm more into mycology, hiking and watercolor.

i still am into computer because it has become my job but i'm not as "passionate" with it as i used to be.

i also play a little guitar but i'm not that good at it.
>>
go++ vs rust++ who wins
>>
>>103569313
Why do rushfaggots hate go for no reason? I don't use either language but rustfags always seem to hate on go
>>
>>103571160
Because of posts like this >>103553290

It's one thing to be a bad language, it's another to be bad and claim to be the best.
>>
>>103571160
Go has no purpose. Every use case it’s supposed to excel at is handled as well or better in more established languages. It’s not even fast even though it’s compiled to native
>>
>>103571374
i like the one where they need to use defer for things that'd just do it alone when exiting the function in most language because of drop().
>>
>>103571342
Nice to see Go and Rust fans have something in common
>>
>>103571414
name things that are objectively bad with rust and not just skill issues.
>>
>>103571374
Python is the most used programming language in the world. So in the end what is most important is the simplicity (simple as in having a simple syntax, not simple as in writing x lines of y in z lines of rust)
>>
>>103571414
>>103571434
oh also, name the language you think is the best.
>>
>>103571444
python is actually simple.
rust is very simple too.
go is c's level of simplicity but extra shitty.
>>
>>103571446
Nothing. There is no be all end all programming language. If there was one we would be using it.
>>
>>103571458
alright, then at least one you think is better than rust or go on all metrics that matters to you.
>>
Using go filters out people like OP, which is what matters.
>>
>>103571462
Lua. I grew up with it and its dear to me.
>>
>>103571504
op here,
i can agree that lua is comfy.
i'd take lua over go any day.
and i still use it even though rust has become my daily driver.
>>
>>103571504
In fact it was what was taught for our Uni's application dev courses.
>>
>>103569405
sincerely doubt they would do try/catch
>>
>>103571556
vocal minority.
most rust engineer i know are not troons but have close to no online presence.
>>
>>103571573
yeah
don't get me wrong i think go has a few issues but on the whole its a fine language.
I don't get the anger around it.
Go 2 should focus on those issues since it can ignore the Go1 promise of backwards compatibility
>>
>>103571590
i really dislike go, not for its philosophy but implementation.

i think however that they could build something good if they were to do a go2.
>>
>>103571590
>>103571614
and i think the anger is mostly because a lot of gophers will claim go to be the best and whatnot when i don't think it currently offers anything other langs don't as well or better.

it also has some flaws i find to be a dealbreaker.

i can understand someone using it, but claiming it's the best is a stretch imo.

heck even as a rust advocate there are a bunch of things i dislike about the language but i think that overall for now, for me at least it's the lang that gives me the most bang for my buck.
>>
File: 20241119_081304.jpg (393 KB, 1475x1500)
393 KB
393 KB JPG
>>103571619
if people are coming to you claiming that a language is the best thing since sliced bread they are retards.
The only good language after all is HolyC
>>
>>103569745
>> c++ has 3 ways to make product types (struct, class and template)
>struct, enum, wrappers.
enums are sum types, which C++ famously lacks. see their retarded Optional type lmao.
also you missed the sum type aspect in `Result`s in the previous thread when discussing error handling with gotards, the fact that not only you have to "deal with" errors, but also you would have no way to "accidentally" access garbage non-error values.
>>
File: haskell won.png (834 KB, 1484x997)
834 KB
834 KB PNG
>>103570558
>it appears that my sup-ACK!
>>
>>103571666
i'm using this one in the next /tgd/ thread lol.
i'll be sure to put it in the subject and not name this time lol
>>
>>103570594
> "Retard" in this context is someone who's goal is simply writing software and not someone who uses a language solely out of the desire to feel superior to others.

your reply to this ?:
>>103570558
>>
>>103571556
They added Python-style generators (iterators in 1.23) before like half a dozen of things they could add first instead, so who knows.
>>
>>103571706
try catch in rust would be a bad decision imo.
the error handling system is one of the best out there.

it may be a little annoying when you don't know it though i can admit.

when you do it is really great to use however.
>>
>>103571649
Autism. Even weird little anime freak shit as a pic wtf.
>>103571619
It's the best because we are loners. It's just Python (as in, easy to maintain, simple, designed around clarity) but not slow. That's it. That's what it is...

All this other bullshit can't make anything useful without many libraries or teams of people. This is a very obvious thing really. Unless it's like gamers but then it's just the autism thing again.
>>
>>103571797
>It's just Python ...
it REALLY isn't.
>>
>>103571797
what's the issue with relying on libraries exactly ?
also you don't have to so what's your point ?

some libraries were on purpose chosen not to be made part of the std for division of labor and many other reasons i don't find bad.

meanwhile go has bloat such as crypto built in.

also, that's factually wrong, there are tons of useful projects written both in go and rust.

and no, python is much better than go in terms of usability and power.

either way, in rust there are like 5 crates that are like common to see
tokio.
rand
chrono
futures
itertools

and even then, you don't need them, and no you don't need to be online to add them to a project if they are already cached on your system.

you can do cargo add --offline with no issue.

things like chrono shouldn't be in your std imo, because there are a gagilion standards that change all the time for timekeeping bs and it has no place for being builtin the langauge.
>>
>>103571797
also can't do cargo add tokio but then will literally do imports withh a git repository link in his code lmao.

and don't even talk about the go module handling thing, the way go manage dependencies is a joke.
>>
>>103571926
>>103571797
maybe that's why you are so averse to use dependencies, because it's more of a pain in go.
>>
>>103569313
>rust
AHAHAHAHAHAHAHA
can't do shit without relying on 1000+ deps
>>
>>103571904
In the ways I mentioned... Meaning it favors simplicity, legibility, and maintainability. A singular sole person all by themselves can easily build programs with it, and the programs will actually be useful. Just like a person can do with Python.

But it has less performance hit for those benefits. So you get something as easy or easier to write than Python but with a more performant end product in most scenarios.
>>
>>103571932
1. you can
2. even then a project rarely need more than 3.
3. that's only an issue for you because using deps is a pain point in go.

oh yea, i totally need aes and crypto shit to be builtin my language.
>>
>>103571934
> easier to write than python.
lol, lmao even.

> singular sole person all by themselves can easily build programs with it
show me how that's not the case with any programing language let alone rust ?
are you a nocoder that can't do anything without go or what ?
>>
>>103571919
Because each one is a potential security risk. It isn't realistic for one person to vet and keep up on all the latest releases of everything their program uses.
Some more official sources are fine. Std library is the safest option but then things like tokio are trustworthy by themselves. But then the dependencies themselves have dependencies. This is not ideal for the lone developer.

The lone developer is not going to have much luck producing useful software with Rust and maintaining it. Many reasons for this, including the compile time even. Go is the perfect language for a completely alone individual to make useful software that performs well compared to Python. That's the use case.
>>
is this thread in english?
>>
>>103571949
Because it isn't judging by the threads. The threads here pop up for various languages. They're all wastelands of useless shit like registry key listing digital-ewaste and autist circlejerking.

In Go threads I usually see people share their software. It's useful software, actually works, does useful stuff.
>>
>>103571968
there is nothing inherently more risky with using tokio than using rust or go itself.

those project have massive comunity oversight.

if you are not gonna trust your 30k+ stars repository you can't trust your programing language either.

also again, you don't need to use those crates.

and some of the crates i mentioned are officially vetted by the rust foundation on top of the comunity.

> The lone developer is not going to have much luck producing useful software with Rust and maintaining it

i call bullshit, i've done many of such software, including solving years long problems in companies i've been in.

i can just say that about go, but it's an empty statement, it's just your opinion that is also provably false.

> including the compile time even
someone didn't read the thread.
even big projects can incrementally compile in < 0.5s on a 8 year old computer, most time is spent linking and not compiling which you can 10x by just using mold as a linker.

> Go is the perfect language for a completely alone individual to make useful software that performs well compared to Python. That's the use case

perfect lmao.
garbage collector bullshit.
can't even do conditional compilation right
no metaprogramming.

also
> that perform well compared to python
lol, what a high bar !
>>
File: 1708352436675369.png (70 KB, 1132x628)
70 KB
70 KB PNG
>>103571941
Most Rust projects have 200+ deps and big ones can exceed 1000. It says a lot about a language when every problem you encounter requires you to use a crate.
>>
>>103571989
i can say literally the same thing about rust, even now i use a lot of software that's built in rust ripgrep is an example of such software i use on the daily but there are many others.
>>
>>103572003
oh yea, use tauri as a reference, something literally doing webshit, one of the inherently most bloat thing known to man....

you don't have to use those deps.
and go isn't any better.

also, there are cases where it make sense to reuse something instead of rewriting it from scratch possibly making mistakes.

the bloatest software i had to write uses around 300 deps, but the taks is inherently bloat, ie i have to talk to 5 different database due to company requirement and use a few dozen protocols and data formats.

the average software i write use 5 crates at most some of which obviously depend on others.
but the total count is rarely about 50 ish.

also don't go and pretend that common go dependencies don't themselves have dependencies.
>>
>>103572003
>language has an ecosystem robust enough that you can pull packages instead of writing your own shitty ad-hoc solution that you won't maintain
>this is le bad somehow
grow up
>>
>>103571999
>>103572013
heck my terminal emulator is written in rust

>>103572043
this
>>
>>103572003
>>103572043
also he seems to be ignoring that many deps are split into sub deps of the same project, ie you can have a multi crate project.
one example is serde being split into many submodules, or tokio being split into mio tokio stream etc.

it changes virtually nothing if it was a single library or a library split into different parts but in the same repo.

the gopher is thinking multiple files in a projects means multiple dependencies.

a single rust repo can have multiple cargo.toml and libraries interlinked.
>>
>>103572061
and that's actually good because it mean you can use only a specific part of a library you are interested in and don't have to import the whole thing if you don't need it.
>>
>>103572036
I don't care about Go.
>>103572043
So we're calling JS ecosystem robust now?
>>
>>103572070
can't be compared, we don't have an is-odd that depend of is-even that's being used by half the package in rust.

the quality of the ecosystem is defined by the quality of its engineers.

you have pajeets doing js.
not much pajeets doing rust.
>>
>>103572070
>>103572077
also anyway, those crates are practically part of the std, they are separate libraries but they are so used by the comunity it's like if they were official, some of them are actually vetted

and you'd never need more than tokio, rand, chrono, futures and itertool.

all the rest is timesaving.

heck, i could build any projects without using any dependencies if i wanted to, it just doesn't make sense.

gophers will rewrite things for the thousandth time in convoluted ways because their ecosystem is shit.
>>
>>103572070
the problem with JS isn't that you have a bunch of dependencies but rather that npm sucked. for example, a leftpad-style crisis will never happen with haskell because hackage doesn't allow packages to be deleted. I imagine that crates.io has similar safeguards
>>
>>103572105
yea, crates are immutable.
you can delete one only under exceptional cases by contacting the maitainers.
>>
also for the muh no rust software crowd.
https://github.com/rust-unofficial/awesome-rust#applications
>>
>>103572143
>pick random one
>last commit was 3 years ago
imagine my shock
>>
>>103572168
nice cherry picking.
also, if a project is done there is no need for futher commit you twat.
>>
>>103572168
>>103572179
and don't prented there aren't tons of abandoned go sofware.
>>
>>103572168
> pick random go package
> last commit 2 years ago:
https://github.com/gosuri/uitable
and at least i'm posting the source.
>>
>>103572168
4 years ago
https://github.com/tucnak/climax
2 years ago
https://github.com/integrii/flaggy
2 years ago

https://github.com/cyucelen/marker

out of 6 that's 4 that are unmaintained, damn, i thought all go packages were maintained !
>>
>>103572077
the existence of is-odd isn't a problem with the ecosystem but with the language itself. in JS, to properly test whether a number is odd, you have to first make sure that it's actually a number, and not NaN or an array or something else. [this is also a non-trivial task in JS, so is-odd has a dependency on is-number] Then, since JS only has floats, you have to make sure that the number isn't so big that it gets rounded to the nearest even number. Only then can you test whether it's divisible by 2 or not.
also, the dependencies are the other way around, is-even depends on is-odd https://www.npmjs.com/package/is-odd
>>
>>103572211
true, but my point is that he's comparing npm to cargo when they are apples to orange for many reasons.
>>
why are you so rent free about go it's a memelang just like rust go do something fun
>>
>>103572205
>>103572168
btw i got those here :
https://github.com/avelino/awesome-go

i don't think it's better than the rust one.
especially with rust having a shitton of useful databases that don't suck balls like timescaledb.
>>
>>103572225
god i can't find the name of that database that sucked ass i had to use once...
>>
>>103572225
>>103572243
nvm it was indeed influxdb, but the v1.xx which predates 2.0

1.xx was written in go and sucked balls because of tons of memory issues and OOM.

then they rewrote it in rust.
>>
gophers seething when performance critical projects ditch go for rust lol
>>
mental illness thread
>>
>>103572327
>mental illness thread
yea, thinking go is a good language is a mental illness.
>>
>>103572168
this probably happens with go too
i remember trying to find a package to work with xpath and only finding unmaintained outdated crap for go
>>
File: 1734470744463436.png (6 KB, 764x762)
6 KB
6 KB PNG
>>103569416
>there is not a single thing go can do rust cannot
Rust cannot do colorless async
>>
>>103572614
>write chan instead of async and <- instead of await
brilliant! thank you commander pike!
>>
Rust is for people can't use a real functional language aka midwits like >>103572713
>>
>>103573247
Nah it’s for people who need performance but like FP. I generally prefer Haskell but Rust is a generally better tool if I really care about speed and memory use and whatnot. Rust also learned from some of haskell’s mistakes, e.g. by unfucking a few typeclasses
>>
File: premaure optimization.jpg (24 KB, 600x338)
24 KB
24 KB JPG
>>103573266
>>
>>103572713
You forgot about writing go when invoking a function, because you're probably too retarded to understand what colorless async is lol
>>
>>103570814
>>the world of tech was built by autistic people though.
>No, it was built by people like Ken Thompson, Dennis Ritchie and Rob Pike. KYS zoomer
Those people didn't invent anything and just copied what smarter people did except made it worse. I don't know if they or the smarter people are autistic, but those are bad examples.
>>
>>103575102
I hope you weren't using Linux or any software written in C while writing this post, anon! And I sure hope your computer doesn't use UTF-8!
>>
>>103575154
They didn't invent anything in programming languages or operating systems, just copied from other people.
>>
>>103575174
Are these other people with us in the room, anon?
>>
>>103575179
Most of them are dead.
>>
>>103575192
Can you name a few?
>>
>>103572713
>Rust can't do X
>Go does X, Rust does Y, thank you!!

Are Rustsisters really this dumb? Gosh.
>>
>>103573907
Yeah that’s why I choose Haskell over Rust 97% of the time. the other 3% is for projects that need performance but like, e.g. a number cruncher that will have to run for a while. (Maybe it’d benefit from haskell’s piss easy multicore programming, but that’s another topic)
>>
>>103575288
https://www.youtube.com/watch?v=ADqLBc1vFwI
>>
>>103575338
Monads are like the tip of the iceberg so to speak. A sample of things I find scarier:
>arrows
>lenses
>TemplateHaskell
>[non-trivial] type-level programming
>Cabal
>>
>>103575251
John Backus, John McCarthy, Fred Brooks, Edsger Dijkstra, Adriaan van Wijngaarden, Niklaus Wirth, John von Neumann, Alan Kay

C and Unix didn't do anything new (they actually did less) and wouldn't be possible if smarter people didn't invent the better technology first. They had better programming languages to copy like Algol 68 and PL/I. They had better operating systems to copy like Multics. They didn't invent the PDP-11 or anything related to hardware or operating systems. The C and Unix people were just programmers who designed a language and OS that became popular.
>>
>>103575581
Kek
>>
>>103575581
>The design and features of Multics influenced the Unix operating system, which was originally written by two Multics programmers, Ken Thompson and Dennis Ritchie.
>>
File: images (64).png (21 KB, 596x514)
21 KB
21 KB PNG
>>103575581
>>103575873
>:Ken Thompson, in a transcribed 2007 interview with Peter Seibel[34] refers to Multics as "overdesigned and overbuilt and over everything. It was close to unusable. They [Massachusetts Institute of Technology] still claim it's a monstrous success, but it just clearly wasn't". On the influence of Multics on Unix, Thompson stated that "the things that I liked enough (about Multics) to actually take were the hierarchical file system and the shell — a separate process that you can replace with some other process".
Total psuedtard death. C, Go, and Unix rape your asshole.
>>
>>103575873
>>103575889
They still didn't invent anything. Copying from other people isn't the same as inventing.
>>
>>103575916
And being one of the people who worked on and created something doesn't mean they're "copying" it when they create something similar down the line.
>>
>>103576087
The specific people who made Unix didn't invent anything that's in Multics. I know you want to give them credit for inventing everything related to computers, but they didn't.
>>
File: cigar man inhand.png (116 KB, 594x594)
116 KB
116 KB PNG
>>103576196
>but they didn't.
Exactly what percentage of all servers on the internet are running Linux? Go on. I'll wait.
>>
>>103576284
Do you know what the word invent means? Samsung makes a lot of popular TVs but didn't invent the TV. Ken Thompson and Dennis Ritchie didn't invent anything. Everything in programming languages and operating systems would still exist without them.
>>
>>103576376
Seething denialism.
>>
>>103577202
>Ken Thompson
>invented C
>at the same time, Common Lisp existed and had features that C++ fucked up in implementing (anonymous functions, for example).
lmao



[Advertise on 4chan]

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.