I'm wanting to fiddle with Go or Rust for fun but I can't seem to pick which one due to their benefits/drawbacks...

I'm wanting to fiddle with Go or Rust for fun but I can't seem to pick which one due to their benefits/drawbacks. Has anyone used both and could outline their perspective on these languages? Note: I'm specifically asking about Go and Rust because I want to better understand the strengths and weaknesses of C to develop my repertoire. Which would be more beneficial from your point of view?

Other urls found in this thread:

amazon.com/Humane-Interface-Directions-Designing-Interactive/dp/0201379376
twitter.com/SFWRedditGifs

Devs, communities, and build systems / support shit are cancerous for both so that cancels out. Just the languages then.

Go has an authoritative code-formatting tool. And... that's it. Everything else of interest, Rust also has.

Rust has memory safety without a GC. Its ideas aren't unique but you probably haven't seen them before.

So, would you rather experience the thrill of not having to care about code formatting any more, or else the experience of using a rather unusual memory safety mechanic, plus all the other shiny crap that Rust has?

I don't even know how you can ask this question.

For my part, I'll just note that Rust has almost no runtime overhead. That matters if you start processes very frequently. Rust is competitive here with even lina, which is an incredibly minimal (hosted) Forth.

They're very different languages. Go has a garbage collector, whereas Rust requires manual (well, semi-automatic) memory management. Go has a rudimentary type system, whereas Rust has a very elaborate one. Go has language-level support for communicating sequential processes, while Rust has a typical concurrency model.
Ultimately it depends on what you intend to do with either choice. Low level code (i.e. drivers and math-heavy libraries)? Rust. Somewhat high level code like web servers? Go.

In this regard I would assume that utilizing Rust's memory safety (however obtuse) would provide a stark contrast to C without using a GC.

Both languages tout being "better" than C (and/or C++) in some fashion and with the constant conjecture about these languages from pro/anti camps I'm just trying to learn how to personally spot a "meme language" so to speak.

I thank you for your perspective user.

I'm leaning toward writing lower-level applications (mostly toy projects) so Rust seems to be more versatile. Go seems neat for being a python/ruby/etc replacement for prototyping but it always seemed a bit limiting.

Obligatory:

-- Rob Pike

Go is hopeless due to gc, Rust runs on hype and unfulfilled promises. You're better off avoiding both as they won't last.

Why? Are you some kind of weirdo extremist who thinks garbage collection is never appropriate?

You might want to inform NASA, Google, Facebook, and Netflix about the "hopelessness" of garbage collectors.

Go is pretty nice honestly, it can't hurt to try it out, its style takes a little while to get used to but it's a good replacement for python once you can write it well. A lot faster than python. Garbage collector autist is always going to have autism.

Both are shitty memes, work with a real language.
Sage for mostly posting to get that faggoty stupid fucking "hurr useless captcha" thing to fuck off

Not hime, but yes. Trading dev time for run time has always been as retarded idea.


I wanted to look at rust since I use C, and C++ seemed disgusting to me, but some things weren't cool with me:
-The borrow checker is full of false positives and useless; I just want a better C
-No real GCC support, only LLVM
-I don't like thos language specific build systems.
-Static linking is default and the lang devs are overtly hostile to dynamic linking.
-Leftist central (not a deciding factor, but still a con)

I'll probably still be using C in 2050.

Spoken like a true NEET who has never worked on anything more complex than fizzbuzz.

Terrible damage control.

Well time to go back to writing Assembly...

...

GC limits you to environments where GC is acceptable. As such a GCed language will never be a general purpose language. We need a new general purpose language, not yet another Ruby.

Don't use facebook as a positive example when talking about programming languages. Their tower of babel scale disaster behind the scenes is why they've been paralyzed for a decade and unable to compete with companies that popped up like twitter. I don't think a single programmer there knows every language necessary to make a change that would have to cross a wide section of their architecture.

Yeah Rust is expensive but it's worth the money I think. Sparkling clarity in the mid range and I can already feel how much more nuanced my programs have become since I switched from Go.

Does it need an amp?

I am tired of the wheel being reinvented poorly again and again, so returned to an older language that solves a lot of the same problems, Oberon-07.

from a memester's perspective:

Could go back to Ada. It was actually useful and is a better Rust than Rust.

There's no benefit here, since compilers do almost as good as us (and better on really large projects). Also, the time traded is unknown, since you never know how many arch will need your program.

Spoken like a true entreprise drone making "quality" software.
That's not what it means, dummy.

Do you write everything in C? What's the most complex thing you have written?


Go is much faster and lower-level than Ruby. It's high-level enough that it can replace some of Ruby's use cases, but if you gave it manual memory management it can't, which makes it no longer a general purpose language.>Trading dev time for run time has always been as retarded idea.

What I have written or not isn't important, and the biggest thing I've written isn't really big a program that creates a P-frame from two I-frames using SAD and diamond search. There are big programs written in C, and even if there weren't any, it wouldn't prove anything.
By the way, show me really big and important software not written in C/C++. Java/Ruby/Go are virtually inexistant outside of entreprise circlejerk.

That's not a bad idea actually. I did a little Ada83 in college years ago. The full Ada-2012 language is a bit big for my taste, but I could go for the SPARK/Ravenscar subset. Can you recommend any starting points for SPARK? I used to read the "Home of the Brave Ada Programmers" but that site is dead and gone. I guess I can start with "SPARK GPL" from adacore.com, maybe they have some tutorial docs.

>>>/g/

If "enterprise circlejerk" covers all big and important software, then yes, Java/Ruby/Go are all "enterprise circlejerk".

Like I said, show it to me. None of this language runtime is installed on my machine and that's not by choice. I've never needed them.
Every needing performances and portability (compiler, kernel, driver, audio/video decoding/encoding, you name it) is in C or C++. Even browsers or office software are in C++.

It's not about batch performance. A GCed language simply cannot go in many places. Consider writing a kernel module in go, would it work? No. Go is not a general purpose language because of the GC so it can at best replace webdev shit like Ruby but will never replace C/C++.

You're missing the point. I didn't claim that Go was general-purpose, I claimed that there are no general-purpose languages.

Go is very suitable for webdev. It's not suitable for kernel modules. Languages with manual memory management are not suitable for webdev. They are suitable for kernel modules.

Go is not intended as a language to write kernel modules with. There are other languages for that. It's fine that you can't do that.

But that's wrong. Pointer safety is the reason we don't use C for webdev anymore, not manual memory management. I'd have used Rust to replace the garbage webdev languages if it had actually worked, but it's a mess.

If you want to better understand the difference between C and high level languages, try learning a non-meme language, such as Java, C#, or Python.

the reason you claim GC can't be in the kernel implies memory allocation can't be there either. might as well add branch prediction, memory cache, and pipelining to the list while we're at it. plenty of GC'd OS,kernels, and drivers exist.

You don't understand the problem.
No.

...

...

Go and Rust like to purport that they are an improvement on C/C++ so why not learn first-hand whether they are full of shit? No one has relayed anything other than source-less conjecture and intellectual fallacies.

best posts in this thread

Go has nothing to do with Rust, C, or C++, m8. Its main competitor is Java.

Websites are IO bound, not CPU bound. anything CPU intensive gets kicked off as a sidejob (running on another server in a full-on setup) and the web application continues on serving other clients until a result is returned, then shoots it off to the client. writing a full fledged web application in a lower level language such as Rust where the programmer has to be mindful of every memory allocation/share, how methods are invoked (directly or via v-table), and so on is a painfully common case of misguided pre-optimization. You should be concerning yourself with IO optimizations such as database and network performance, tuning the VM, or implementing caching before twiddling your bits around to gain a nanosecond or two faster computation.

Tuning a VM for a long running, highly parallelized problem such as a webserver is a feature, not a drawback. In the hands of the clueless or incompetent, the performance will be worse than a native application. But a battle-tested VM such as the JVM or BEAM coupled with experienced admins gives you a more robust & performant solution, along with other benefits such as detailed runtime introspection and hot-swapping new code.

it writes a lot more like c than java though
and has pointers

It has pointers but it doesn't have pointer arithmetic, which means its pointers are semantically equivalent to Java's references.

All that and they're still memes. They just have managers on the hook now.


CPU time remains an economic good. RAM though is more often super abundant. If your webdev uses CGI, like 99% of sites do, then any memory management at all is probably wasted effort. Allocate, never free, exit.

If you want to argue CGI, I'll just jump to the end and agree that 99% of websites are pleb tier and don't count. You should ignore the plebs and fix up pajeet sites instead like a big boy.

not an argument

POO IN LOO
O
O

I
N

L
O
O

I'd rather poo on your paycheck :^)

Not an argument!


"moron"? Lol, not an argument.


n-not an argument. Where are my molly memes. Molly help.

PAJEET NO
POO GOES IN THE LOO

Go:

Rust:

Try D or modern C++ instead. If you really must use either Go or Rust, I guess Rust might be the lesser of two evils.

Why do they all fell for the meme?
I really want to try it, but the cruft is just repulsive. 30 ways to do everything and 100 times the number of C's keyword.
Guess I'll keep using C with void* and C11 threads; should be acceptable.

Can't it be turned off? Someone correct me if I'm wrong.

I've never understood why this is considered to be a problem. It only makes programming more interesting and flexible.

Actually only about 2 times :^)

:^(

Only when you know the 30 different ways. As a C user, I simply don't want to swim in the huge standard lib. Maybe because I was mentally scarred by Java this year.

Holla Forums told me GC can be turned off, but the stdlib needs it, so you are also turning that off.

Then this is the book for you.
amazon.com/Humane-Interface-Directions-Designing-Interactive/dp/0201379376

POO IN THE LOO PAJEET

No, there's little additional work involved and it would allow me to reuse code across all projects. Not having to reinvent the wheel and have a whole different set of tools and technologies to debug and profile would save me a ton of time. I've now written rtrees and other geospatial goo in Perl, PHP, Python, and Java for example. I'll likely wind up having to do it in Go or whatever new and stupid webdev language pops up. Meanwhile, I've been reusing the same ones I made in the '90s for all non-web projects as I wrote them in C.
It's a massive waste of time rewriting everything. I just want a language that lets me safely write code that can be used everywhere, from the kernel to the web. GC prevents a language being used that generally and is just another target to rewrite everything for.

Systems guy here. That's not a problem, as long as I can reduce the locations in the code that can do spooky things I'm happy. Most code is pretty mundane.
Howver, rust is completely unusable. It has trouble dealing with 100k LoC projects and compile time tracks the size of your project and not the size of your changes suggesting it will never be usable. In order to not have shit performance with their safety scheme they need to compile everything as a giant blob but this doesn't work at all with the kinds of things systems guys work on. Also the standard library was written by morons and most of it will need to be scrapped but that's at least fixable.

I suspect that this book is more about application interface design rather than language design. In a language, having 30 ways to do everything means you get to pick the best way to do something depending on the specific context. This may lead to more elegant, efficient or understandable programs, as long as the programmer has experience and discernment.

MIR landed so your complaints should be addressed or at least be improved soon.

Only if they are similar in performance otherwise different ways of doing things is another way of saying non obvious pitfalls.

What's wrong with void*?

But one way to do things might be more efficient in one context, but not in another (eg. choosing to pass an argument by value or by const reference in C++). Being able to choose can therefore be better for performance if the programmer has some experience.


It's not type-safe. That means more runtime bugs that could have been caught during compilation.

Fair enough. I still use it sometimes, although not very often.

Just write better code and you won't have bugs.

This is what garbage collection does, people.

>hey goys, compare language1 to language2 please

I hear tell D and Zig are underrated modern systems languages.