What is the point of Go?
Now measure development time and ease of collaboration
>>107545865>rust: 265 req/s>go: 185 req/sMan I find this quite impressive for Go, I thought it would be slower considering it's not supposed to be a close-to-the-metal language, more like a lightweight C#/Java, or a scripty version of C. I will definitely keep using it now.
>>107545865Rust would be 100 times better if devs just removed 99% of features and kept the speed.
>>107546082that's called zig
>>107545865Go is a 100x easier to write and maintain than Rust and here's the crucial part: Web servers usually don't NEED blazing fast performance. In this benchmark it's not even 50% better.
>>107545948I'm a bit surprised by this. Go is definitelly bottlenecked by goroutine allocation. my guess is that the number won't differ for req/s with very lightweight handler, and goroutines/s spawning. 185 kreq/s is actually way better than goroutines/s that I saw reported on few places, might be beefy machine.sadly they don't pool them which would be the obvious optimization.otoh it's JSON processing, and Go's builtin JSON is infamously slow so might not be the case.If you take this into consideration then Rust seems really slow. I wonder where the slowness comes from. handler overhead? async cactus stack?Can't verify because medium started login-walling all articles. why is anyone even publishing on that garbage website?
>>107545865Here is your answer
>>107546519>sadly they don't pool them which would be the obvious optimization.Go never deallocates the stacks actually, they are reused
>>107545865why would anyone use go if c# can do everything go does just as easily, let's you opt in to lower level code if needed and is in general more pleasant to write with more QOL features?
>>107547130No microsoft or niggerlicious bytecode runtime prerequisites
TypeScript on Bun > everything else.It is fast.It is easy to use.It has zero compilation time and start up time is faster than that of Node.jsOnce I'll encounter a situation when it isn't fast enough, I'll invest time in rewriting the slow parts, but most projects die long before that.
>>107547201so to write desktop apps you use Typescript? what?
>>107547130C# is for the Windows platform
>>107546082The features are what give it the speed. Since the rules of Rust restrict what safe code can do, Rustc can give LLVM good hints about the code that allow LLVM to then optimize it quite well.
>>107547275>brings up desktop apps in a thread with "HTTP server benchmark" in OPWhat?
>>107545865I love goroutines
>>107547130.NET 10 is awesome. It feels like cheating. Your code is as fast as code in C++, maybe even faster because the JIT compiler can optimize for the target architecture. And if you need to hand optimize something or do SIMD, all the low level shit is available and works across architectures.
>>107547307>brings Typescript in a thread about Go vs Rustwhat?
>>107547331>doubles down on his retarded actOkay, you won.
>>107547355>brings TS on a rust vs go thread>ask about TS for desktop>le thread with "HTTP server benchmark"!!!!!sigh. I accept your concession
>>107547379Yes, you already won.
>>107547142Go has a runtime as well
>>107547296not anymore since a couple of years
>>107547511Built-in one
>>107545865No one really knows. GOOS and GOARCH in the go compiler is probably the only real selling point. Rust toolchain management is still kind of annoying.
>>107545880>measure development time and ease of collaborationHire competent people instead
>>107547296It isn't even for Windows. I still need to use pinvoke from C# a lot. A lot of the people on .NET don't even seem to know how Windows works, honestly.
>>107545865To write fast code that is good enough.What's the point of rust?
>>107547575Basement dwelling reply
>>107546519The guy probably used the single threaded tokio executor. My basic bitch webapps can do like a million req/s in synthetic benches. Single thread it's about a tenth of that or so.
>>107547590Nothing about go code is good enough. It's a shit language for midwits. It's pragmatic in some cases, but don't delude yourself that it's "good."
>>107547611let's hear what you consider a good language and why
>>107547628Not him but it's true, Go is a language specifically designed to make use of cheap labour and get low iq monkeys to program half working websites without php.A good language is Standard ML, fully specified without strange corner cases in the specification where compilers could disagree. Clean design without awkward feature bloat or pointless restrictions, for example in go const only works at the toplevel for some random reason. Superior module system. The compiler doesn't make web requests, etc. it's just infinitely better. Only problem is nobody uses it and there are few libraries, so go is probably more pragmatic for most.
>see thread>read some larpers giving opinions>close thread>go back to programming
>>107547628A couple more examples of languages that are significantly better than Go: io, bqn, zig, haskell, hare(probably, don't know it that well), tcl, scheme, pony
>>107547993>hareOpinion discarded.Drew, fuck off already.
>>107547575let's take a look at the average rust developer
>>107547575At that point you should use C or pure assembly instead of rust or anything else
>>107545865it's a good language
>>107545865Golang is objectively a terrible language, but it's often better suited than Rust because it has a GC instead of Rust's complicated ownership rules, meaning it can reduce development time.
>>107547993None of these shits are used to make real applications that are used daily by millions of people.
>>107548961PLTroons just don’t get it and never will.
>>107547275You can run C libraries with bun therefore you can create desktop apps with typescript.
>>107548929>At that point you should use C or pure assembly instead of rust or anything elseCompetent people refuse to use C.
>>107545880Rust is a much more productive language if you master it.Go's only advantage here is that it takes less time to become good at it.
>>107549040>Using a language that makes thing safer and/or easier is for incompetent people!>Unless it’s my personally liked safeguards!You are a deeply unserious person.
>>107546262zig is just as pozzed as rust
>>107547296it hasn't been for years, it's cross platform
>>107545865>What is the point of Go?Enabling midwits to create okish software.That's what its designers said.
>>107549091I don’t blame people for thinking MS will rugpull though. Their history indicates it. Plus, even if the runtime is cross platform the tooling parity is very windows-first
>>107547590>What's the point of rust?It's what modern C++ wants to be but without 60 years of legacy bloat.
>>107545948go compiles to native assembler instructions for x86. The only difference between go and rust is, that go uses garbage collection, while rust uses a different type of garbage collection.
>>107547628>hurr durr hammers are the best tools in my workshop, better than wrenches!Languages are tools. You should pick the most suitable one for given task.
>>107549056>>Using a language that makes thing safer and/or easier is for incompetent people!I never said that. That's what C programmers always say. Making things safer and easier is a good thing. The only problem is that sometimes those languages are too slow, like Python, but Rust can do it while also being faster than C and C++. Rust is also more productive than C and C++.
>>107549135Rust has no garbage collector. Rust uses RAII, just like C++.There is more differences than memory management. Go requires runtime which makes it unsuitable for bare metal programming, making drivers, kernels and such. It also lacks support for various integer types, pointer arithmetic, inline asm and other features used in systems programming.Go is closer to NodeJS than Rust/C++.
>>107549103how is the tooling very windows-first? everything i've ever needed is cross platform
>>107549067How so? Seems to be the based version of rust
>>107549236they moved from github to codeberg in part because of microsoft's association with ICE
>>107549234Use Visual Studio on Windows and it’s smooth as butter. VSCodenon Linux is spartan in comparison even with addons.
>>107549249just use rider
>>107547201What does the package manager have to do with anything?
>>107549244Source? They moved because of all the bugs.
>>107545865HTTP req/sec is the only relevant metric and a 20% performance hit is entirely acceptable for faster development time.
>>107549365Uhm ackshually no you need to do everything in punch cards and build your own custom hardware from scratch or you’re a PLEB
>>107549364In their announcement, they mentioned GitHub's relationship with ICE. If it did not play a factor then there was no reason to mention other than to get brownie points. Both equally gay.
>>107549365Web services are IO-bound anyway. 20% performance hit is not going to make any practical difference.
>>107549534This. Async performance matters some but straight line performance is irrelevant for webshittery. I prefer elixir for this reason but Go is good too and while Rust and C++ in theory can be better, the dev time tradeoff is not worth it
>>107549349I think you replied to a wrong post, mine has no mention of package managers.
>>107549602Yup. I really like Rust but if I have to write a service that will take some stuff from database and some API and expose it as REST API I'm just going to pick Node and have it done in 1h. This is not a compression utility or http proxy, the app is either idling or waiting for IO 99% of time so the extra 5ms to process a request doesn't matter.
>>107549178>Rust has no garbage collector.Rc<> is a garbage collector though. A really shitty one, but a garbage collector nonetheless.
>>107549994Rc<T> is literally just std::shared_ptr<T> but faster.
>>107550194yes, we've already established that it's a really shitty garbage collector.
>>107547275something like 40% of all desktops apps are in electron which is like 1000% worse version of node in typescript. Typescript is just a better C++, you can hate me but im telling the truth.
>>107550231>we've already established that it's a really shitty garbage collector.No "we" didn't. RAII is not a garbage collector. It doesn't require a runtime, no GC pauses, no extra cost. There is nothing in RAII that "collects garbage", no nondeterminism, there is no concept of data that is no longer referenced aka "garbage". RAII is just syntactic sugar, it simply frees the resource when that variable that owns it goes out of scope. Which is the exact same thing you would do if you were to manage that resource explicitly.
>>107550471>Typescript is just a better C++, you can hate me but im telling the truth.
>>107549178Go literally has no runtime, open any go binary in IDA and you will see it's straight machine code getting executed by the Instruction Pointer. The only "runtime" so to speak are the goroutines. The "runtime" allocates some native threads and then schedueles and preemptively interrupts goroutines. If you spawn 1000 goroutines, they will actually work better in go than naively spawning 1000 threads in your OS. It's similiar to workpools.You can include assembler code, but it is very cumbersome. There are some helper functions for manual pointer arithmeticIn rust you use smart pointers if you work with multiple threads, which work pretty much like garbage collection.
>>107545865goroutines are delicious
>>107545865>>107546082Also, compilation time is enormous,Go project with 500k LOC doesn't even get close to 10 min from the ground up.For every new iteration compilations is done in seconds.
>>107545865Very easy to learn.Compile fast and generate binariesGC and Goroutines for write concurrent software easy.Don't had unwrap()Don't need GBs storage for compiler libraries for even trivial software.A lot libraries.
>>107550847>Don't had>A lot librariessaar
>>107550834Go is also a toddler language with a mediocre compiler. Of course it's fast. It's like saying clang with -O0 is fast. It's meaningless.
>>107551049It is meaningful.It shows what the language developers value.
>>107551049>with a mediocre compiler.b8all you do is complain lmfao
>google projectETA for the -ackenning?
>>107551049clang with -O0 is really slow though.beside Go should be better than -Og
>>107551049what makes it a toddler language?
>>107550752>Go literally has no runtime, open any go binary in IDA and you will see it's straight machine code getting executed by the Instruction Pointer.It has runtime. Garbage collector and async executor are part of the runtime.You can't just compile Go into eg a dynamic library that just exposes one function that takes 2 32-bit ints and returns their sum(following default C ABI). You need to include the entire runtime and execute the code in the context of runtime. That's why Go is unsuitable for drivers, kernels, libraries and other system programming tasks.>In rust you use smart pointers if you work with multiple threads, which work pretty much like garbage collection.RAII is not a garbage collection and it's not exclusive to Rust. C++ and even C with GCC extensions support RAII. I went over the difference between RAII and garbage collection in this post: >>107550665